BUBBLE_PROX_N = 100.0 ;
SCREEN_HEIGHT = 600 ;
SCREEN_WIDTH = 800 ;

function visElUpdateChange( )
	-- run at start and every time a mission state changes
	
	-- arrow slits on walls
	setToggleVisElsVisible( "rochelle3", true ) ;
	
	-- tents
	if ( isMissionComplete( "missionparisb33" ) ) then
		setToggleVisElsVisible( "tents1", true ) ;
	end
	if ( isMissionComplete( "missionrochelle7" ) ) then
		setToggleVisElsVisible( "tents2", true ) ;
	end
	
	-- rochelle cannons
	if ( isMissionComplete( "missionparisb33" ) ) then
		setToggleVisElsVisible( "rochcan1", true ) ;
		setToggleVisElsVisible( "rochcan2", true ) ;
	else
		setToggleVisElsVisible( "rochcan1", false ) ;
		setToggleVisElsVisible( "rochcan2", false ) ;
	end
	
	-- puppies
	if ( isMissionComplete( "missionsinglepuppy2" ) ) then
		setToggleVisElsVisible( "puppy_1", true ) ;
	end
	if ( isMissionComplete( "missionsinglepuppy4" ) ) then
		setToggleVisElsVisible( "puppy_2", true ) ;
	end
	
	if ( isMissionComplete( "missionmultipuppy2" ) ) then
		setToggleVisElsVisible( "puppy_3", true ) ;
		setToggleVisElsVisible( "puppy_4", true ) ;
	end
	
	if ( isMissionComplete( "missionespionage1" ) ) then
		setToggleVisElsVisible( "esp1", false ) ;
	else
		setToggleVisElsVisible( "esp1", true ) ;
	end
	
	if ( isMissionComplete( "missionrochelle19" ) ) then
		setToggleVisElsVisible( "tombstone", true ) ;
	else
		setToggleVisElsVisible( "tombstone", false ) ;
	end
end

function execute_missiontarbes1( name )
	-- servant walks up and talks
	DEBUG_OUTPUT( name .. " started" ) ;
	
	-- init some variables at start of game
	setInt( "tennisMatch", 1 ) ;
	setBoolean( "gotTennisReward", false ) ;
	setBoolean( "gunsAvailable", false ) ;
	setBoolean( "swordDropAvailable", false ) ;
	setInt( "london10timedFails", 0 ) ;
	setBoolean( "fencerschestlocked", true ) ;
	setBoolean( "dungeonchestlocked", true ) ;
	setClickObjectHighlightable( getClickObjectID( "trevilleclock" ), false ) ;
	setBoolean( "playedfrombeginning", true ) ;


	-- mission
	setPauseButtonVisible( true ) ;
	setWeaponToggleOverrideNotVisible( false ) ;
	setHealthBarVisible( false ) ;
	setOintmentButtonVisible( false ) ;
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	
	setInventoryItem( "pants_dart", 1 ) ;
	setInventoryItem( "doublet_dart", 1 ) ;
	setInventoryItem( "boot_dart", 1 ) ;
	setInventoryItem( "beret_dart", 1 ) ;
	setInventoryItem( "sashbelt_dart", 1 ) ;
	setInventoryItem( "collar_dart", 1 ) ;
	
	equipItem( "pants_dart" ) ;
	equipItem( "doublet_dart" ) ;
	equipItem( "boot_dart" ) ;
	equipItem( "beret_dart" ) ;
	equipItem( "sashbelt_dart" ) ;
	equipItem( "collar_dart" ) ;
	
	-- need to calculate this var, because it only gets calculated on load + on exit inventory screen
	setPlayerHasShoes( ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "tarbesblady", true ) ;
	setIgnoreFreeze( "familyservant1", true ) ;
	
	local overworldMusicID = addMusic( "overworld", 15 ) ;

	local dartX = 0 ;
	local dartY = 0 ;
	dartX, dartY = getCharacterPos( "dartagnan" ) ;
	
	DEBUG_OUTPUT( dartX .. " " .. dartY ) ;

	local servantStartX = dartX + ( SCREEN_WIDTH / 2 ) + 50 ;
	local servantStartY = dartY ;
	local servantDestX = dartX + 40 ;
	local servantDestY = dartY ;
	
	placeCharacter( "familyservant1", "france", servantStartX, servantStartY )
	addGoalGetToPointInLevel( "familyservant1", servantDestX, servantDestY, "france", false, true ) ;

	setMissionFaceCharacter( name, "dartagnan", "familyservant1" ) ;
	

	local locationR = 0.95 ;
	local locationG = 0.87 ;
	local locationB = 0.76 ;
	local locationA = 1.0 ;
	local locationShadowR = 0.0 ;
	local locationShadowG = 0.0 ;
	local locationShadowB = 0.0 ;
	local locationShadowA = 1.0 ;
	local locationFade = 0.0 ;

	local locationLabel = addLabel( ) ;
	setLabelText( locationLabel, getString( "mt1location" ) ) ;
	setLabelFont( locationLabel, "title_font" ) ;
	setLabelColour( locationLabel, locationR, locationG, locationB, locationA * locationFade ) ;
	setLabelShadow( locationLabel, true, 2, 2 ) ;
	setLabelShadowColour( locationLabel, locationShadowR, locationShadowG, locationShadowB, locationShadowA * locationFade ) ;
	setWindowAlign( locationLabel, "center", "bottom" ) ;
	setWindowPos( locationLabel, 0, 60 ) ;
	
	local dateLabel = addLabel( ) ;
	setLabelText( dateLabel, getString( "mt1date" ) ) ;
	setLabelFont( dateLabel, "title_font" ) ;
	setLabelColour( dateLabel, locationR, locationG, locationB, locationA * locationFade ) ;
	setLabelShadow( dateLabel, true, 2, 2 ) ;
	setLabelShadowColour( dateLabel, locationShadowR, locationShadowG, locationShadowB, locationShadowA * locationFade ) ;
	setWindowAlign( dateLabel, "center", "bottom" ) ;
	setWindowPos( dateLabel, 0, 10 ) ;
	
	local fadeTime = 1.0 ;
	local count = 0 ;
	while ( count < fadeTime ) do
		coroutine.yield( ) ;
		local deltaT = getDeltaT( ) ;
		count = count + deltaT ;
		
		locationFade = count / fadeTime ;		
		setLabelColour( locationLabel, locationR, locationG, locationB, locationA * locationFade ) ;
		setLabelShadowColour( locationLabel, locationShadowR, locationShadowG, locationShadowB, locationShadowA * locationFade ) ;
		setLabelColour( dateLabel, locationR, locationG, locationB, locationA * locationFade ) ;
		setLabelShadowColour( dateLabel, locationShadowR, locationShadowG, locationShadowB, locationShadowA * locationFade ) ;
	end

	locationFade = 1.0 ;
	setLabelColour( locationLabel, locationR, locationG, locationB, locationA * locationFade ) ;
	setLabelShadowColour( locationLabel, locationShadowR, locationShadowG, locationShadowB, locationShadowA * locationFade ) ;
	setLabelColour( dateLabel, locationR, locationG, locationB, locationA * locationFade ) ;
	setLabelShadowColour( dateLabel, locationShadowR, locationShadowG, locationShadowB, locationShadowA * locationFade ) ;
	
	wait( 4 ) ;
	
	fadeTime = 1.0 ;
	count = 0 ;
	while ( count < fadeTime ) do
		coroutine.yield( ) ;
		local deltaT = getDeltaT( ) ;
		count = count + deltaT ;
		
		locationFade = 1.0 - count / fadeTime ;		
		setLabelColour( locationLabel, locationR, locationG, locationB, locationA * locationFade ) ;
		setLabelShadowColour( locationLabel, locationShadowR, locationShadowG, locationShadowB, locationShadowA * locationFade ) ;
		setLabelColour( dateLabel, locationR, locationG, locationB, locationA * locationFade ) ;
		setLabelShadowColour( dateLabel, locationShadowR, locationShadowG, locationShadowB, locationShadowA * locationFade ) ;
	end
	
	locationLabel = safeRemoveWindow( locationLabel ) ;
	dateLabel = safeRemoveWindow( dateLabel ) ;
	

	while ( characterHasGoal( "familyservant1" ) ) do
		coroutine.yield( ) ;
		setMissionFaceCharacter( name, "dartagnan", "familyservant1" ) ;
	end
	
	-- Talk To servant
	local bubInd = characterSay( "familyservant1", true, -1, -1, true, getString( "mt1d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mt1d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
		
	setIgnoreFreeze( "tarbesblady", false ) ;
	setIgnoreFreeze( "familyservant1", false ) ;
	setMissionFreezeGame( name, false ) ;
		
	removeMusic( overworldMusicID ) ;
			
	completeMission( name ) ;
	activateMission( "missiontarbes2" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missiontarbes2( name )
	-- talk to parents
	DEBUG_OUTPUT( name .. " started" ) ;
	
	local overworldMusicID = addMusic( "overworld", 15 ) ;
	
	setPauseButtonVisible( true ) ;
	setWeaponToggleOverrideNotVisible( false ) ;
	setHealthBarVisible( false ) ;
	setOintmentButtonVisible( false ) ;
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	
	unequipItem( "sword_dart" ) ;
	setInventoryItem( "sword_dart", 0 ) ;
	setInventoryItem( "letter_dart", 0 ) ;
	
	local triggerAreaA = addTriggerArea( name, "missiontarbes2LockOut", true, "france", 
		{ -8102, 16883, -7789, 17372 } ) ;
		
	local id = addMarkerCharacter( name, true, getString( "mt2m1" ), "father" ) ;
	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "followpath", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	local oldDartX = 0 ;
	local oldDartY = 0 ;
	oldDartX, oldDartY = getCharacterPos( "dartagnan" ) ;
	wait( 5 ) ;
	
	local newDartX = 0 ;
	local newDartY = 0 ;
	newDartX, newDartY = getCharacterPos( "dartagnan" ) ;
	
	local dartMoved = distanceBetweenPoints( oldDartX, oldDartY, newDartX, newDartY ) ;
	local playerHasntMovedDist = 10 ;
	if ( dartMoved < playerHasntMovedDist ) then
		-- if player hasn't moved by now then show them the tutorial telling them how to move
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "movement1", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
	end
	
	
	-- show tutorial on how to go inside house if player takes too long
	local closeToDoorLast = false ;
	local timeCloseToDoor = 0.0 ;
	local showTutorialTime = 5.0 ;
	local showedTutorial = false ;
	while ( ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "dartelderhouse" ) ) and ( not showedTutorial ) ) do
		if ( distanceToPoint( "dartagnan", "france", -9160, 17080 ) < 100 ) then
			timeCloseToDoor = timeCloseToDoor + getDeltaT( ) ;
			if ( timeCloseToDoor > showTutorialTime ) then
				if ( isCharacterIdle( "dartagnan" ) ) then
					waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
					setDialogueScript( "goinside", 0 ) ;
					waitForNoActiveTutorialDialogue( ) ;
					showedTutorial = true ;
				end
			end
			closeToDoorLast = true ;
		else
			closeToDoorLast = false ;
			timeCloseToDoor = 0.0 ;
		end
		coroutine.yield( ) ;
	end
	

	-- show tutorial for speaking to father
	local closeToCharacterLast = false ;
	local timeCloseToCharacter = 0.0 ;
	local showTutorialTime = 4.0 ;
	local showedTutorial = false ;
	local waitingTalkNum = setWaitingForTalk( "dartagnan", "father", false ) ;
	while ( not hasWaitingTalkOccured( waitingTalkNum ) ) do
		if ( not showedTutorial ) then
			if ( distanceBetweenCharacters( "dartagnan", "father" ) < 90 ) then
				timeCloseToCharacter = timeCloseToCharacter + getDeltaT( ) ;
				if ( timeCloseToCharacter > showTutorialTime ) then
					
					if ( isCharacterIdle( "dartagnan" ) ) then
					
						waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
						setDialogueScript( "talktocharacter", 0 ) ;
						waitForNoActiveTutorialDialogue( ) ;
						showedTutorial = true ;
					end
				end
				closeToCharacterLast = true ;
			else
				closeToCharacterLast = false ;
				timeCloseToCharacter = 0.0 ;
			end
		end
	
		coroutine.yield( ) ;
	end
	setDoneWaitingTalk( waitingTalkNum ) ;
	
	--waitForTalk( "dartagnan", "father", false ) ;
	removeMarker( name, id ) ;
	
	setMissionFaceCharacter( name, "father", "dartagnan" ) ;
	setMissionFreezeGame( name, true ) ;
	--lockPlayerInPlace( ) ;
	local bubInd = characterSay( "father", true, -1, -1, true, getString( "mt2d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mt2d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "father", true, -1, -1, true, getString( "mt2d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "father", true, -1, -1, true, getString( "mt2d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "father", true, -1, -1, true, getString( "mt2d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "father", true, -1, -1, true, getString( "mt2d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	playSound( "paper", 1.0 ) ;
	bubInd = characterSay( "father", true, -1, -1, true, getString( "mt2d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mt2d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "father", true, -1, -1, true, getString( "mt2d9" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mt2d10" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "father", true, -1, -1, true, getString( "mt2d11" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "father", true, -1, -1, true, getString( "mt2d12" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	--unlockPlayerInPlace( ) ;
	setMissionFaceNone( name, "father" ) ;
	
	-- give sword to d'Artagnan
	setInventoryItem( "sword_dart", 1 ) ;
	equipItem( "sword_dart" ) ;
	setInventoryItem( "letter_dart", 1 ) ;
		
	id = addMarkerCharacter( name, true, getString( "mt2m2" ), "mother" ) ;
	waitForTalk( "dartagnan", "mother", false ) ;
	removeMarker( name, id ) ;
	
	setMissionFreezeGame( name, true ) ;
		
	local bubInd = characterSay( "mother", true, -1, -1, true, getString( "mt2d13" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mt2d14" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "mother", true, -1, -1, true, getString( "mt2d15" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mt2d16" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	
	
	-- give ointments
	setInventoryItem( "ointment", 4 ) ;
	
	addMoney( 45 ) ;
	
	removeTriggerArea( triggerAreaA ) ;
	
	removeMusic( overworldMusicID ) ;
	
	completeMission( name ) ;
	activateMission( "missiontarbes3" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missiontarbes2LockOut( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mt1d3" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mt1d3" ) ) ;
	
	local x = -8178 ;
	local y = 17209 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end
	
	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end

function execute_missiontarbes3( name )
	-- get on horse and ride to title screen
	DEBUG_OUTPUT( name .. " started" ) ;
		
	local overworldMusicID = addMusic( "overworld", 15 ) ;
			
	setPauseButtonVisible( true ) ;
	setWeaponToggleOverrideNotVisible( false ) ;
	setHealthBarVisible( false ) ;
	setOintmentButtonVisible( false ) ;
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
		
	local triggerAreaA = addTriggerArea( name, "missiontarbes2LockOut", true, "france", 
		{ -8102, 16883, -7789, 17372 } ) ;

	setOwnedHorse( "dartagnan", "horse1" ) ;
	placeVehicle( "horse1", "france", -8543, 17282 ) ;
	lockHorseMovement( "horse1", true ) ;
	
	local marker = addMarkerVehicle( name, true, getString( "mt3m1" ), "horse1" ) ;
	
	-- parents walk out to see d'Artagnan off
	resetCharacterAI( "father" ) ;
	resetCharacterAI( "mother" ) ;
	addGoalGetToPointInLevel( "father", -8900, 17200, "france", false, true ) ;
	addGoalGetToPointInLevel( "mother", -8850, 17200, "france", false, true ) ;
	
	placeCharacter( "familyservant1", "france", -8950, 17200 ) ;
	placeCharacter( "tarbesalady", "france", -8700, 17200 ) ;
	placeCharacter( "tarbesaman", "france", -8650, 17200 ) ;
	placeCharacter( "tarbesblady", "france", -8865, 17350 ) ;
	placeCharacter( "tarbesbman", "france", -8815, 17350 ) ;
	placeCharacter( "tarbesclady", "france", -8715, 17350 ) ;
	--placeCharacter( "tarbescman", "france", -8500, 17200 ) ; -- do this through place because sit message screws it up
	placeCharacter( "tarbescservant", "france", -8615, 17350 ) ;
	resetCharacterAI( "familyservant1" ) ;
	resetCharacterAI( "tarbesalady" ) ;
	resetCharacterAI( "tarbesaman" ) ;
	resetCharacterAI( "tarbesblady" ) ;
	resetCharacterAI( "tarbesbman" ) ;
	resetCharacterAI( "tarbesclady" ) ;
	resetCharacterAI( "tarbescservant" ) ;
	
	
	-- show tutorial on how to go outside house if player takes too long
	local closeToDoorLast = false ;
	local timeCloseToDoor = 0.0 ;
	local showTutorialTime = 6.0 ;
	local showedTutorial = false ;
	while ( ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "france" ) ) and ( not showedTutorial ) ) do
		if ( distanceToPoint( "dartagnan", "dartelderhouse", -57, 332 ) < 160 ) then
			timeCloseToDoor = timeCloseToDoor + getDeltaT( ) ;
			if ( timeCloseToDoor > showTutorialTime ) then
				if ( isCharacterIdle( "dartagnan" ) ) then
					waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
					setDialogueScript( "gooutside", 0 ) ;
					waitForNoActiveTutorialDialogue( ) ;
					showedTutorial = true ;
				end
			end
			closeToDoorLast = true ;
		else
			closeToDoorLast = false ;
			timeCloseToDoor = 0.0 ;
		end
		coroutine.yield( ) ;
	end
	
	while ( not characterIsDriving( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end
	
	lockHorseMovement( "horse1", false ) ;
	removeMarker( name, marker ) ;

	removeTriggerArea( triggerAreaA ) ;
	
	local markerPosX = -6467 ;
	local markerPosY = 15996 ;
	local marker = addMarkerPosition( name, true, getString( "markerparis" ), "france", markerPosX, markerPosY ) ;
	
	while( not characterWithinOfPoint( "dartagnan", "france", markerPosX, markerPosY, 1000.0 ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	-- put character back to there normal positions
	clearGoals( "mother" ) ; -- could still be walking outside
	place_mother( "mother" ) ;
	resetCharacterAI( "mother" ) ;
	clearGoals( "father" ) ; -- could still be walking outside
	place_father( "father" ) ;
	resetCharacterAI( "father" ) ;
	place_familyservant1( "familyservant1" ) ;
	resetCharacterAI( "familyservant1" ) ;
	place_tarbesalady( "tarbesalady" ) ;
	resetCharacterAI( "tarbesalady" ) ;
	place_tarbesaman( "tarbesaman" ) ;
	resetCharacterAI( "tarbesaman" ) ;
	place_tarbesblady( "tarbesblady" ) ;
	resetCharacterAI( "tarbesblady" ) ;
	place_tarbesbman( "tarbesbman" ) ;
	resetCharacterAI( "tarbesbman" ) ;
	place_tarbesclady( "tarbesclady" ) ;
	resetCharacterAI( "tarbesclady" ) ;
	place_tarbescservant( "tarbescservant" ) ;
	resetCharacterAI( "tarbescservant" ) ;
	
	removeMusic( overworldMusicID ) ;
		
	completeMission( name ) ;
	activateMission( "missiontarbes4" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missiontarbes4( name )
	-- title screen and fight tutorial
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setOverrideNoHealthOintmentTutorial( true ) ;
	
	enableAmbientSoundType( "forest", false ) ;
		
	local overworldMusicID = addMusic( "overworld", 15 ) ;
			
	setPauseButtonVisible( true ) ;
	setWeaponToggleOverrideNotVisible( false ) ;
	setHealthBarVisible( false ) ;
	setOintmentButtonVisible( false ) ;
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	
	local triggerAreaA = addTriggerArea( name, "missiontarbes4LockOut1", true, "france", 
		{ -8102, 16683, -7789, 17372 } ) ;
		
	local triggerAreaB = addTriggerArea( name, "missiontarbes4LockOut2", true, "france", 
		{ -4405, 14252, -4270, 14498 } ) ;


	local markerPosX = -3822 ;
	local markerPosY = 13983 ;
	local marker = addMarkerPosition( name, true, getString( "markerparis" ), "france", markerPosX, markerPosY ) ;

	-- create enemy
	local enemyStartX = -5398 ;
	local enemyStartY = 14366 ;
	local tempChar1 = createTempCharacter( getString( "highwayman" ), "france", enemyStartX, enemyStartY ) ;
	setStatsCalculatorStatic( tempChar1, 5, 5, 5, 5 ) ; -- 6, 6, 6, 6
	--setStatsCalculatorDynamic( tempChar1, -10, -10, 2, 1000, 0.5 ) ;
	randomDressEnemy( tempChar1, 0.0, 6421 ) ;
	setMeleeWeapon( tempChar1, "sword_1" ) ;
	setMissionFaceCharacter( name, tempChar1, "dartagnan" ) ;
	
	removeMusic( overworldMusicID ) ;
		
	-- play title music
	local titleMusicID = addMusic( "title", 15 ) ;
	wait( 1 ) ; -- delay showing logo after music has started
	
	-- show Three Musketeers logo
	local titleOpacity = 0.0 ;
	local time = 0.0 ;
	local fadeInTime = 0.5 ;
	while ( time < fadeInTime ) do
		time = time + getDeltaT( ) ;
		titleOpacity = time / fadeInTime ;
		setTitleOpacity( titleOpacity ) ;
		coroutine.yield( ) ;
	end

	titleOpacity = 1.0 ;
	setTitleOpacity( titleOpacity ) ;
	wait( 5 ) ;
	
	time = 0.0 ;
	local fadeOutTime = 0.5 ;
	while ( time < fadeOutTime ) do
		time = time + getDeltaT( ) ;
		titleOpacity = 1.0 - time / fadeOutTime ;
		setTitleOpacity( titleOpacity ) ;
		coroutine.yield( ) ;
	end
	
	setTitleOpacity( 0.0 ) ;

	-- wait until we get close to enemy
	local closeDist = 200.0 ;
	local stopMusicDist = 900.0 ;
	local stopMusicTime = 30.0 ;
	while ( distanceBetweenCharacters( "dartagnan", tempChar1 ) > closeDist ) do
		stopMusicTime = stopMusicTime - getDeltaT( ) ;
		
		-- stop title music once we get close or if it has been playing for a while
		if ( ( distanceBetweenCharacters( "dartagnan", tempChar1 ) < stopMusicDist )
			or ( stopMusicTime <= 0.0 ) ) then
			if ( not ( titleMusicID == -1 ) ) then
			--	removeMusic( titleMusicID ) ;
			--	titleMusicID = -1 ;
			end
		end
	
		coroutine.yield( ) ;
	end

	--local tenseMusicID = addMusic( "tense", 15 ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( tempChar1, true ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", enemyStartX - 100, enemyStartY, "france", false ) ;
	waitForNoGoal( "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", tempChar1 ) ;

	local bubInd = characterSay( tempChar1, true, -1, -1, true, getString( "mt4d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mt4d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( tempChar1, true, -1, -1, true, getString( "mt4d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mt4d5" ), getString( "mt4d6" ) ) ;
	
	local waitedTime = 0.0 ;
	local tutAfterTime = 5.0 ;
	while ( isBubbleOpen( bubInd ) ) do
		waitedTime = waitedTime + getDeltaT( ) ;
		if ( waitedTime > tutAfterTime ) then
			-- do tut for chosing option
			waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
			setDialogueScript( "clickbubbleoption", bubInd ) ;
			waitForNoActiveTutorialDialogue( ) ;
			while ( isBubbleOpen( bubInd ) ) do
				-- wait until bubble is closed to continue normal execution path
				coroutine.yield( ) ;
			end
		else
			coroutine.yield( ) ;
		end
	end
	local optionPressed = bubbleOptionPressed( bubInd ) ;
	deleteBubble( bubInd ) ;
	local option = optionPressed ;
	
	--local option = waitForBubbleOption( bubInd ) ;
	
	if ( option == 1 ) then
		bubInd = characterSay( tempChar1, true, -1, -1, true, getString( "mt4d7" ) ) ;
		waitForBubbleClosed( bubInd ) ;
		bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mt4d8" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	end
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( tempChar1, false ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;

	removeMusic( titleMusicID ) ;
	--removeMusic( tenseMusicID ) ;

	makeEnemies( "dartagnan", tempChar1 ) ;
	addWatchCharacterUnlimited( tempChar1 ) ;
	setIgnoreAll( tempChar1, true ) ; -- enemy won't come at us
	
	removeMarker( name, marker ) ;
	local marker = addMarkerCharacter( name, true, getString( "mt4m1" ), tempChar1 ) ;

	gTutAttackEnemyName = tempChar1 ;	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "attackenemy", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	setIgnoreAll( tempChar1, false ) ;
	setHealthBarVisible( true ) ;
	
	-- make sure dartagnan doesn't die
	setCharacterSlowDamage( "dartagnan", true ) ;
	
	wait( 2 ) ;
		
	while ( not isCharacterFighting( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end
	
	-- character is fighting now - freeze game and show tutorial for player health bar + enemy health bar
	setMissionFreezeGame( name, true ) ;
		
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "playerhealthbar", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;

	setMissionFreezeGame( name, false ) ;

	wait( 2 ) ;

	--while ( isCharacterAlive( tempChar1 ) and ( not isCharacterFighting( "dartagnan" ) ) ) do
	--	coroutine.yield( ) ;
	--end
	
	local clickEnemyTutNum = 3 ;
	
	while ( isCharacterAlive( tempChar1 ) and ( getFightClickedOnCharacter( tempChar1 ) <= clickEnemyTutNum ) ) do
		coroutine.yield( ) ;
	end
	
	if ( isCharacterAlive( tempChar1 ) and ( getFightClickedOnCharacter( tempChar1 ) >= clickEnemyTutNum ) ) then
		-- show "don't click" tutorial if player has clicked opponent a lot
		setMissionFreezeGame( name, true ) ;
			
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "fight1repeatclick", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
	
		setMissionFreezeGame( name, false ) ;		
	end

	-- if player keeps clicking, tell them again
	local clickEnemyTutNum = getFightClickedOnCharacter( tempChar1 ) + 4 ;
	
	while ( isCharacterAlive( tempChar1 ) and ( getFightClickedOnCharacter( tempChar1 ) <= clickEnemyTutNum ) ) do
		coroutine.yield( ) ;
	end
	
	if ( isCharacterAlive( tempChar1 ) and ( getFightClickedOnCharacter( tempChar1 ) >= clickEnemyTutNum ) ) then
		-- show "don't click" tutorial if player has clicked opponent a lot
		setMissionFreezeGame( name, true ) ;
			
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "fight1repeatclick", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
	
		setMissionFreezeGame( name, false ) ;		
	end

	while ( isCharacterAlive( tempChar1 ) ) do
		coroutine.yield( ) ;
	end	
	
	setCharacterSlowDamage( "dartagnan", false ) ;
		
	-- make sure dartagnan was injured at least a bit
	if ( getRatioHealth( "dartagnan" ) > 0.9 ) then
		setRatioHealth( "dartagnan", 0.9 ) ;
	end	
	
	setOintmentButtonVisible( true ) ;
	--coroutine.yield( ) ; -- let ointment position itself
		
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "useointment", 1 ) ;
	waitForNoActiveTutorialDialogue( ) ;

	removeMarker( name, marker ) ;
	
	removeTriggerArea( triggerAreaA ) ;
	removeTriggerArea( triggerAreaB ) ;
	
	enableAmbientSoundType( "forest", true ) ;
	
	setOverrideNoHealthOintmentTutorial( false ) ;
	
	completeMission( name ) ;
	activateMission( "missiontarbes5" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missiontarbes4LockOut1( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mt4d1" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mt4d1" ) ) ;

	local x = -7689 ;
	local y = 16950 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function missiontarbes4LockOut2( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mt4d10" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mt4d10" ) ) ;
		
	local x = -4468 ;
	local y = 14358 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function execute_missiontarbes5( name )
	-- Open barrel
	DEBUG_OUTPUT( name .. " started" ) ;
		
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	
	local triggerAreaA = addTriggerArea( name, "missiontarbes5LockOut1", true, "france", 
		{ -4028, 12404, -3393, 12729 } ) ;
		
	--local markerPosX = -2258
	--local markerPosY = 9081 ;
	--local marker = addMarkerPosition( name, true, getString( "markerparis" ), "france", markerPosX, markerPosY ) ;

	local markerPosX = -4197 ;
	local markerPosY = 12915 ;
	local marker = addMarkerPosition( name, true, getString( "markerparis" ), "france", markerPosX, markerPosY ) ;


	local barrelID = getClickObjectID( "tutbarrel" ) ;
	local barrelX = 0 ;
	local barrelY = 0 ;
	barrelX, barrelY = getClickObjectPos( barrelID ) ;
	
	-- make sure barrel is closed and clickable
	setClickObjectTileState( barrelID, 1 ) ;
	setClickObjectHighlightable( barrelID, true ) ;
	
	local proximity = 650.0 ;
	while ( distanceToClickObject( "dartagnan", barrelID ) > proximity ) do
		coroutine.yield( ) ;
	end

	lockPlayerInPlace( ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", -4190, 13356, "france", false ) ;
	waitForNoGoal( "dartagnan" ) ;

	unlockPlayerInPlace( ) ;
	
	removeMarker( name, marker ) ;
	local marker = addMarkerClickObject( name, true, getString( "mt5m1" ), barrelID ) ;

	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "searchbarrel", barrelID ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	-- wait for item to exist
	while( not pickUpElementExists( "tut_barrel_ointment" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	addMarkerPickUp( name, true, getString( "mt5m2" ), "tut_barrel_ointment" ) ;
	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "pickupointment", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
				
	removeMarker( name, marker ) ;
	
	removeTriggerArea( triggerAreaA ) ;
		
	completeMission( name ) ;
	activateMission( "missiontarbes6" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end	
	
function missiontarbes5LockOut1( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mt5d3" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mt5d3" ) ) ;
		
	local x = -3839 ;
	local y = 12803 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end
	
function execute_missiontarbes6( name )
	-- Open chest
	DEBUG_OUTPUT( name .. " started" ) ;
		
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
		
	local triggerAreaA = addTriggerArea( name, "missiontarbes6LockOut1", true, "france", 
		{ -3970, 11406, -3252, 11778 } ) ;
		
	local markerPosX = -2258
	local markerPosY = 9081 ;
	local marker = addMarkerPosition( name, true, getString( "markerparis" ), "france", markerPosX, markerPosY ) ;

	local chestID = getClickObjectID( "tutchest" ) ;
	local chestX, chestY = getClickObjectPos( chestID ) ;
	
	-- make sure chest is closed and clickable
	setClickObjectTileState( chestID, 1 ) ;
	setClickObjectHighlightable( chestID, true ) ;
	
	-- make sure we don't have any gloves from picking them up previously
	unequipItem( "gloves_poor_1" ) ;
	setInventoryItem( "gloves_poor_1", 0 ) ;
	
	local proximity = 400.0 ;
	while ( distanceToClickObject( "dartagnan", chestID ) > proximity ) do
		coroutine.yield( ) ;
	end

	lockPlayerInPlace( ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", -3618, 12093, "france", false ) ;
	waitForNoGoal( "dartagnan" ) ;

	unlockPlayerInPlace( ) ;
	
	removeMarker( name, marker ) ;
	local marker = addMarkerClickObject( name, true, getString( "mt6m1" ), chestID ) ;

	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "searchchest", chestID ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	-- wait for item to exist
	while( not pickUpElementExists( "tut_chest_gloves" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	addMarkerPickUp( name, true, getString( "mt6m2" ), "tut_chest_gloves" ) ;

	-- wait until gloves are in players inventory	
	while( numOfItemType( "gloves_poor_1" ) < 1 ) do
		coroutine.yield( ) ;
	end
				
	removeMarker( name, marker ) ;
	
	setInventoryButtonVisible( true ) ;
	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "inventory", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	removeTriggerArea( triggerAreaA ) ;
		
	completeMission( name ) ;
	activateMission( "missiontarbes7" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end	
	
function missiontarbes6LockOut1( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mt6d2" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mt6d2" ) ) ;
	
	local x = -3744 ;
	local y = 11832 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end
	
function execute_missiontarbes7( name )
	-- fight two enemies and get map
	DEBUG_OUTPUT( name .. " started" ) ;
		
	setMapButtonVisible( false ) ;
	
	local triggerAreaA = addTriggerArea( name, "missiontarbes7LockOut1", true, "france", 
		{ -3572, 9260, -2643, 9498 } ) ;
	
	local markerPosX = -2258
	local markerPosY = 9081 ;
	local marker = addMarkerPosition( name, true, getString( "markerparis" ), "france", markerPosX, markerPosY ) ;

	-- two enemies attacking roadhousebman
	local enemy1PosX = -3164 ;
	local enemy1PosY = 9990 ;
	local enemy1 = createTempCharacter( getString( "highwayman" ), "france", enemy1PosX, enemy1PosY ) ;
	setStatsCalculatorStatic( enemy1, 3, 3, 3, 3 ) ; -- 4, 4, 4, 4
	randomDressEnemy( enemy1, 0.0, 7123 ) ;
	setMeleeWeapon( enemy1, "sword_1" ) ;
	setMissionFaceCharacter( name, enemy1, "roadhousebman" ) ;
	
	local enemy2PosX = -3247 ;
	local enemy2PosY = 10038 ;
	local enemy2 = createTempCharacter( getString( "highwayman" ), "france", enemy2PosX, enemy2PosY ) ;
	setStatsCalculatorStatic( enemy2, 3, 3, 3, 3 ) ; -- 4, 4, 4, 4
	randomDressEnemy( enemy2, 0.0, 7124 ) ;
	setMeleeWeapon( enemy2, "sword_1" ) ;
	setMissionFaceCharacter( name, enemy2, "roadhousebman" ) ;
	
	setMissionFaceDirection( name, "roadhousebman", 1, 1 ) ;
	--setMissionFaceCharacter( name, "roadhousebman", enemy2 ) ;
	
	local checkDistPointX = -2896 ;
	local checkDistPointY = 9637 ;
	while( not characterWithinOfPoint( "dartagnan", "france", checkDistPointX, checkDistPointY, 700.0 ) ) do
		coroutine.yield( ) ;
	end
	
	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	-- dartagnan is close enough - walk d'artagnan over and play script
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "roadhousebman", true ) ;
	setIgnoreFreeze( enemy1, true ) ;
	setIgnoreFreeze( enemy2, true ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", -3323, 10092, "france", false ) ;
	waitForNoGoal( "dartagnan" ) ;

	setMissionFaceCharacter( name, "dartagnan", "roadhousebman" ) ;
	local bubInd = characterSay( "roadhousebman", true, -1, -1, true, getString( "mt7d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "dartagnan", enemy1 ) ;
	bubInd = characterSay( enemy1, true, -1, -1, true, getString( "mt7d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "dartagnan", "roadhousebman" ) ;
	setMissionFaceCharacter( name, "roadhousebman", "dartagnan" ) ;
	bubInd = characterSay( "roadhousebman", true, -1, -1, true, getString( "mt7d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	local option = -1 ;
	repeat
		bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mt7d4" ), getString( "mt7d5" ) ) ;
		option = waitForBubbleOption( bubInd ) ;
		if ( option == 1 ) then
			bubInd = characterSay( "roadhousebman", true, -1, -1, true, getString( "mt7d6" ) ) ;
			waitForBubbleClosed( bubInd ) ;
		end
	until option == 0 ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "roadhousebman", false ) ;
	setIgnoreFreeze( enemy1, false ) ;
	setIgnoreFreeze( enemy2, false ) ;
	
	removeMarker( name, marker ) ;
	
	local markerEnemy1 = addMarkerCharacter( name, true, getString( "fightmarker" ), enemy1 ) ;
	local markerEnemy2 = addMarkerCharacter( name, true, getString( "fightmarker" ), enemy2 ) ;
	
	removeMusic( tenseMusicID ) ;
		
	makeEnemies( "dartagnan", enemy1, enemy2 ) ;




	-- fighting two enemies
	setCharacterSlowDamage( "dartagnan", true ) ;	
	setCharacterSlowDamage( enemy1, true ) ;	
	setCharacterSlowDamage( enemy2, true ) ;
	
	local timerPlayerNotFight = 0.0 ; -- if player doesn't fight both for some reason, just skip the tutorial
	local skipTutorialTime = 20.0 ;
	while ( ( not ( isCharacterFighting( "dartagnan" ) and isCharacterFighting( enemy1 ) and isCharacterFighting( enemy2 ) ) ) 
		and ( timerPlayerNotFight < skipTutorialTime ) ) do
		timerPlayerNotFight = timerPlayerNotFight + getDeltaT( ) ;
		coroutine.yield( ) ;
	end
	
	if ( timerPlayerNotFight < skipTutorialTime ) then
		-- every one is in combat
		
		-- show player fighting both opponents for a few seconds
		setTimeUntilConcentrationLapse( 10.0 ) ;
		lockPlayerInPlace( ) ;
		wait( 2 ) ;
		unlockPlayerInPlace( ) ;
		
		
		setMissionFreezeGame( name, true ) ;
			
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "monksuperlunge1", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
		
		setMissionFreezeGame( name, false ) ;
		
		lockPlayerInPlace( ) ;
		setTimeUntilConcentrationLapse( 10.0 ) ;
		wait( 2 ) ;
		unlockPlayerInPlace( ) ;
	
		-- put perspiration on character that player isn't fencing
		local targetCharacter = getCharacterFightTarget( "dartagnan" ) ;
		local perspCharacter = enemy1 ;
		if ( targetCharacter ~= "" ) then
			if ( targetCharacter == enemy1 ) then
				perspCharacter = enemy2 ;
			end 
		end
		
		gTutAttackEnemyName = perspCharacter ;
		setOverrideLapseEnemy( perspCharacter ) ;
		setOverrideTimeUntilConcentrationLapse( true, 1000000.0 ) ;
		--setOverrideGenerateTimeUntilConcentrationLapse( 10000000 ) ;
		
		forceIndefiniteTimeLapse( ) ;
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "monksuperlunge2", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
	
		setLapseDamageMultiplier( 30.0 ) ;
	
		-- make sure characters have health
		if ( getRatioHealth( "dartagnan" ) < 0.3 ) then
			setRatioHealth( "dartagnan", 0.3 ) ;
		end
		if ( getRatioHealth( enemy1 ) < 0.1 ) then
			setRatioHealth( enemy1, 0.1 ) ;
		end
		if ( getRatioHealth( enemy2 ) < 0.1 ) then
			setRatioHealth( enemy2, 0.1 ) ;
		end
	
		setCharacterSlowDamage( "dartagnan", false ) ;
		setCharacterSlowDamage( enemy1, false ) ;	
		setCharacterSlowDamage( enemy2, false ) ;
		
		wait( 2 ) ;

		setOverrideTimeUntilConcentrationLapse( false, 1000000.0 ) ;
		setTimeUntilConcentrationLapse( 2.5 ) ;
		
		setDefaultLapseDamageMultiplier( ) ;
	
		resetIndefiniteTimeLapse( ) ;
	
		setOverrideLapseEnemy( "" ) ;
		
		setPlayerAllowClickTime( 2.2 ) ;
		
		setMissionFreezeGame( name, true ) ;
		
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "monksuperlunge3", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;	
		
		setMissionFreezeGame( name, false ) ;
	else
		-- skipped tutorial
		DEBUG_OUTPUT( "skipped tutorial" ) ;
		setCharacterSlowDamage( "dartagnan", false ) ;	
		setCharacterSlowDamage( enemy1, false ) ;	
		setCharacterSlowDamage( enemy2, false ) ;
	end



	while ( isCharacterAlive( enemy1 ) or isCharacterAlive( enemy2 ) ) do
		coroutine.yield( ) ;
	end	
	
	setDefaultPlayerAllowClickTime( ) ;
	
	removeMarker( name, markerEnemy1 ) ;
	removeMarker( name, markerEnemy2 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "rewardmarker" ), "roadhousebman" ) ;

	waitForTalk( "dartagnan", "roadhousebman", false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	local bubInd = characterSay( "roadhousebman", true, -1, -1, true, getString( "mt7d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mt7d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "roadhousebman", true, -1, -1, true, getString( "mt7d9" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;

	-- want marker to be shown while looking at tutorial map
	local markerPosX = 1719 ;
	local markerPosY = 1290 ;
	local marker = addMarkerPosition( name, true, getString( "markerparis" ), "france", markerPosX, markerPosY ) ;
	
	-- tutorial for map
	setMapButtonVisible( true ) ;
				
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "worldmap", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	removeTriggerArea( triggerAreaA ) ;

	removeMarker( name, marker ) ;
		
	completeMission( name ) ;
	activateMission( "missionmeung1" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end	
	
function missiontarbes7LockOut1( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mt7d11" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mt7d11" ) ) ;
		
	-- block is really wide so move player down a bit. Move them towards center a bit so they don't get stuck on fence.
	local dartX, dartY = getCharacterPos( "dartagnan" ) ;
	local middleX = -3003 ;
	local x = dartX ;
	local y = 9550 ;
	if ( dartX < middleX ) then
		x = dartX + 50 ;
	else
		x = dartX - 50 ;
	end
	
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function missionmeung1LockOut( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mm1d23" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mm1d23" ) ) ;
	
	local x = -2871 ;
	local y = 8260 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end
	
	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end

function execute_missionmeung1( name )
	-- encounter with Rochefort
	DEBUG_OUTPUT( name .. " started" ) ;

	setOverrideNoHealthOintmentTutorial( true ) ;

	local markerPosX = 1719 ;
	local markerPosY = 1290 ;
	local marker = addMarkerPosition( name, true, getString( "markerparis" ), "france", markerPosX, markerPosY ) ;
	
	local triggerAreaA = addTriggerArea( name, "missionmeung1LockOut", true, "france", 
		{ -3247, 7795, -2960, 8664 } ) ;
	
	setCharacterOverrideName( "rochefort", true, getString( "rochefortunknown" ) ) ;

	local checkDistPointX = -500 ;
	local checkDistPointY = 7730 ;
	while( not characterWithinOfPoint( "dartagnan", "france", checkDistPointX, checkDistPointY, 600.0 ) ) do
		coroutine.yield( ) ;
	end
	
	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	-- dartagnan is close enough - walk d'artagnan over and play script
	lockPlayerInPlace( ) ; -- use this instead of freeze so that horse can walk over
	
	-- bring dartagnan over
	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	local dartOutsidePosX = -1083 ;
	local dartOutsidePosY = 8100 ;
	addGoalGetToPointInLevel( "dartagnan", dartOutsidePosX, dartOutsidePosY, "france", false ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	-- make sure horse is close
	local dartHorse = getCharacterOwnedHorseName( "dartagnan" ) ;
	ensureHorseCloseToCharacter( "dartagnan", dartHorse ) ;
	while ( isHorseMoving( dartHorse ) ) do
		coroutine.yield( ) ;
	end
	coroutine.yield( ) ; -- finish horse move animation

	unlockPlayerInPlace( ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "rochefort", true ) ;
	
	removeMarker( name, marker ) ;
		
	faceDirection( "dartagnan", 1, -1 ) ;
	
	local bubInd = spritePosSay( getString( "rochefortunknown" ), -1000, 7960, true, -1, -1, true, getString( "mm1d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = spritePosSay( getString( "multiple" ), -1000, 7960, true, -1, -1, true, getString( "mm1d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mm1d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = spritePosSay( getString( "rochefortunknown" ), -1000, 7960, true, -1, -1, true, getString( "mm1d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mm1d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = spritePosSay( getString( "rochefortunknown" ), -1000, 7960, true, -1, -1, true, getString( "mm1d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mm1d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	wait( 2 ) ;
	
	-- rochefort comes outside
	placeCharacterInDoor( "rochefort", "francmeunierout", false ) ;
	addGoalGetToPointInLevel( "rochefort", -964, 8100, "france", false ) ;

	waitForNoGoal( "rochefort" ) ;
	
	setMissionFaceCharacter( name, "rochefort", "dartagnan" ) ;
	faceCharacter( "dartagnan", "rochefort" ) ;
	
	local bubInd = characterSay( "rochefort", true, -1, -1, true, getString( "mm1d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "rochefort", true, -1, -1, true, getString( "mm1d9" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mm1d10" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "rochefort", true, -1, -1, true, getString( "mm1d11" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mm1d12" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "rochefort", true, -1, -1, true, getString( "mm1d13" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	addGoalGetToPointInLevel( "rochefort", -938, 8062, "france", false ) ;
	setMissionFaceDirection( name, "rochefort", 1, -1 ) ;
	waitForNoGoal( "rochefort" ) ;
	
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mm1d14" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "rochefort", "dartagnan" ) ;
	bubInd = characterSay( "rochefort", true, -1, -1, true, getString( "mm1d15" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "rochefort", false ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mm1m1" ), "rochefort" ) ;
	
	--removeMusic( tenseMusicID ) ;
	makeEnemies( "dartagnan", "rochefort" ) ;
	
	-- make sure characters don't die in quick fight
	setCharacterSlowDamage( "dartagnan", true ) ;
	setCharacterSlowDamage( "rochefort", true ) ;
	
	lockPlayerInPlace( ) ;
	setIgnoreAll( "rochefort", true ) ; -- enemy won't come at us
	
	setStateMessageFightWalk( "dartagnan", "rochefort" ) ;
	wait( 1 ) ;
	
	-- don't want any sweat marks
	setOverrideTimeUntilConcentrationLapse( true, 1000000.0 ) ;
	
	setIgnoreAll( "rochefort", false ) ; -- dartagnan will be close by now - defend self
	
	-- rochefort's servants
	local servant1 = createTempCharacter( getString( "lackey" ), "france", 0, 0 ) ;
	--setStatsCalculatorDynamic( servant1, -10, -10, 2, 1000, 0.5 ) ;
	dress_rochefortservant1( servant1 ) ;
	
	local servant2 = createTempCharacter( getString( "lackey" ), "france", 0, 0 ) ;
	--setStatsCalculatorDynamic( servant2, -10, -10, 2, 1000, 0.5 ) ;
	dress_rochefortservant2( servant2 ) ;
	
	placeCharacterInDoor( servant1, "francmeunierout", false ) ;
	addGoalGetToPointInLevel( servant1, -1136, 8037, "france", false ) ;
	
	wait( 1 ) ;
	
	placeCharacterInDoor( servant2, "francmeunierout", false ) ;
	addGoalGetToPointInLevel( servant2, -1136, 8037, "france", false ) ;
	
	wait( 1 ) ;
	
	placeCharacterInDoor( "meunginnkeeper", "francmeunierout", false ) ;
	addGoalGetToPointInLevel( "meunginnkeeper", -1136, 8037, "france", false ) ;
	
	wait( 2 ) ;
		
	local fadeTime = 0.5 ;
	
	-- fade to black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	-- show comic
	local comic1 = createComic( "meung1" ) ;
	addText( comic1, getString( "meung1_d1" ), 73, 235, 236, 299 ) ;
	addText( comic1, getString( "meung1_d2" ), 369, 16, 534, 78 ) ;
	addText( comic1, getString( "meung1_d3" ), 411, 204, 534, 266 ) ;
	addText( comic1, getString( "meung1_d4" ), 577, 55, 641, 89 ) ;
	addText( comic1, getString( "meung1_d5" ), 15, 328, 183, 390 ) ;
	addText( comic1, getString( "meung1_d6" ), 173, 415, 261, 474 ) ;
	addText( comic1, getString( "meung1_d7" ), 421, 338, 602, 435 ) ;
	
	addMouseOver( comic1, getString( "lackey" ), 26, 48, 120, 218, 70, 44 ) ;
	addMouseOver( comic1, getString( "lackey" ), 140, 50, 250, 246, 188, 50 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 74, 124, 194, 302, 152, 120 ) ;
	
	addMouseOver( comic1, getString( "rochefortunknown" ), 284, 4, 358, 172, 318, 8 ) ;
	addMouseOver( comic1, getString( "lackey" ), 256, 134, 326, 272, 278, 138 ) ;
	addMouseOver( comic1, getString( "lackey" ), 492, 144, 546, 274, 516, 152 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 384, 128, 480, 272, 426, 120 ) ;
		
	addMouseOver( comic1, getString( "dartagnan" ), 596, 86, 766, 302, 664, 78 ) ;
	
	addMouseOver( comic1, getString( "innkeeper_m" ), 58, 396, 138, 512, 116, 398 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 68, 520, 258, 570, 96, 532 ) ;
	addMouseOver( comic1, getString( "rochefortunknown" ), 276, 404, 394, 594, 336, 400 ) ;
	
	addMouseOver( comic1, getString( "innkeeper_m" ), 692, 318, 758, 556, 728, 318 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 646, 376, 728, 540, 700, 365 ) ;
	addMouseOver( comic1, getString( "lackey" ), 516, 393, 628, 564, 579, 390 ) ;
	
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;

	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	setCharacterSlowDamage( "dartagnan", false ) ;
	setCharacterSlowDamage( "rochefort", false ) ;

	removeMarker( name, marker ) ;
	
	-- stop them from fighting
	makeNotEnemies( "dartagnan", "rochefort" ) ;
	setStateMessageIdle( "dartagnan" ) ;
	setStateMessageIdle( "rochefort" ) ;
	setRatioHealth( "rochefort", 1.0 ) ;
	drawMeleeWeapon( "rochefort", false ) ;
	setDoorClosed( "francmeunierin" ) ;
		
	clearGoals( "meunginnkeeper" ) ;
	clearGoals( servant1 ) ;
	clearGoals( servant2 ) ;
	
	deleteTempCharacter( servant1 ) ;
	deleteTempCharacter( servant2 ) ;
	
	-- place dartagnan upstairs
	placeCharacter( "dartagnan", "francmeunierhouse2", -134, -23 ) ;
	faceDirection( "dartagnan", 0, 1 ) ;
	
	-- put rochefort, innkeeper and camera inside
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "francmeunierhouse" ) ;
	setCameraTo( -150, -15 ) ;
	
	placeCharacter( "rochefort", "francmeunierhouse", -215, -78 ) ;
	setMissionFaceDirection( name, "rochefort", 1, 0 ) ;
	placeCharacterInDoor( "meunginnkeeper", "francmeunierstairsdown", false ) ;
	addGoalGetToPointInLevel( "meunginnkeeper", -158, -82, "francmeunierhouse", false ) ;
		
	--local evilMusicID = addMusic( "evil", 15 ) ;
		
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	waitForNoGoal( "meunginnkeeper" ) ;
	setMissionFaceCharacter( name, "meunginnkeeper", "rochefort" ) ;
	
	local bubInd = characterSay( "meunginnkeeper", true, -1, -1, true, getString( "mm1d16" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "rochefort", true, -1, -1, true, getString( "mm1d17" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "meunginnkeeper", true, -1, -1, true, getString( "mm1d18" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterThink( "rochefort", true, -1, -1, true, getString( "mm1d19" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "meunginnkeeper", true, -1, -1, true, getString( "mm1d20" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "rochefort", true, -1, -1, true, getString( "mm1d21" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterThink( "rochefort", true, -1, -1, true, getString( "mm1d22" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	--removeMusic( evilMusicID ) ;
		
	-- fade to black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- put rochefort and innkeeper back to normal positions
	place_rochefortA( "rochefort" ) ;
	place_meunginnkeeper( "meunginnkeeper" ) ;
	
	setCameraFollowCharacter( "dartagnan", true ) ;
	
	unlockPlayerInPlace( ) ;

	setCharacterOverrideName( "rochefort", false, getString( "unknownname" ) ) ;
	
	removeMusic( tenseMusicID ) ;
	
	removeTriggerArea( triggerAreaA ) ;
	
	setOverrideTimeUntilConcentrationLapse( false, 0.0 ) ;
		
	setOverrideNoHealthOintmentTutorial( false ) ;
			
	completeMission( name ) ;
	activateMission( "missionmeung2" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end	

function execute_missionmeung2( name )
	-- wake up in Inn in Meung
	DEBUG_OUTPUT( name .. " started" ) ;

	setOverrideNoHealthOintmentTutorial( true ) ;

	-- break dad's sword
	unequipItem( "sword_dart" ) ;
	setInventoryItem( "sword_dart", 0 ) ;
	setInventoryItem( "sword_broken", 1 ) ;
	equipItem( "sword_broken" ) ;
	
	-- steal letter
	setInventoryItem( "letter_dart", 0 ) ;
	
	local markerPosX = 1719 ;
	local markerPosY = 1290 ;
	local marker = addMarkerPosition( name, true, getString( "markerparis" ), "france", markerPosX, markerPosY ) ;

	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	faceDirection( "dartagnan", 0, 1 ) ;
	
	setRatioHealth( "dartagnan", 0.1 ) ;
	setOintmentButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	setMapButtonVisible( false ) ;

	setHealthScreenFlashOn( false ) ;

	-- fade from black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setStateMessageIdle( "dartagnan" ) ;

	setMissionFreezeGame( name, true ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mm2d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;

	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "france" ) ) do
		coroutine.yield( ) ;
	end

	-- show comic
	local comic1 = createComic( "meung2" ) ;
	addText( comic1, getString( "meung2_d1" ), 12, 13, 169, 50 ) ;
	addText( comic1, getString( "meung2_d2" ), 59, 153, 206, 250 ) ;
	addText( comic1, getString( "meung2_d3" ), 360, 14, 525, 52 ) ;
	addText( comic1, getString( "meung2_d4" ), 391, 76, 550, 101 ) ;
	addText( comic1, getString( "meung2_d5" ), 336, 200, 458, 263 ) ;
	addText( comic1, getString( "meung2_d6" ), 595, 15, 761, 51 ) ;
	addText( comic1, getString( "meung2_d7" ), 646, 176, 784, 235 ) ;
	addText( comic1, getString( "meung2_d8" ), 11, 404, 178, 465 ) ;
	addText( comic1, getString( "meung2_d9" ), 35, 537, 195, 574 ) ;
	addText( comic1, getString( "meung2_d10" ), 346, 327, 507, 363 ) ;
	addText( comic1, getString( "meung2_d11" ), 370, 502, 487, 564 ) ;
	addText( comic1, getString( "meung2_d12" ), 560, 345, 686, 380 ) ;
	addText( comic1, getString( "meung2_d13" ), 586, 503, 763, 543 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 31, 87, 130, 262, 67, 88 ) ;

	addMouseOver( comic1, getString( "milady" ), 278, 48, 391, 185, 328, 48 ) ;
	addMouseOver( comic1, getString( "rochefortunknown" ), 486, 120, 564, 277, 519, 121 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 672, 64, 733, 175, 695, 65 ) ;
	--addMouseOver( comic1, getString( "rochefortunknown" ), 569, 143, 673, 264, 594, 145 ) ;
	
	addMouseOver( comic1, getString( "milady" ), 49, 318, 96, 375, 76, 322 ) ;
	addMouseOver( comic1, getString( "rochefortunknown" ), 179, 368, 241, 525, 201, 367 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 405, 422, 442, 456, 420, 423 ) ;

	addMouseOver( comic1, getString( "innkeeper_m" ), 680, 287, 788, 466, 702, 287 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 584, 419, 798, 540, 620, 426 ) ;
		
	setComicFadeFrom( 1.0, 1.0, 1.0 ) ;
	setComicFadeTo( 1.0, 1.0, 1.0 ) ;
	
	removeMusic( tenseMusicID ) ;
	local evilMusicID = addMusic( "extratense", 15 ) ; -- evil
		
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	
		-- hack to stop flicker showing health bar
		setFadeColour( 1.0, 1.0, 1.0, 1.0 ) ;
		fadeFromColour( fadeTime ) ;
	end

	removeMusic( evilMusicID ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "meunginnkeeper", true ) ;
		
	placeCharacter( "dartagnan", "francmeunierhouse2", -134, -23 ) ;
	faceDirection( "dartagnan", 0, 1 ) ;
	
	placeCharacterInDoor( "meunginnkeeper", "francmeunierstairsup", false ) ;
	addGoalGetToPointInLevel( "meunginnkeeper", -128, 35, "francmeunierhouse2", false ) ;
	
	-- d'artagnan has rested - he has full health again
	setRatioHealth( "dartagnan", 1.0 ) ;
			
	setHealthScreenFlashOn( true ) ;
			
	-- Fade from white
	setFadeColour( 1.0, 1.0, 1.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	waitForNoGoal( "meunginnkeeper" ) ;
	setMissionFaceCharacter( name, "meunginnkeeper", "dartagnan" ) ;
	
	local bubInd = characterSay( "meunginnkeeper", true, -1, -1, true, getString( "mm2d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mm2d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "meunginnkeeper", true, -1, -1, true, getString( "mm2d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	-- dartagnan gets his stuff back
	setOintmentButtonVisible( true ) ;
	setInventoryButtonVisible( true ) ;
	setMapButtonVisible( true ) ;
	
	playSound( "equipclothes", 1.0 ) ;
	--playSound( "dropmoney", 0.15 ) ;
	
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mm2d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "meunginnkeeper", true, -1, -1, true, getString( "mm2d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mm2d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "meunginnkeeper", true, -1, -1, true, getString( "mm2d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mm2d9" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mm2d10" ) ) ;
	waitForBubbleClosed( bubInd ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "meunginnkeeper", false ) ;
	
	removeMoney( 2 ) ; -- pay innkeeper
	playSound( "dropmoney", 0.5 ) ;
	
	-- send innkeeper back to normal position
	addGoalGetToPointInLevel( "meunginnkeeper", -10, 78, "francmeunierhouse", false, true ) ;
	
	removeMarker( name, marker ) ;
	
	setOverrideNoHealthOintmentTutorial( false ) ;
		
	completeMission( name ) ;
	activateMission( "missionparis1" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis1( name )
	-- Get to Paris
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setBoolean( "swordDropAvailable", true ) ;

	local markerPosX = 1719 ;
	local markerPosY = 1290 ;
	local marker = addMarkerPosition( name, true, getString( "markerparis" ), "france", markerPosX, markerPosY ) ;

	--local parisEntryX = 0 ;
	--local parisEntryY = 4000 ;
	--local dist = 600.0
	--while ( distanceToPoint( "dartagnan", "france", parisEntryX, parisEntryY ) > dist ) do
	--	coroutine.yield( ) ;
	--end
	
	
	-- wait for player to enter Paris
	local triggerArea = addTriggerArea( name, "", false, "france", { -1059, -2070, 3925, 4235 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;
	
	
	
	removeMarker( name, marker ) ;
	
	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	
	setMissionFreezeGame( name, true ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp1d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
		
	completeMission( name ) ;
	activateMission( "missionparis2" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis2( name )
	-- Sell Horse
	DEBUG_OUTPUT( name .. " started" ) ;

	local marker = addMarkerCharacter( name, true, getString( "mp2m1" ), "horsedealer1" ) ;
	
	waitForTalk( "dartagnan", "horsedealer1", false ) ;
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ; -- use this that horse can walk over

	-- make sure horse is close
	local dartHorse = getCharacterOwnedHorseName( "dartagnan" ) ;
	ensureHorseCloseToCharacter( "dartagnan", dartHorse ) ;
	while ( isHorseMoving( dartHorse ) ) do
		coroutine.yield( ) ;
	end
	coroutine.yield( ) ; -- finish horse move animation
	
	-- if horse still isn't close enough just put him by us
	local mustBeAtDistance = 250 ;
	if ( distanceToVehicle( "dartagnan", dartHorse ) > mustBeAtDistance ) then
		placeVehicle( dartHorse, "france", 449, 3969 ) ;
	end

	unlockPlayerInPlace( ) ;
	
	-- make sure to offer player enough money to afford a terrible horse (because we just forced them to sell horse)
	local playersMoney = getMoney( ) ;
	local terribleHorsePrice = getHorseQualityBuyPrice( "terrible" ) ;
	local extraMoneyToBuy = terribleHorsePrice - playersMoney ;
	local minSandyPrice = 9 ;
	local finalPrice = minSandyPrice ;
	if ( extraMoneyToBuy > finalPrice ) then
		finalPrice = extraMoneyToBuy ;
	end
	
	local badPrice = finalPrice - 4 ;
	
	setMissionFreezeGame( name, true ) ;
	local bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp2d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "horsedealer1", true, -1, -1, true, getString( "mp2d2", badPrice ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mp2d3" ), getString( "mp2d4", finalPrice ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 0 ) then
		addMoney( badPrice ) ;
	else
		bubInd = characterSay( "horsedealer1", true, -1, -1, true, getString( "mp2d5" ) ) ;
		waitForBubbleClosed( bubInd ) ;
		
		addMoney( finalPrice ) ;
	end
	
	playSound( "dropmoney", 0.5 ) ;
	
	setMissionFreezeGame( name, false ) ;

	-- change horse ownership to dealer
	removeDriver( "horse1", "dartagnan" ) ;
	removeOwnedHorse( "dartagnan" ) ;
	setHorseToDealer( "horse1", 1, false ) ;

	completeMission( name ) ;
	activateMission( "missionparis3" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis3( name )
	-- Go get Appartment
	DEBUG_OUTPUT( name .. " started" ) ;

	wait( 0.25 ) ;

	setStateMessageIdle( "dartagnan" ) ;

	setMissionFreezeGame( name, true ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp3d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mp3m1" ), "bonacieux" ) ;
	
	waitForTalk( "dartagnan", "bonacieux", false ) ;
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	setMissionFaceCharacter( name, "bonacieux", "dartagnan" ) ;
	local bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp3d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "bonacieux", true, -1, -1, true, getString( "mp3d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	unlockPlayerInPlace( ) ;
		
	completeMission( name ) ;
	activateMission( "missionparis4" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis4( name )
	-- go to D'Artagnan's room ( follow bonacieux )

	DEBUG_OUTPUT( name .. " started" ) ;

	addGoalGetToPointInLevel( "bonacieux", 36, -40, "bonacieuxhouse2", false, true ) ;
	
	setMissionChatString( name, "bonacieux", getString( "followme" ) ) ;
		
	local marker = addMarkerCharacter( name, true, getString( "mp4m1" ), "bonacieux" ) ;
	
	while ( characterHasGoal( "bonacieux" ) ) do
		coroutine.yield( ) ;
	end
	
	local dist = 10000 ;
	local closeDist = 150.0 ;
	local dartInUpstairs = false ;
	repeat
		coroutine.yield( ) ;
		setMissionFaceCharacter( name, "bonacieux", "dartagnan" ) ;
		dist = distanceBetweenCharacters( "dartagnan", "bonacieux" ) ;
		dartInUpstairs = getCharacterLevel( "dartagnan" ) == "bonacieuxhouse2"
	until ( dartInUpstairs and dist < closeDist )
	
	removeMarker( name, marker ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now

	setMissionFreezeGame( name, true ) ;
	local bubInd = characterSay( "bonacieux", true, -1, -1, true, getString( "mp4d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp4d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "bonacieux", true, -1, -1, true, getString( "mp4d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;

	-- send bonacieux back to default pos
	addGoalGetToPointInLevel( "bonacieux", 35, -118, "bonacieuxhouse", false, true ) ;
			
	completeMission( name ) ;
	
	-- if Player already has an unbroken sword then skip paris5
	if ( not hasUnbrokenMeleeWeapon( ) ) then
		activateMission( "missionparis5" ) ;
	else
		activateMission( "missionparis6" ) ;
	end
	
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis5( name )
	-- Get Unbroken Sword
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "bonacieux", getString( "bonacieuxprompt" ) ) ;
		
	setStateMessageIdle( "dartagnan" ) ;

	setMissionFreezeGame( name, true ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp5d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mp5m1" ), "weapondealer1" ) ;

	while ( not hasUnbrokenMeleeWeapon( ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
		
	completeMission( name ) ;
	activateMission( "missionparis6" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis6( name )
	-- Visit Treville
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "bonacieux", getString( "bonacieuxprompt" ) ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	
	setMissionChatString( name, "musketeer28", getString( "musketeer_d10" ) ) ;
	setMissionChatString( name, "musketeer29", getString( "musketeer_d10" ) ) ;
	
	setMissionFreezeGame( name, true ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp6d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	
	placeCharacter( "porthos", "trevillehouse2", -68, 98 ) ;
	placeCharacter( "aramis", "trevillehouse2", -39, 125 ) ;
	
	setMissionFaceDirection( name, "porthos", -1, 1 ) ;
	setMissionFaceDirection( name, "aramis", -1, 1 ) ;
	setMissionFaceDirection( name, "musketeer26", 1, -1 ) ;
	setMissionFaceDirection( name, "musketeer27", 1, -1 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mp6m1" ), "treville" ) ;
	
	local entrancePosX = -60.0 ;
	local entrancePosY = 0.0 ;
	local dist = 200.0 ;
	while ( distanceToPoint( "dartagnan", "trevillehouse2", entrancePosX, entrancePosY ) > dist ) do
		coroutine.yield( ) ;
	end

	local overrideSaveID = createOverrideSavePos( "trevillehouse2", 365, -95 ) ;
	setOverrideSaveLevel( overrideSaveID, "trevillehouse2" ) ;
	setOverrideSaveLevel( overrideSaveID, "trevilleantechamber" ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "musketeer28", true ) ;
	setIgnoreFreeze( "musketeer26", true ) ;
	setIgnoreFreeze( "musketeer27", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "porthos", true ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", entrancePosX, entrancePosY, "trevillehouse2", false ) ;
	waitForNoGoal( "dartagnan" ) ;
	faceDirection( "dartagnan", 0, -1 ) ;
	
	addGoalGetToPointInLevel( "musketeer28", entrancePosX, entrancePosY - 60, "trevillehouse2", false, true ) ;
	waitForNoGoal( "musketeer28" ) ;
	setMissionFaceDirection( name, "musketeer28", 0, 1 ) ;

	local bubInd = characterSay( "musketeer28", true, -1, -1, true, getString( "mp6d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp6d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "musketeer28", true, -1, -1, true, getString( "mp6d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;	

	addGoalGetToPointInLevel( "musketeer28", -58, 221, "trevilleantechamber", false, true ) ;
	
	wait( 2 ) ;
	
	-- Porthos gold baldric conversation
	bubInd = characterSay( "musketeer26", true, -1, -1, true, getString( "mp6d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	faceDirection( "dartagnan", 0, 1 ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp6d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "musketeer27", true, -1, -1, true, getString( "mp6d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;	
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp6d9" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "musketeer26", true, -1, -1, true, getString( "mp6d10" ) ) ;
	waitForBubbleClosed( bubInd ) ;	
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp6d11" ) ) ;
	waitForBubbleClosed( bubInd ) ;	
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp6d12" ) ) ;
	waitForBubbleClosed( bubInd ) ;	
	bubInd = characterSay( "musketeer27", true, -1, -1, true, getString( "mp6d13" ) ) ;
	waitForBubbleClosed( bubInd ) ;	
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp6d14" ) ) ;
	waitForBubbleClosed( bubInd ) ;	
	--setMissionFaceCharacter( name, "aramis", "porthos" ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp6d15" ) ) ;
	waitForBubbleClosed( bubInd ) ;	
	--setMissionFaceCharacter( name, "porthos", "aramis" ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp6d16" ) ) ;
	waitForBubbleClosed( bubInd ) ;	
	setMissionFaceCharacter( name, "aramis", "porthos" ) ;
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp6d17" ) ) ;
	waitForBubbleClosed( bubInd ) ;	
	setMissionFaceCharacter( name, "porthos", "aramis" ) ;

	waitForNoGoal( "musketeer28" ) ;
	-- servant walk back out and inform d'Artagnan to enter
	--placeCharacterInDoor( "musketeer28", "trevilleantechamberout", false ) ;
	addGoalGetToPointInLevel( "musketeer28", -59, -189, "trevillehouse2", false, true ) ;
	waitForNoGoal( "musketeer28" ) ;
	setMissionFaceDirection( name, "musketeer28", 0, 1 ) ;
	bubInd = characterSay( "musketeer28", true, -1, -1, true, getString( "mp6d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	-- servant walk back to normal position
	addGoalGetToPointInLevel( "musketeer28", -106, -210, "trevillehouse2", false, true ) ;
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -59, -54, "trevillehouse2", false ) ;
	waitForNoGoal( "musketeer28" ) ;
	setMissionFaceDirection( name, "musketeer28", 0, 1 ) ;
	waitForNoGoal( "dartagnan" ) ;

	-- now player must control dartagnan to walk up to Treville
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "musketeer28", false ) ;
	setIgnoreFreeze( "musketeer26", false ) ;
	setIgnoreFreeze( "musketeer27", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	
	local triggerAreaA = addTriggerArea( name, "missionparis6LockOut", true, "trevillehouse2", 
		{ -205, -18, 86, 58 } ) ;
	
	local dist = 200.0 ;
	while ( distanceBetweenCharacters( "dartagnan", "treville" ) > dist ) do
		coroutine.yield( ) ;
	end
	
	
	lockPlayerInPlace( ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", 120, 32, "trevilleantechamber", false ) ;
	waitForNoGoal( "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "treville" ) ;
	
	local bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d19" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	local tenseMusicID = addMusic( "tense", 15 ) ;
	
	-- treville walk to door and calls for musketeers
	addGoalGetToPointInLevel( "treville", -51, 64, "trevilleantechamber", false ) ;
	waitForNoGoal( "treville" ) ;
	setMissionFaceDirection( name, "treville", 0, 1 ) ;
	
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d20" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	-- aramis and porthos walk in
	placeCharacterInDoor( "aramis", "trevilleantechamberin", false ) ;
	addGoalGetToPointInLevel( "aramis", -86, 125, "trevilleantechamber", false, true ) ;

	wait( 1 ) ;
	placeCharacterInDoor( "porthos", "trevilleantechamberin", false ) ;
	addGoalGetToPointInLevel( "porthos", -10, 125, "trevilleantechamber", false, true ) ;

	waitForNoGoal( "aramis" ) ;
	setMissionFaceCharacter( name, "aramis", "treville" ) ;

	waitForNoGoal( "porthos" ) ;
	setMissionFaceCharacter( name, "porthos", "treville" ) ;
	
	local bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d21" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d22" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d23" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp6d24" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp6d25" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d26" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp6d27" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp6d28" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp6d29" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d30" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	-- athos comes in
	placeCharacterInDoor( "athos", "trevilleantechamberin", false ) ;
	setMissionFaceDirection( name, "athos", 0, -1 ) ;
	addGoalGetToPointInLevel( "athos", -48, 165, "trevilleantechamber", false, true ) ;
	
	-- face athos as he walks in
	setMissionFaceCharacter( name, "porthos", "athos" ) ;
	setMissionFaceCharacter( name, "aramis", "athos" ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	waitForNoGoal( "athos" ) ;
	
	setMissionFaceCharacter( name, "treville", "athos" ) ;
	local bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d31" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp6d32" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d33" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	-- play athos death animation
	takeDamage( "athos", 150 ) ;

	wait( 1 ) ;
	setMissionFaceCharacter( name, "porthos", "treville" ) ;
	setMissionFaceCharacter( name, "aramis", "treville" ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d34" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- remove musketeers and add doctor
	place_aramisA( "aramis" ) ;
	place_porthosA( "porthos" ) ;
	
	reviveCharacter( "athos" ) ;
	giveHealth( "athos", 100 ) ;	
	place_athosA( "athos" ) ;
	
	placeCharacter( "doctor1", "trevilleantechamber", -48, 125 ) ;
	setMissionFaceCharacter( name, "doctor1", "treville" ) ;

	wait( 3 ) ;
	
	removeMusic( tenseMusicID ) ;
			
	-- fade from black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end	
	
	local bubInd = characterSay( "doctor1", true, -1, -1, true, getString( "mp6d35" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	addGoalGetToPointInLevel( "doctor1", getDoctor1PosX( ), getDoctor1PosY( ), getDoctor1Level( ), false, true ) ;
	addGoalSitInChair( "treville", "trevilleantechamberchair1", false, true ) ;

	setMissionFaceCharacter( name, "dartagnan", "treville" ) ;

	wait( 2 ) ;
	
	waitForNoGoal( "treville" ) ;

	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d36" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d37" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp6d38" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d39" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp6d40" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d41" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	--bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d42" ) ) ;
	--waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp6d43" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp6d44" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	-- dartagnan see man from meung walk, towards wall (window)
	setMissionFaceDirection( name, "dartagnan", 1, -1 ) ;
	sayAndWait( "dartagnan", getString( "mp6d45" ) ) ;
	
	addGoalGetToPointInLevel( "dartagnan", 242, -39, "trevilleantechamber", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
		
	sayAndWait( "dartagnan", getString( "mp6d46" ) ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	placeCharacter( "rochefort", "france", 159, 2136 ) ;
	addGoalGetToPointInLevel( "rochefort", 76, 2512, "france", false, true ) ;
	
	setCharacterOverrideName( "rochefort", true, getString( "rochefortunknown" ) ) ;
	
	local overrideMusicID = addMusic( "waterflute", 15 ) ;
		
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "france" ) ;
	setCameraTo( -103, 2183 ) ;

	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- show rochefort walking
	wait( 3 ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	removeMusic( overrideMusicID ) ;

	setCameraFollowCharacter( "dartagnan", false ) ;

	setMissionFaceDirection( name, "treville", 1, -1 ) ;
	placeCharacter( "treville", "trevilleantechamber", 269, -28 ) ;

	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	sayAndWait( "treville", getString( "mp6d47" ) ) ;
	
	addGoalSitInChair( "treville", "trevilleantechamberchair1", false, true ) ;
	
	sayAndWait( "dartagnan", getString( "mp6d48" ) ) ;
	waitForNoGoal( "treville" ) ;
	
	clearGoals( "rochefort" ) ;
	place_rochefortA( "rochefort" ) ;
	setCharacterOverrideName( "rochefort", false, getString( "unknownname" ) ) ;
		
	removeTriggerArea( triggerAreaA ) ;
	removeMarker( name, marker ) ;

	unlockPlayerInPlace( ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
			
	completeMission( name ) ;
	activateMission( "missionparis7" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionparis6LockOut( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mp6d18" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp6d18" ) ) ;

	local x = -59 ;
	local y = -53 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "trevillehouse2", false ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function execute_missionparis7( name )
	-- Chase the man from Meung
	DEBUG_OUTPUT( name .. " started" ) ;

	setInventoryItem( "aramis_handkerchief", 0 ) ;
	
	setMissionChatFunction( name, "porthos", "chat_nothing" ) ;
	setMissionChatFunction( name, "musketeer6", "chat_nothing" ) ;	
	setMissionFaceCharacter( name, "porthos", "musketeer6" ) ;
	setMissionFaceCharacter( name, "musketeer6", "porthos" ) ;
	
	setMissionChatString( name, "treville", getString( "mp6d47" ) ) ;

	local markerPosX = 77 ;
	local markerPosY = 3074 ;
	local marker = addMarkerPosition( name, true, getString( "chaserochefort" ), "france", markerPosX, markerPosY ) ;

	-- place characters
	placeCharacter( "porthos", "france", -438, 2456 ) ;
	placeCharacter( "musketeer6", "france", -490, 2456 ) ;
	
	placeCharacter( "aramis", "france", -36, 3081 ) ;
	placeCharacter( "musketeer1", "france", -117, 3055 ) ;
	placeCharacter( "musketeer2", "france", -117, 3105 ) ;
	setMissionFaceDirection( name, "aramis", -1, 0 ) ;
	setMissionFaceCharacter( name, "musketeer1", "aramis" ) ;
	setMissionFaceCharacter( name, "musketeer2", "aramis" ) ;

	-- wait for player to go downstairs
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "trevillehouse" ) ) do
		coroutine.yield( ) ;
	end
	
	--local tenseMusicID = addMusic( "tense", 15 ) ;
	
	-- play comic of him bumping in to Athos when going down the stairs
	local comic1 = createComic( "athos1" ) ;
	
	addText( comic1, getString( "athos1_d1" ), 262, 28, 320, 56 ) ;
	addText( comic1, getString( "athos1_d2" ), 282, 246, 387, 275 ) ;
	addText( comic1, getString( "athos1_d3" ), 425, 248, 568, 286 ) ;
	addText( comic1, getString( "athos1_d4" ), 632, 6, 787, 36 ) ;
	addText( comic1, getString( "athos1_d5" ), 600, 101, 761, 139 ) ;
	addText( comic1, getString( "athos1_d6" ), 683, 166, 789, 203 ) ;
	addText( comic1, getString( "athos1_d7" ), 5, 259, 234, 322 ) ;
	addText( comic1, getString( "athos1_d8" ), 353, 312, 572, 355 ) ;
	addText( comic1, getString( "athos1_d9" ), 312, 381, 480, 443 ) ;
	addText( comic1, getString( "athos1_d10" ), 345, 470, 456, 510 ) ;
	addText( comic1, getString( "athos1_d11" ), 300, 545, 488, 585 ) ;
	addText( comic1, getString( "athos1_d12" ), 602, 321, 717, 348 ) ;
	addText( comic1, getString( "athos1_d13" ), 686, 476, 777, 538 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 29, 32, 160, 165, 51, 40 ) ;
	
	addMouseOver( comic1, getString( "athos" ), 224, 68, 293, 247, 256, 70 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 312, 76, 364, 240, 348, 77 ) ;

	addMouseOver( comic1, getString( "athos" ), 462, 36, 522, 244, 492, 35 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 498, 151, 566, 298, 533, 152 ) ;

	addMouseOver( comic1, getString( "athos" ), 616, 169, 666, 298, 641, 172 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 710, 201, 763, 298, 745, 205 ) ;

	addMouseOver( comic1, getString( "athos" ), 20, 316, 211, 593, 113, 315 ) ;

	addMouseOver( comic1, getString( "athos" ), 269, 323, 353, 597, 325, 321 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 503, 399, 578, 597, 530, 403 ) ;

	addMouseOver( comic1, getString( "athos" ), 731, 314, 779, 463, 754, 315 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 625, 407, 709, 597, 664, 404 ) ;

	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;

	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionChatString( name, "athos", getString( "mp7d13" ) ) ;	
	
	--removeMusic( tenseMusicID ) ;
	
	-- wait for player to pass porthos in front of the building
	local triggerArea = addTriggerArea( name, "", false, "france", { -590, 2407, -407, 2473 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	--local tenseMusicID = addMusic( "tense", 15 ) ;
	
	removeTriggerArea( triggerArea ) ;

	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -451, 2453, "france", false, true ) ;

	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	-- show comic
	local comic1 = createComic( "porthos1" ) ;
		
	addText( comic1, getString( "porthos1_d1" ), 17, 10, 75, 40 ) ;
	addText( comic1, getString( "porthos1_d2" ), 330, 152, 509, 232 ) ;
	addText( comic1, getString( "porthos1_d3" ), 581, 9, 734, 74 ) ;
	addText( comic1, getString( "porthos1_d4" ), 580, 246, 791, 283 ) ;
	addText( comic1, getString( "porthos1_d5" ), 113, 315, 258, 379 ) ;
	addText( comic1, getString( "porthos1_d6" ), 10, 526, 215, 588 ) ;
	addText( comic1, getString( "porthos1_d7" ), 290, 375, 420, 438 ) ;
	addText( comic1, getString( "porthos1_d8" ), 372, 465, 505, 530 ) ;
	addText( comic1, getString( "porthos1_d9" ), 291, 550, 469, 589 ) ;
	addText( comic1, getString( "porthos1_d10" ), 662, 330, 776, 390 ) ;
	addText( comic1, getString( "porthos1_d11" ), 541, 478, 744, 541 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 29, 81, 123, 295, 62, 88 ) ;
	addMouseOver( comic1, getString( "porthos" ), 104, 15, 222, 297, 161, 16 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 423, 29, 545, 296, 468, 31 ) ;
	addMouseOver( comic1, getString( "porthos" ), 257, 7, 419, 296, 311, 16 ) ;

	addMouseOver( comic1, getString( "porthos" ), 718, 3, 796, 296, 765, 15 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 592, 97, 731, 296, 649, 100 ) ;
	
	addMouseOver( comic1, getString( "porthos" ), 10, 313, 150, 563, 78, 309 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 177, 402, 269, 595, 241, 405 ) ;
	
	addMouseOver( comic1, getString( "porthos" ), 283, 306, 458, 571, 412, 307 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 439, 360, 521, 596, 490, 368 ) ;

	addMouseOver( comic1, getString( "porthos" ), 556, 305, 682, 490, 609, 312 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 705, 379, 798, 558, 766, 385 ) ;
	
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	--removeMusic( tenseMusicID ) ;
	
	clearGoals( "dartagnan" ) ;
	setStateMessageIdle( "dartagnan" ) ;
	placeCharacter( "dartagnan", "france", -443, 2499 ) ;
	moveCameraToDest( ) ;
		
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionChatString( name, "porthos", getString( "mp7d12" ) ) ;
	setMissionChatString( name, "musketeer6", getString( "hello" ) ) ;
	
	-- wait to be close to Aramis
	local dist = 250 ;
	while ( distanceToPoint( "dartagnan", "france", markerPosX, markerPosY ) > dist ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	-- move D'Artagnan closer to aramis
	lockPlayerInPlace( ) ;
	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", markerPosX, markerPosY, "france", false ) ;
	waitForNoGoal( "dartagnan" ) ;

	spinLook( "dartagnan" ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp7d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	-- drop handkerchief
	createItem( "h1", "aramis_handkerchief", "france", -10, 3081, true ) ;
	wait( 1 ) ; -- let it fall
	
	faceDirection( "dartagnan", -1, 0 ) ;
		
	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp7d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
	
	addMarkerPickUp( name, true, getString( "mp7m2" ), "h1" ) ;

	while ( numOfItemType( "aramis_handkerchief" ) < 1 ) do
		coroutine.yield( ) ;
	end

	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	faceCharacter( "dartagnan", "aramis" ) ;

	-- D'Artagnan has picked up handkerchief - talk to Aramis now
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "musketeer1", true ) ;
	setIgnoreFreeze( "musketeer2", true ) ;
	
	local bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp7d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "musketeer1", true, -1, -1, true, getString( "mp7d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "musketeer2", true, -1, -1, true, getString( "mp7d4_5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceDirection( name, "aramis", -1, 0 ) ;
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp7d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "musketeer2", true, -1, -1, true, getString( "mp7d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setInventoryItem( "aramis_handkerchief", 0 ) ;
	
	-- Guys Aramis was talking to walk off
	addGoalGetToPointInLevel( "musketeer1", getMusketeer1PosX( ), getMusketeer1PosY( ), getMusketeer1Level( ), true, true ) ;
	addGoalGetToPointInLevel( "musketeer2", getMusketeer2PosX( ), getMusketeer2PosY( ), getMusketeer2Level( ), true, true ) ;
	wait( 2 ) ;

	local tenseMusicID = addMusic( "tense", 15 ) ;

	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	faceCharacter( "dartagnan", "aramis" ) ;
	local bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp7d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp7d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp7d9" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp7d10" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	setMissionChatString( name, "aramis", getString( "mp7d14" ) ) ;

	-- send Aramis back to default positions
	addGoalGetToPointInLevel( "aramis", getAramisAPosX( ), getAramisAPosY( ), getAramisALevel( ), true, true ) ;
	wait( 2 ) ;

	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp7d11" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "musketeer1", false ) ;
	setIgnoreFreeze( "musketeer2", false ) ;

	-- put porthos and friend back to original spot		
	place_porthosA( "porthos" ) ;
	place_musketeer6( "musketeer6" ) ;
	
	wait( 2 ) ;
	
	removeMusic( tenseMusicID ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis8" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis8( name )
	-- duel Athos
	DEBUG_OUTPUT( name .. " started" ) ;
	
	-- if player has died from this mission, give them an ointment
	if ( getDiedDuringMission( name ) >= 1 ) then
		createItem( "", "ointment", "france", -681, 2943, false ) ;
		createItem( "", "ointment", "france", -716, 2937, false ) ;
	end

	
	setMissionChatString( name, "treville", getString( "mp7d15" ) ) ;
	setMissionChatString( name, "porthos", getString( "mp7d12" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp7d14" ) ) ;
	
	setStateMessageIdle( "dartagnan" ) ;

	local athosID = addWatchCharacterUnlimited( "athos" ) ;
	local aramisID = addWatchCharacterUnlimited( "aramis" ) ;
	local porthosID = addWatchCharacterUnlimited( "porthos" ) ;
	local cardinalsguard1ID = addWatchCharacterUnlimited( "cardinalsguard1" ) ;
	local cardinalsguard2ID = addWatchCharacterUnlimited( "cardinalsguard2" ) ;
	local jussacID = addWatchCharacterUnlimited( "jussac" ) ;
	local cahusacID = addWatchCharacterUnlimited( "cahusac" ) ;
	local bicaratID = addWatchCharacterUnlimited( "bicarat" ) ;
		
	local athosPosX = -906 ;
	local athosPosY = 2890 ;
	placeCharacter( "athos", "france", athosPosX, athosPosY ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;

	setMissionFreezeGame( name, true ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp8d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mp8m1" ), "athos" ) ;

	waitForTalk( "dartagnan", "athos", false ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "porthos", true ) ;

	setMissionChatNone( name, "porthos" ) ;
	setMissionChatNone( name, "aramis" ) ;

	-- aramis and porthos walk up while chatting with athos
	clearGoals( "aramis" ) ;
	clearGoals( "porthos" ) ;
	
	local aramisStartX = -472 ;
	local aramisStartY = 2510 ;
	local porthosStartX = aramisStartX + 50 ;
	local porthosStartY = aramisStartY ;
	
	local aramisDestX = -854 ;
	local aramisDestY = 2821 ;
	local porthosDestX = aramisDestX + 50 ;
	local porthosDestY = aramisDestY ;
	
	placeCharacter( "aramis", "france", aramisStartX, aramisStartY ) ;
	placeCharacter( "porthos", "france", porthosStartX, porthosStartY ) ;
	addGoalGetToPointInLevel( "aramis", aramisDestX, aramisDestY, "france", false, true ) ;
	addGoalGetToPointInLevel( "porthos", porthosDestX, porthosDestY, "france", false, true ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	
	local bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp8d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp8d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp8d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp8d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "porthos" ) ;

	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp8d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp8d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "athos", "aramis" ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp8d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp8d9" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp8d10" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp8d11" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	setMissionFaceCharacter( name, "aramis", "porthos" ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp8d12" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "athos", "aramis" ) ;
	bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp8d13" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	setMissionFaceCharacter( name, "porthos", "aramis" ) ;
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp8d14" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp8d15" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceNone( name, "dartagnan" ) ;
	
	makeEnemies( "dartagnan", "athos" ) ;
	
	-- make sure athos doesn't die
	setCharacterSlowDamage( "athos", true ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	
	setMissionChatString( name, "porthos", getString( "mp8d27" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp8d27" ) ) ;
		
	-- cardinal's guards appear
	placeCharacter( "cardinalsguard1", "france", -950, 3390 ) ;
	placeCharacter( "cardinalsguard2", "france", -910, 3400 ) ;
	placeCharacter( "jussac", "france", -885, 3353 ) ;
	placeCharacter( "cahusac", "france", -850, 3410 ) ;
	placeCharacter( "bicarat", "france", -825, 3370 ) ;
	
	addGoalGetToPointInLevel( "cardinalsguard1", -940, 3005, "france", false, true ) ;
	addGoalGetToPointInLevel( "cardinalsguard2", -910, 3010, "france", false, true ) ;
	addGoalGetToPointInLevel( "jussac", -880, 2995, "france", false, true ) ;
	addGoalGetToPointInLevel( "cahusac", -850, 3000, "france", false, true ) ;
	addGoalGetToPointInLevel( "bicarat", -820, 3005, "france", false, true ) ;

	setMissionChatFunction( name, "cardinalsguard1", "chat_nothing" ) ;
	setMissionChatFunction( name, "cardinalsguard2", "chat_nothing" ) ;
	setMissionChatFunction( name, "jussac", "chat_nothing" ) ;
	setMissionChatFunction( name, "cahusac", "chat_nothing" ) ;
	setMissionChatFunction( name, "bicarat", "chat_nothing" ) ;

	setMissionFaceDirection( name, "cardinalsguard1", 0, -1 ) ;
	setMissionFaceDirection( name, "cardinalsguard2", 0, -1 ) ;
	setMissionFaceDirection( name, "jussac", 0, -1 ) ;
	setMissionFaceDirection( name, "cahusac", 0, -1 ) ;
	setMissionFaceDirection( name, "bicarat", 0, -1 ) ;

	waitForNoGoal( "cardinalsguard1" ) ;
	waitForNoGoal( "cardinalsguard2" ) ;
	waitForNoGoal( "jussac" ) ;
	waitForNoGoal( "cahusac" ) ;
	waitForNoGoal( "bicarat" ) ;
	
	removeMarker( name, marker ) ;
	
	setMissionChatFunction( name, "aramis", "chat_fight" ) ;
	setMissionChatFunction( name, "porthos", "chat_fight" ) ;
	setMissionChatFunction( name, "athos", "chat_fight" ) ;
		
	local tenseMusicID = addMusic( "tense", 15 ) ;
	
	-- cardinal's guards have walked up
	-- stop fighting athos and dartagnan
	makeNotEnemies( "dartagnan", "athos" ) ;
	setCharacterSlowDamage( "athos", false ) ;
	setStateMessageIdle( "dartagnan" ) ;
	setStateMessageIdle( "athos" ) ;
	
	-- make sure that athos and dartagnan have not strayed too far
	lockPlayerInPlace( ) ;
	addGoalGetToPointInLevel( "athos", athosPosX, athosPosY, "france", false, true ) ;
	addGoalGetToPointInLevel( "dartagnan", athosPosX + 50, athosPosY, "france", false, true ) ;

	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "dartagnan" ) ;	
	unlockPlayerInPlace( ) ;
	-- now athos and dartagnan are close by again
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "jussac" ) ;
	setMissionFaceCharacter( name, "athos", "jussac" ) ;
	setMissionFaceCharacter( name, "aramis", "jussac" ) ;
	setMissionFaceCharacter( name, "porthos", "jussac" ) ;
	
	local bubInd = characterSay( "jussac", true, -1, -1, true, getString( "mp8d16" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp8d17" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "jussac", true, -1, -1, true, getString( "mp8d18" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "athos", "aramis" ) ;
	setMissionFaceCharacter( name, "aramis", "athos" ) ;
	setMissionFaceCharacter( name, "porthos", "athos" ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp8d19" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp8d20" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	faceCharacter( "dartagnan", "porthos" ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp8d21" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mp8d22" ), getString( "mp8d23" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	faceCharacter( "dartagnan", "athos" ) ;
	bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp8d24" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp8d25" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp8d26" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceNone( name, "dartagnan" ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	
	removeMusic( tenseMusicID ) ;
		
	makeEnemies( "dartagnan", "cardinalsguard1", "cardinalsguard2", "jussac", "cahusac", "bicarat" ) ;
	makeEnemies( "athos", "cardinalsguard1", "cardinalsguard2", "jussac", "cahusac", "bicarat" ) ;
	makeEnemies( "aramis", "cardinalsguard1", "cardinalsguard2", "jussac", "cahusac", "bicarat" ) ;
	makeEnemies( "porthos", "cardinalsguard1", "cardinalsguard2", "jussac", "cahusac", "bicarat" ) ;

	local containX = -902 ;
	local containY = 2985 ;
	local radius = 400.0 ;
	setContainZone( "athos", true, containX, containY, radius ) ;
	setContainZone( "aramis", true, containX, containY, radius ) ;
	setContainZone( "porthos", true, containX, containY, radius ) ;
	setContainZone( "cardinalsguard1", true, containX, containY, radius ) ;
	setContainZone( "cardinalsguard2", true, containX, containY, radius ) ;
	setContainZone( "jussac", true, containX, containY, radius ) ;
	setContainZone( "cahusac", true, containX, containY, radius ) ;
	setContainZone( "bicarat", true, containX, containY, radius ) ;

	local markerGuard1 = addMarkerCharacter( name, true, getString( "fight" ), "cardinalsguard1" ) ;
	local markerGuard2 = addMarkerCharacter( name, true, getString( "fight" ), "cardinalsguard2" ) ;
	local markerJussac = addMarkerCharacter( name, true, getString( "fight" ), "jussac" ) ;
	local markerCahusac = addMarkerCharacter( name, true, getString( "fight" ), "cahusac" ) ;
	local markerBicarat = addMarkerCharacter( name, true, getString( "fight" ), "bicarat" ) ;
	
	while ( isCharacterAlive( "cardinalsguard1" ) or
		isCharacterAlive( "cardinalsguard2" ) or
		isCharacterAlive( "jussac" ) or
		isCharacterAlive( "cahusac" ) or
		isCharacterAlive( "bicarat" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, markerGuard1 ) ;
	removeMarker( name, markerGuard2 ) ;
	removeMarker( name, markerJussac ) ;
	removeMarker( name, markerCahusac ) ;
	removeMarker( name, markerBicarat ) ;

	makeNotEnemies( "dartagnan", "cardinalsguard1", "cardinalsguard2", "jussac", "cahusac", "bicarat" ) ;
	makeNotEnemies( "athos", "cardinalsguard1", "cardinalsguard2", "jussac", "cahusac", "bicarat" ) ;
	makeNotEnemies( "aramis", "cardinalsguard1", "cardinalsguard2", "jussac", "cahusac", "bicarat" ) ;
	makeNotEnemies( "porthos", "cardinalsguard1", "cardinalsguard2", "jussac", "cahusac", "bicarat" ) ;

	setContainZone( "athos", false ) ;
	setContainZone( "aramis", false ) ;
	setContainZone( "porthos", false ) ;
	setContainZone( "cardinalsguard1", false ) ;
	setContainZone( "cardinalsguard2", false ) ;
	setContainZone( "jussac", false ) ;
	setContainZone( "cahusac", false ) ;
	setContainZone( "bicarat", false ) ;
	
	-- revive any dead musketeers
	reviveHelper3( "athos", "porthos", "aramis", true ) ;
	
	-- player needs to be close to finish mission
	local marker = addMarkerPosition( name, true, getString( "fight" ), "france", athosPosX, athosPosY ) ;
	local allowDistAway = 250.0 ;
	while ( distanceToPoint( "dartagnan", "france", athosPosX, athosPosY ) > 250.0 ) do
		coroutine.yield( ) ;
	end
	removeMarker( name, marker ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	-- show comic
	local comic1 = createComic( "carmes1" ) ;

	addText( comic1, getString( "carmes1_d1" ), 19, 28, 117, 69 ) ;
	addText( comic1, getString( "carmes1_d2" ), 139, 17, 384, 80 ) ;
	addText( comic1, getString( "carmes1_d3" ), 552, 14, 618, 40 ) ;
	addText( comic1, getString( "carmes1_d4" ), 717, 49, 781, 75 ) ;
	addText( comic1, getString( "carmes1_d5" ), 537, 157, 692, 195 ) ;
	addText( comic1, getString( "carmes1_d6" ), 598, 252, 754, 292 ) ;
	addText( comic1, getString( "carmes1_d7" ), 6, 510, 251, 591 ) ;
	addText( comic1, getString( "carmes1_d8" ), 267, 327, 523, 365 ) ;
	addText( comic1, getString( "carmes1_d9" ), 304, 509, 548, 592 ) ;
	addText( comic1, getString( "carmes1_d10" ), 565, 307, 792, 351 ) ;
	addText( comic1, getString( "carmes1_d11" ), 595, 370, 732, 451 ) ;
	
	addMouseOver( comic1, getString( "aramis" ), 38, 103, 148, 318, 101, 108 ) ;
	addMouseOver( comic1, getString( "athos" ), 155, 105, 251, 316, 202, 105 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 252, 115, 349, 314, 294, 121 ) ;
	addMouseOver( comic1, getString( "porthos" ), 357, 32, 493, 314, 405, 37 ) ;
	
	addMouseOver( comic1, getString( "athos" ), 3, 350, 56, 530, 24, 354 ) ;
	addMouseOver( comic1, getString( "porthos" ), 78, 325, 184, 529, 106, 328 ) ;
	addMouseOver( comic1, getString( "aramis" ), 172, 356, 253, 489, 200, 358 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 44, 372, 86, 520, 67, 370 ) ;
	addMouseOver( comic1, getString( "treville" ), 205, 409, 251, 519, 228, 414 ) ;

	addMouseOver( comic1, getString( "treville" ), 292, 373, 391, 580, 357, 375 ) ;
	addMouseOver( comic1, getString( "louisxiii" ), 437, 360, 522, 543, 478, 369 ) ;
	
	addMouseOver( comic1, getString( "treville" ), 580, 436, 722, 593, 618, 445 ) ;
	addMouseOver( comic1, getString( "louisxiii" ), 677, 427, 797, 595, 740, 426 ) ;

	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	-- revive enemies and put back to default positions
	giveHealth( "cardinalsguard1", 200 ) ;
	reviveCharacter( "cardinalsguard1" ) ;
	place_cardinalsguard1( "cardinalsguard1" ) ;
	giveHealth( "cardinalsguard2", 200 ) ;
	reviveCharacter( "cardinalsguard2" ) ;
	place_cardinalsguard2( "cardinalsguard2" ) ;
	giveHealth( "jussac", 200 ) ;
	reviveCharacter( "jussac" ) ;
	place_jussac( "jussac" ) ;
	giveHealth( "cahusac", 200 ) ;
	reviveCharacter( "cahusac" ) ;
	place_cahusac( "cahusac" ) ;
	giveHealth( "bicarat", 200 ) ;
	reviveCharacter( "bicarat" ) ;
	place_bicarat( "bicarat" ) ;

	-- place dart and musketeers back
	giveHealth( "athos", 200 ) ;
	giveHealth( "porthos", 200 ) ;
	giveHealth( "aramis", 200 ) ;
	giveHealth( "dartagnan", 200 ) ;
	
	-- put dartagnan in front of Monsieur de Treville's place
	placeCharacter( "dartagnan", "france", -496, 2378 ) ;
	faceDirection( "dartagnan", 0, 1 ) ;
	moveCameraToDest( ) ;
	
	-- put musketeers at default positions
	place_athosA( "athos" ) ;
	place_aramisA( "aramis" ) ;
	place_porthosA( "porthos" ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	giveHealth( "athos", 200 ) ;
	giveHealth( "porthos", 200 ) ;
	giveHealth( "aramis", 200 ) ;
	
	removeWatchCharacter( "athos", athosID ) ;
	removeWatchCharacter( "aramis", aramisID ) ;
	removeWatchCharacter( "porthos", porthosID ) ;
	removeWatchCharacter( "cardinalsguard1", cardinalsguard1ID ) ;
	removeWatchCharacter( "cardinalsguard2", cardinalsguard2ID ) ;
	removeWatchCharacter( "jussac", jussacID ) ;
	removeWatchCharacter( "cahusac", cahusacID ) ;
	removeWatchCharacter( "bicarat", bicaratID ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis9" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis9( name )
	-- Meet Musketeers in bar before tennis match
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "treville", getString( "mp9d7" ) ) ;
	
	sitCharacter( "athos", "pommechair1" ) ;
	sitCharacter( "aramis", "pommechair2" ) ;
	sitCharacter( "porthos", "pommechair4" ) ;

	local marker = addMarkerCharacter( name, true, getString( "mp9m1" ), "athos" ) ;

	
	if ( getExploreTutOn( ) ) then
		if ( not getBoolean( "showedexploretut" ) ) then
			local showExploreTutMinutes = 4 ; -- 3
			local showExploreTutSeconds = showExploreTutMinutes * 60 ;
			local haveWandered = getFloat( "notfollowtime" ) > showExploreTutSeconds ;
			if ( ( not haveWandered ) and ( not anySideMissionEverActive( ) ) ) then
				setIgnoreFreeze( "dartagnan", false ) ;
				setMissionFreezeGame( name, true ) ;
				
				waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
				setDialogueScript( "shouldexplore", 0 ) ;
				waitForNoActiveTutorialDialogue( ) ;
		
				setMissionFreezeGame( name, false ) ;
				setIgnoreFreeze( "dartagnan", true ) ;
			end
			
			setBoolean( "showedexploretut", true ) ;					
		end
	end


	waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
		
	removeMarker( name, marker ) ;	

	setMissionFreezeGame( name, true ) ;
	local bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp9d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "aramis", true, -1, -1, false, getString( "mp9d2" ) ) ;
	waitForBubbleDone( bubInd ) ;
	setBubbleToBackgroundOpacity( bubInd ) ;
	local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mp9d3" ), getString( "mp9d4" ) ) ;
	local goWith = waitForBubbleOption( bubInd2 ) ;
	deleteBubble( bubInd ) ;
	if ( goWith == 0 ) then
		local bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp9d5" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	else
		local bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp9d6" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	end			
	setMissionFreezeGame( name, false ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis10" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis10( name )
	-- Play Tennis Match
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "treville", getString( "mp9d7" ) ) ;
	setMissionChatString( name, "athos", getString( "mp10d8" ) ) ;
	setMissionChatString( name, "porthos", getString( "mp10d8" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp10d8" ) ) ;

	local marker = addMarkerCharacter( name, true, getString( "mp10m1" ), "porthos" ) ;

	ensureCharacterInLevel( "athos", "pommedepinhouse", 50, 161 ) ;
	ensureCharacterInLevel( "porthos", "pommedepinhouse", 80, 200 ) ;
	ensureCharacterInLevel( "aramis", "pommedepinhouse", 110, 200 ) ;
	
	addGoalGetToPointInLevel( "athos", 110, -20, "tennis", false, true ) ;
	addGoalGetToPointInLevel( "porthos", 115, 20, "tennis", false, true ) ;
	addGoalGetToPointInLevel( "aramis", 107, 60, "tennis", false, true ) ;
	
	placeCharacter( "bernajoux", "tennis", 200, 70 ) ;
	setMissionFaceCharacter( name, "bernajoux", "dartagnan" ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;

	setMissionFaceDirection( name, "athos", 1, 0 ) ;
	setMissionFaceDirection( name, "porthos", 1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 1, 0 ) ;
	
	waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
		
	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	local bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp10d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp10d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	
	-- set porthos face down for tennis game
	setMissionFaceDirection( name, "porthos", 0, 1 ) ;
	
	gTennisOpponentNum = -1 ;
	gWonTennis = false ;
	activateScriptMessage( "runTennisGame" ) ;
	coroutine.yield( ) ;
	
	while ( gPlayingTennis ) do
		coroutine.yield( ) ;
	end

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "bernajoux", true ) ;
	setMissionFaceCharacter( name, "bernajoux", "dartagnan" ) ;
	faceCharacter( "dartagnan", "bernajoux" ) ;

	local tenseMusicID = addMusic( "tense", 15 ) ;

	if ( gWonTennis ) then
		bubInd = characterSay( "bernajoux", true, -1, -1, true, getString( "mp10d4" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	else
		bubInd = characterSay( "bernajoux", true, -1, -1, true, getString( "mp10d3" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	end
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp10d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "bernajoux", true, -1, -1, true, getString( "mp10d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp10d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "bernajoux", false ) ;
	
	removeMusic( tenseMusicID ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis11" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis11( name )
	-- duel with bernajoux and then brawl with everyone
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "treville", getString( "mp9d7" ) ) ;
	setMissionChatString( name, "bernajoux", getString( "mp11d14" ) ) ;

	local overrideSaveID = createOverrideSavePos( "tennis", 159, 167 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 429, 3514, 2733, 4829 } ) ;
	
	setMissionChatString( name, "athos", getString( "mp11d2" ) ) ;
	setMissionChatString( name, "porthos", getString( "mp11d2" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp11d2" ) ) ;

	ensureCharacterInLevel( "porthos", "tennis", 530, 122) ;
	ensureCharacterInLevel( "athos", "tennis", 570, 122 ) ;
	ensureCharacterInLevel( "aramis", "tennis", 550, 160 ) ;
	setMissionFaceDirection( name, "porthos", 1, 0 ) ;
	setMissionFaceDirection( name, "athos", -1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;

	ensureCharacterInLevel( "bernajoux", "tennis", 213, 94 ) ;
	addGoalGetToPointInLevel( "bernajoux", 1204, 4093, "france", false, true ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mp11m1" ), "bernajoux" ) ;

	-- create cardinals guards waiting outside (will attack dart after done fighting)
	local cardGuard1 = createTempCharacter( getString( "cardinalsguard" ), "france", 910, 4039 ) ;
	randomDressCardinalsGuard( cardGuard1, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorDynamic( cardGuard1, -2, -2, 2, 1000, 0.5 ) ;
	--setStatsCalculatorStatic( cardGuard1, 9, 9, 9, 9 ) ;
	setMeleeWeapon( cardGuard1, "sword_1" ) ;
	local cardGuard2 = createTempCharacter( getString( "cardinalsguard" ), "france", 950, 4039 ) ;
	randomDressCardinalsGuard( cardGuard2, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorDynamic( cardGuard2, -2, -2, 2, 1000, 0.5 ) ;
	--setStatsCalculatorStatic( cardGuard2, 9, 9, 9, 9 ) ;
	setMeleeWeapon( cardGuard2, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard1, cardGuard2 ) ;
	setMissionFaceCharacter( name, cardGuard2, cardGuard1 ) ;
	
	local cardGroupX = 570 ;
	local cardGroupY = 4150 ;
	local cardGroupDist = 20 ;
	local cardGuard3 = createTempCharacter( getString( "cardinalsguard" ), "france", 
		cardGroupX - cardGroupDist, cardGroupY ) ;
	randomDressCardinalsGuard( cardGuard3, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorDynamic( cardGuard3, -2, -2, 2, 1000, 0.5 ) ;
	--setStatsCalculatorStatic( cardGuard3, 9, 9, 9, 9 ) ;
	setMeleeWeapon( cardGuard3, "sword_1" ) ;
	local cardGuard4 = createTempCharacter( getString( "cardinalsguard" ), "france", 
		cardGroupX + cardGroupDist, cardGroupY ) ;
	randomDressCardinalsGuard( cardGuard4, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorDynamic( cardGuard4, -2, -2, 2, 1000, 0.5 ) ;
	--setStatsCalculatorStatic( cardGuard4, 9, 9, 9, 9 ) ;
	setMeleeWeapon( cardGuard4, "sword_1" ) ;
	local cardGuard5 = createTempCharacter( getString( "cardinalsguard" ), "france", 
		cardGroupX, cardGroupY - cardGroupDist ) ;
	randomDressCardinalsGuard( cardGuard5, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorDynamic( cardGuard5, -2, -2, 2, 1000, 0.5 ) ;
	--setStatsCalculatorStatic( cardGuard5, 9, 9, 9, 9 ) ;
	setMeleeWeapon( cardGuard5, "sword_1" ) ;
	local cardGuard6 = createTempCharacter( getString( "cardinalsguard" ), "france", 
		cardGroupX, cardGroupY + cardGroupDist ) ;
	randomDressCardinalsGuard( cardGuard6, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorDynamic( cardGuard6, -2, -2, 2, 1000, 0.5 ) ;
	--setStatsCalculatorStatic( cardGuard6, 9, 9, 9, 9 ) ;
	setMeleeWeapon( cardGuard6, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard3, cardGuard4 ) ;
	setMissionFaceCharacter( name, cardGuard4, cardGuard3 ) ;
	setMissionFaceCharacter( name, cardGuard5, cardGuard6 ) ;
	setMissionFaceCharacter( name, cardGuard6, cardGuard5 ) ;
	
	local goodGroupX = 1523 ;
	local goodGroupY = 3624 ;
	local goodGroupDist = 20 ;
	local goodGuard1 = createTempCharacter( getString( "musketeer" ), "france", 
		goodGroupX - goodGroupDist, goodGroupY ) ;
	randomDressMusketeer( goodGuard1, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorDynamic( goodGuard1, -2, -2, 2, 1000, 0.5 ) ;
	--setStatsCalculatorStatic( goodGuard1, 9, 9, 9, 9 ) ;
	setMeleeWeapon( goodGuard1, "sword_1" ) ;
	local goodGuard2 = createTempCharacter( getString( "guardsman" ), "france", 
		goodGroupX + goodGroupDist, goodGroupY ) ;
	randomDressGuardsman( goodGuard2, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorDynamic( goodGuard2, -2, -2, 2, 1000, 0.5 ) ;
	--setStatsCalculatorStatic( goodGuard2, 9, 9, 9, 9 ) ;
	setMeleeWeapon( goodGuard2, "sword_1" ) ;
	local goodGuard3 = createTempCharacter( getString( "musketeer" ), "france", 
		goodGroupX, goodGroupY - goodGroupDist ) ;
	randomDressMusketeer( goodGuard3, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorDynamic( goodGuard3, -2, -2, 2, 1000, 0.5 ) ;
	--setStatsCalculatorStatic( goodGuard3, 9, 9, 9, 9 ) ;
	setMeleeWeapon( goodGuard3, "sword_1" ) ;
	local goodGuard4 = createTempCharacter( getString( "guardsman" ), "france", 
		goodGroupX, goodGroupY + goodGroupDist ) ;
	randomDressGuardsman( goodGuard4, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorDynamic( goodGuard4, -2, -2, 2, 1000, 0.5 ) ;
	--setStatsCalculatorStatic( goodGuard4, 9, 9, 9, 9 ) ;
	setMeleeWeapon( goodGuard4, "sword_1" ) ;
	setMissionFaceCharacter( name, goodGuard1, goodGuard2 ) ;
	setMissionFaceCharacter( name, goodGuard2, goodGuard1 ) ;
	setMissionFaceCharacter( name, goodGuard3, goodGuard4 ) ;
	setMissionFaceCharacter( name, goodGuard4, goodGuard3 ) ;
	

	waitForNoGoal( "bernajoux" ) ;
	setMissionFaceCharacter( name, "bernajoux", "dartagnan" ) ;
	
	local fightStartDist = 100 ;
	while ( distanceBetweenCharacters( "dartagnan", "bernajoux" ) > fightStartDist ) do
		coroutine.yield( ) ;
	end
	
	setStateMessageIdle( "dartagnan" ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "bernajoux", true ) ;
	faceCharacter( "dartagnan", "bernajoux" ) ;
	local bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp11d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "bernajoux", false ) ;
	
	makeEnemies( "dartagnan", "bernajoux" ) ;
	local containX = 1204 ;
	local containY = 4093 ;
	local radius = 400.0 ;
	setContainZone( "bernajoux", true, containX, containY, radius ) ;

	-- don't let player back in tennis court
	local doorLockA = addDoorLock( name, "", true, "tennisout" ) ;

	local lapseTutorial = false ;
	if ( lapseTutorial ) then
		setCharacterSlowDamage( "dartagnan", true ) ;	
		setCharacterSlowDamage( "bernajoux", true ) ;	
		
		while ( not isCharacterFighting( "dartagnan" ) ) do
			coroutine.yield( ) ;
		end
		
		setMissionFreezeGame( name, true ) ;
			
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "superlunge1", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
		
		setMissionFreezeGame( name, false ) ;
		
		lockPlayerInPlace( ) ;
		setTimeUntilConcentrationLapse( 10.0 ) ;
		wait( 2 ) ;
		unlockPlayerInPlace( ) ;
	
		gTutAttackEnemyName = "bernajoux" ;
		forceIndefiniteTimeLapse( ) ;
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "superlunge2", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
	
		setLapseDamageMultiplier( 30.0 ) ;
	
		-- make sure characters have health
		if ( getRatioHealth( "dartagnan" ) < 0.3 ) then
			setRatioHealth( "dartagnan", 0.3 ) ;
		end
		if ( getRatioHealth( "bernajoux" ) < 0.1 ) then
			setRatioHealth( "bernajoux", 0.1 ) ;
		end
	
		setCharacterSlowDamage( "dartagnan", false ) ;	
		setCharacterSlowDamage( "bernajoux", false ) ;	
		
		wait( 2 ) ;
		
		setDefaultLapseDamageMultiplier( ) ;
	
		resetIndefiniteTimeLapse( ) ;
	
		setMissionFreezeGame( name, true ) ;
		
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "superlunge3", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;	
		
		setMissionFreezeGame( name, false ) ;
	else
		-- already did lapse tutorial earlier
		-- test to see if player is still rapidly clicking on enemy
		while ( not isCharacterFighting( "dartagnan" ) ) do
			coroutine.yield( ) ;
		end
		
		local clickEnemyTutNum = 4 ;
	
		local counter = 0.0 ;
		local maxWaitForMultiClickTime = 2.0 ;
		while ( ( counter < maxWaitForMultiClickTime ) and 
				( isCharacterAlive( "bernajoux" ) ) and 
				( getFightClickedOnCharacter( "bernajoux" ) <= clickEnemyTutNum ) ) do
			counter = counter + getDeltaT( ) ;
			coroutine.yield( ) ;
		end
		
		if ( isCharacterFighting( "dartagnan" ) and isCharacterAlive( "bernajoux" ) ) then
			if ( getFightClickedOnCharacter( "bernajoux" ) >= clickEnemyTutNum ) then
				-- show "don't click" tutorial if player has clicked opponent a lot
				setMissionFreezeGame( name, true ) ;
					
				waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
				setDialogueScript( "bernrepeatclick", 0 ) ;
				waitForNoActiveTutorialDialogue( ) ;
			
				setMissionFreezeGame( name, false ) ;
			end
			
			if ( getInt( "lapsehits" ) <= 2 ) then
				-- show lapse tut reminder
				setMissionFreezeGame( name, true ) ;
					
				waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
				setDialogueScript( "bernperspagain", 0 ) ;
				waitForNoActiveTutorialDialogue( ) ;
			
				setMissionFreezeGame( name, false ) ;
			end
		end
	end
		
	while ( isCharacterAlive( "bernajoux" ) ) do
		coroutine.yield( ) ;
	end	
	
	removeMarker( name, marker ) ;
	
	-- bernajoux is dead - send two cardinals guards after dart
	makeEnemies( "dartagnan", cardGuard1, cardGuard2 ) ;
	makeEnemies( "athos", cardGuard1, cardGuard2 ) ;
	makeEnemies( "aramis", cardGuard1, cardGuard2 ) ;
	makeEnemies( "porthos", cardGuard1, cardGuard2 ) ;
	
	local athosID = addWatchCharacterUnlimited( "athos" ) ;
	local aramisID = addWatchCharacterUnlimited( "aramis" ) ;
	local porthosID = addWatchCharacterUnlimited( "porthos" ) ;
	local cardGuard1ID = addWatchCharacterUnlimited( cardGuard1 ) ;
	local cardGuard2ID = addWatchCharacterUnlimited( cardGuard2 ) ;
	
	wait( 0.5 ) ; -- let bernajoux death anim play
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "dartagnan", false ) ;
	local bubInd = characterSay( cardGuard2, true, -1, -1, true, getString( "mp11d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "dartagnan", true ) ;
	
	wait( 2 ) ;
	
	local marker1 = addMarkerCharacter( name, true, getString( "fight" ), cardGuard1 ) ;
	local marker2 = addMarkerCharacter( name, true, getString( "fight" ), cardGuard2 ) ;
	local marker3 = addMarkerCharacter( name, true, getString( "fight" ), cardGuard3 ) ;
	local marker4 = addMarkerCharacter( name, true, getString( "fight" ), cardGuard4 ) ;
	local marker5 = addMarkerCharacter( name, true, getString( "fight" ), cardGuard5 ) ;
	local marker6 = addMarkerCharacter( name, true, getString( "fight" ), cardGuard6 ) ;
	
	setMissionChatFunction( name, "aramis", "chat_fight" ) ;
	setMissionChatFunction( name, "porthos", "chat_fight" ) ;
	setMissionChatFunction( name, "athos", "chat_fight" ) ;
	
	-- now send Musketeers to help dart
	placeCharacterInDoor( "athos", "tennisout", false ) ;
	wait( 1 ) ;
	placeCharacterInDoor( "aramis", "tennisout", false ) ;
	wait( 1 ) ;
	placeCharacterInDoor( "porthos", "tennisout", false ) ;
	wait( 1 ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "dartagnan", false ) ;
	local bubInd = characterSay( cardGuard1, true, -1, -1, true, getString( "mp11d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "dartagnan", true ) ;

	-- send in card guards
	makeEnemies( "dartagnan", cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeEnemies( "athos", cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeEnemies( "aramis", cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeEnemies( "porthos", cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;

	local cardGuard3ID = addWatchCharacterUnlimited( cardGuard3 ) ;
	local cardGuard4ID = addWatchCharacterUnlimited( cardGuard4 ) ;
	local cardGuard5ID = addWatchCharacterUnlimited( cardGuard5 ) ;
	local cardGuard6ID = addWatchCharacterUnlimited( cardGuard6 ) ;

	setContainZone( "athos", true, containX, containY, radius ) ;
	setContainZone( "aramis", true, containX, containY, radius ) ;
	setContainZone( "porthos", true, containX, containY, radius ) ;
	setContainZone( cardGuard1, true, containX, containY, radius ) ;
	setContainZone( cardGuard2, true, containX, containY, radius ) ;
	setContainZone( cardGuard3, true, containX, containY, radius ) ;
	setContainZone( cardGuard4, true, containX, containY, radius ) ;
	setContainZone( cardGuard5, true, containX, containY, radius ) ;
	setContainZone( cardGuard6, true, containX, containY, radius ) ;
	
	wait( 3 ) ;
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "dartagnan", false ) ;
	local bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp11d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "dartagnan", true ) ;

	-- send in good guards
	makeEnemies( goodGuard1, cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeEnemies( goodGuard2, cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeEnemies( goodGuard3, cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeEnemies( goodGuard4, cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;

	local goodGuard1ID = addWatchCharacterUnlimited( goodGuard1 ) ;
	local goodGuard2ID = addWatchCharacterUnlimited( goodGuard2 ) ;
	local goodGuard3ID = addWatchCharacterUnlimited( goodGuard3 ) ;
	local goodGuard4ID = addWatchCharacterUnlimited( goodGuard4 ) ;

	setContainZone( goodGuard1, true, containX, containY, radius ) ;
	setContainZone( goodGuard2, true, containX, containY, radius ) ;
	setContainZone( goodGuard3, true, containX, containY, radius ) ;
	setContainZone( goodGuard4, true, containX, containY, radius ) ;

	wait( 20 ) ;
	
	-- make cardinals guards retreat
	makeNotEnemies( "dartagnan", cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeNotEnemies( "athos", cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeNotEnemies( "aramis", cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeNotEnemies( "porthos", cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeNotEnemies( goodGuard1, cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeNotEnemies( goodGuard2, cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeNotEnemies( goodGuard3, cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;
	makeNotEnemies( goodGuard4, cardGuard1, cardGuard2, cardGuard3, cardGuard4, cardGuard5, cardGuard6 ) ;

	setContainZone( "athos", false ) ;
	setContainZone( "aramis", false ) ;
	setContainZone( "porthos", false ) ;
	setContainZone( cardGuard1, false ) ;
	setContainZone( cardGuard2, false ) ;
	setContainZone( cardGuard3, false ) ;
	setContainZone( cardGuard4, false ) ;
	setContainZone( cardGuard5, false ) ;
	setContainZone( cardGuard6, false ) ;
	setContainZone( goodGuard1, false ) ;
	setContainZone( goodGuard2, false ) ;
	setContainZone( goodGuard3, false ) ;
	setContainZone( goodGuard4, false ) ;

	setStateMessageIdle( "dartagnan" ) ;
	setStateMessageIdle( "athos" ) ;
	setStateMessageIdle( "aramis" ) ;
	setStateMessageIdle( "porthos" ) ;
	setStateMessageIdle( goodGuard1 ) ;
	setStateMessageIdle( goodGuard2 ) ;
	setStateMessageIdle( goodGuard3 ) ;
	setStateMessageIdle( goodGuard4 ) ;
	setStateMessageIdle( cardGuard1 ) ;
	setStateMessageIdle( cardGuard2 ) ;
	setStateMessageIdle( cardGuard3 ) ;
	setStateMessageIdle( cardGuard4 ) ;
	setStateMessageIdle( cardGuard5 ) ;
	setStateMessageIdle( cardGuard6 ) ;
	
	removeMarker( name, marker1 ) ;
	removeMarker( name, marker2 ) ;
	removeMarker( name, marker3 ) ;
	removeMarker( name, marker4 ) ;
	removeMarker( name, marker5 ) ;
	removeMarker( name, marker6 ) ;

	-- make sure player is close before playing animation of everyone walking away
	local posMarker = addMarkerPosition( name, true, getString( "fight" ), "france", containX, containY ) ;
		
	local dist = 600.0
	while ( distanceToPoint( "dartagnan", "france", containX, containY ) > dist ) do
		coroutine.yield( ) ;
	end

	removeMarker( name, posMarker ) ;
	
	lockPlayerInPlace( ) ;

	-- send cardinals guards away
	if ( characterExists( cardGuard1 ) ) then
		addGoalGetToPointInLevel( cardGuard1, 0, 3992, "france", false, true ) ;
	end
	if ( characterExists( cardGuard2 ) ) then
		addGoalGetToPointInLevel( cardGuard2, 0, 3992, "france", false, true ) ;
	end
	if ( characterExists( cardGuard3 ) ) then
		addGoalGetToPointInLevel( cardGuard3, 0, 3992, "france", false, true ) ;
	end
	if ( characterExists( cardGuard4 ) ) then
		addGoalGetToPointInLevel( cardGuard4, 0, 3992, "france", false, true ) ;
	end
	if ( characterExists( cardGuard5 ) ) then
		addGoalGetToPointInLevel( cardGuard5, 0, 3992, "france", false, true ) ;
	end
	if ( characterExists( cardGuard6 ) ) then
		addGoalGetToPointInLevel( cardGuard6, 0, 3992, "france", false, true ) ;
	end

	-- make sure all musketeers are on screen
	if ( ( not isCharacterAllOnScreen( "athos" ) ) 
		or ( not isCharacterAllOnScreen( "aramis" ) )
		or ( not isCharacterAllOnScreen( "porthos" ) ) ) then
		setStateMessageIdle( "dartagnan" ) ;
		addGoalGetToPointInLevel( "dartagnan", containX, containY, "france", false, true ) ;
		
		while ( characterHasGoal( "dartagnan" ) ) do
			-- walk toward combat center until all musketeers are visible
			if ( isCharacterAllOnScreen( "athos" ) 
				and isCharacterAllOnScreen( "aramis" )
				and isCharacterAllOnScreen( "porthos" ) ) then
				DEBUG_OUTPUT( "all on screen" ) ;
				clearGoals( "dartagnan" ) ;
			end
			coroutine.yield( ) ;
		end
	end
	
	setStateMessageIdle( "dartagnan" ) ;
	
	-- let cardinal's guards run for a bit before sending off musketeers
	wait( 1 ) ;
	
	-- bring musketeers back alive	
	reviveHelper3( "athos", "porthos", "aramis", false ) ;
	giveHealth( "athos", 200 ) ;
	giveHealth( "porthos", 200 ) ;
	giveHealth( "aramis", 200 ) ;
	
	setMissionFaceDirection( name, "porthos", -1, 0 ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	setMissionFaceCharacter( name, "aramis", "porthos" ) ;
	faceCharacter( "dartagnan", "porthos" ) ;
	local bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp11d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	-- send musketeers away
	if ( characterExists( goodGuard1 ) ) then
		addGoalGetToPointInLevel( goodGuard1, 1527, 3392, "france", false, true ) ;
	end
	if ( characterExists( goodGuard2 ) ) then
		addGoalGetToPointInLevel( goodGuard2, 1527, 3392, "france", false, true ) ;
	end
	if ( characterExists( goodGuard3 ) ) then
		addGoalGetToPointInLevel( goodGuard3, 1527, 3392, "france", false, true ) ;
	end
	if ( characterExists( goodGuard4 ) ) then
		addGoalGetToPointInLevel( goodGuard4, 1527, 3392, "france", false, true ) ;
	end
	
	wait( 2 ) ;
	
	setMissionFaceCharacter( name, "athos", "aramis" ) ;
	setMissionFaceCharacter( name, "porthos", "aramis" ) ;
	faceCharacter( "dartagnan", "aramis" ) ;
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp11d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
		
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	setMissionFaceCharacter( name, "aramis", "porthos" ) ;
	faceCharacter( "dartagnan", "porthos" ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp11d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mp11d9" ), getString( "mp11d10" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;

	faceCharacter( "dartagnan", "athos" ) ;
	setMissionFaceCharacter( name, "aramis", "athos" ) ;
	setMissionFaceCharacter( name, "porthos", "athos" ) ;
	if ( option == 0 ) then
		bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp11d11" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	else
		bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp11d12" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	end	
	
	setMissionFaceCharacter( name, "athos", "aramis" ) ;
	setMissionFaceCharacter( name, "porthos", "aramis" ) ;
	faceCharacter( "dartagnan", "aramis" ) ;
	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp11d13" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	-- wait for all deletable characters to be offscreen before deleting them	
	waitForCharacterOffScreen( cardGuard1 ) ;
	waitForCharacterOffScreen( cardGuard2 ) ;
	waitForCharacterOffScreen( cardGuard3 ) ;
	waitForCharacterOffScreen( cardGuard4 ) ;
	waitForCharacterOffScreen( cardGuard5 ) ;
	waitForCharacterOffScreen( cardGuard6 ) ;
	waitForCharacterOffScreen( goodGuard1 ) ;
	waitForCharacterOffScreen( goodGuard2 ) ;
	waitForCharacterOffScreen( goodGuard3 ) ;
	waitForCharacterOffScreen( goodGuard4 ) ;

	unlockPlayerInPlace( ) ;

	removeWatchCharacter( "athos", athosID ) ;
	removeWatchCharacter( "aramis", aramisID ) ;
	removeWatchCharacter( "porthos", porthosID ) ;
	removeWatchCharacter( cardGuard1, cardGuard1ID ) ;
	removeWatchCharacter( cardGuard2, cardGuard2ID ) ;
	removeWatchCharacter( cardGuard3, cardGuard3ID ) ;
	removeWatchCharacter( cardGuard4, cardGuard4ID ) ;
	removeWatchCharacter( cardGuard5, cardGuard5ID ) ;
	removeWatchCharacter( cardGuard6, cardGuard6ID ) ;
	removeWatchCharacter( goodGuard1, goodGuard1ID ) ;
	removeWatchCharacter( goodGuard2, goodGuard2ID ) ;
	removeWatchCharacter( goodGuard3, goodGuard3ID ) ;
	removeWatchCharacter( goodGuard4, goodGuard4ID ) ;
	
	deleteTempCharacter( cardGuard1 ) ;
	deleteTempCharacter( cardGuard2 ) ;
	deleteTempCharacter( cardGuard3 ) ;
	deleteTempCharacter( cardGuard4 ) ;
	deleteTempCharacter( cardGuard5 ) ;
	deleteTempCharacter( cardGuard6 ) ;
	deleteTempCharacter( goodGuard1 ) ;
	deleteTempCharacter( goodGuard2 ) ;
	deleteTempCharacter( goodGuard3 ) ;
	deleteTempCharacter( goodGuard4 ) ;
				
	-- lock to tennis court				
	removeDoorLock( doorLockA ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
					
	completeMission( name ) ;
	activateMission( "missionparis12" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis12( name )
	-- Go to see Monsieur de Treville before visiting the king
	DEBUG_OUTPUT( name .. " started" ) ;
	
	-- lock Tremouilles and take guards from in front of it
	-- so if player goes to check then everything is locked
	local doorLockA = addDoorLock( name, "", true, "cardinalguardout" ) ;
	placeCharacter( "cardinalsguard1", "cardinalguardhouse", -59, 131 ) ;
	placeCharacter( "cardinalsguard2", "cardinalguardhouse", -59, 131 ) ;
	placeCharacter( "jussac", "cardinalguardhouse", -59, 131 ) ;
	placeCharacter( "cahusac", "cardinalguardhouse", -59, 131 ) ;
	placeCharacter( "bicarat", "cardinalguardhouse", -59, 131 ) ;
	
	ensureCharacterAroundPoint( "athos", "france", 1204, 4093, 600 ) ;
	ensureCharacterAroundPoint( "aramis", "france", 1204, 4093, 600 ) ;
	ensureCharacterAroundPoint( "porthos", "france", 1204, 4093, 600 ) ;

	-- get to Treville's anteroom
	addGoalGetToPointInLevel( "athos", -50, 68, "trevillehouse2", false, true ) ;
	addGoalGetToPointInLevel( "aramis", -10, 68, "trevillehouse2", false, true ) ;
	addGoalGetToPointInLevel( "porthos", -30, 110, "trevillehouse2", false, true ) ;
	setMissionFaceDirection( name, "athos", 1, 0 ) ;
	setMissionFaceDirection( name, "aramis", -1, 0 ) ;
	setMissionFaceDirection( name, "porthos", 0, -1 ) ;
	setMissionChatString( name, "athos", getString( "mp12d2" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp12d1" ) ) ;
	setMissionChatString( name, "porthos", getString( "mp12d1" ) ) ;

	local marker = addMarkerCharacter( name, true, getString( "mp12m1" ), "treville" ) ;
	waitForTalk( "dartagnan", "treville", false ) ;
	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	setStateMessageIdle( "dartagnan" ) ;
	
	-- send in Three Musketeers
	clearGoals( "athos" ) ;
	clearGoals( "porthos" ) ;
	clearGoals( "aramis" ) ;
	setMissionFaceCharacter( name, "athos", "treville" ) ;
	setMissionFaceCharacter( name, "porthos", "treville" ) ;
	setMissionFaceCharacter( name, "aramis", "treville" ) ;
	setMissionFaceCharacter( name, "dartagnan", "treville" ) ;
	placeCharacterInDoor( "athos", "trevilleantechamberin", false ) ;
	addGoalGetToPointInLevel( "athos", 83, -23, "trevilleantechamber", false, true ) ;
	wait( 1 ) ;
	placeCharacterInDoor( "porthos", "trevilleantechamberin", false ) ;
	addGoalGetToPointInLevel( "porthos", 83, 20, "trevilleantechamber", false, true ) ;
	wait( 1 ) ;
	placeCharacterInDoor( "aramis", "trevilleantechamberin", false ) ;
	addGoalGetToPointInLevel( "aramis", 83, 60, "trevilleantechamber", false, true ) ;
	wait( 1 ) ;
	addGoalGetToPointInLevel( "dartagnan", 83, 100, "trevilleantechamber", false, true ) ;

	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "dartagnan" ) ;

	local bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp12d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mp12d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp12d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp12d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	-- treville walks closer to door
	setMissionFaceCharacter( name, "treville", "dartagnan" ) ;
	addGoalGetToPointInLevel( "treville", -49, 79, "trevilleantechamber", false, true ) ;
	waitForNoGoal( "treville" ) ;

	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp12d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp12d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	addGoalGetToPointInLevel( "treville", -62, -200, "trevillehouse2", false, true ) ;

	bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp12d9" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp12d10" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	waitForNoGoal( "treville" ) ;
	-- Treville has left the room
	
	unlockPlayerInPlace( ) ;
	

	-- unlock and put cardinals guards back where they belong
	removeDoorLock( doorLockA ) ;
	place_cardinalsguard1( "cardinalsguard1" ) ;
	place_cardinalsguard2( "cardinalsguard2" ) ;
	place_jussac( "jussac" ) ;
	place_cahusac( "cahusac" ) ;
	place_bicarat( "bicarat" ) ;

	completeMission( name ) ;
	activateMission( "missionparis13" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis13( name )
	-- Go to see the king and get reward
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setInventoryItem( "king_reward_money_pouch", 0 ) ;
	
	local overrideSaveID = createOverrideSavePos( "france", -80, 287 ) ;
	setOverrideSaveLevel( overrideSaveID, "louvrehouse" ) ;
	
	setCharacterOverrideName( "rochefort", true, getString( "rochefortunknown" ) ) ;
	
	ensureCharacterInLevel( "athos", "trevilleantechamber", 83, -23 ) ;
	ensureCharacterInLevel( "porthos", "trevilleantechamber", 83, 20 ) ;
	ensureCharacterInLevel( "aramis", "trevilleantechamber", 83, 60 ) ;
	
	addGoalGetToPointInLevel( "athos", -145, -101, "louvrehouse", false, true ) ;
	addGoalGetToPointInLevel( "porthos", -105, -101, "louvrehouse", false, true ) ;
	addGoalGetToPointInLevel( "aramis", -25, -101, "louvrehouse", false, true ) ;

	setMissionFaceCharacter( name, "athos", "louisxiii" ) ;
	setMissionFaceCharacter( name, "porthos", "louisxiii" ) ;
	setMissionFaceCharacter( name, "aramis", "louisxiii" ) ;	
	setMissionChatString( name, "athos", getString( "mp13d1" ) ) ;
	setMissionChatString( name, "porthos", getString( "mp13d1" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp13d1" ) ) ;
	
	--placeCharacter( "treville", "louvrehouse", -145, -165 ) ;
	placeCharacter( "tremouille", "louvrehouse", -13, -165 ) ;
	setMissionFaceCharacter( name, "treville", "louisxiii" ) ;
	setMissionFaceCharacter( name, "tremouille", "louisxiii" ) ;

	placeCharacter( "louisxiii", "louvrehouse", -80, -227 ) ;
	placeCharacter( "musketeer30", "louvrehouse", -258, -254 ) ;
	placeCharacter( "musketeer31", "louvrehouse", 107, -254 ) ;
	setMissionFaceCharacter( name, "louisxiii", "treville" ) ;
	setMissionFaceDirection( name, "musketeer30", 0, 1 ) ;
	setMissionFaceDirection( name, "musketeer31", 0, 1 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mp13m1" ), "louisxiii" ) ;
	
	local dist = 200 ;
	while ( distanceToPoint( "dartagnan", "louvrehouse", -78, -204 ) > dist ) do
		coroutine.yield( ) ;
	end

	lockPlayerInPlace( ) ;
	removeMarker( name, marker ) ;

	-- make all musketeer at correct positions
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -65, -101, "louvrehouse", false, true ) ;

	setMissionFaceCharacter( name, "dartagnan", "louisxiii" ) ;

	if ( not ( getCharacterFunctionalLevel( "athos" ) == "louvrehouse" ) ) then
		clearGoals( "athos" ) ;
		placeCharacterInDoor( "athos", "louvrein", false ) ;
		addGoalGetToPointInLevel( "athos", -145, -101, "louvrehouse", false, true ) ;
		wait( 1 ) ;
	end
	
	if ( not ( getCharacterFunctionalLevel( "porthos" ) == "louvrehouse" ) ) then
		clearGoals( "porthos" ) ;
		placeCharacterInDoor( "porthos", "louvrein", false ) ;
		addGoalGetToPointInLevel( "porthos", -105, -101, "louvrehouse", false, true ) ;
		wait( 1 ) ;
	end
	
	if ( not ( getCharacterFunctionalLevel( "aramis" ) == "louvrehouse" ) ) then
		clearGoals( "aramis" ) ;
		placeCharacterInDoor( "aramis", "louvrein", false ) ;
		addGoalGetToPointInLevel( "aramis", -25, -101, "louvrehouse", false, true ) ;
		wait( 1 ) ;
	end

	waitForNoGoal( "dartagnan" ) ;
	
	local bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	-- activate tutorial (if in demo)
	setBoolean( "metlouisactivated", true ) ;
		
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp13d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp13d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "louisxiii", "tremouille" ) ;
	bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "tremouille", true, -1, -1, true, getString( "mp13d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "tremouille", true, -1, -1, true, getString( "mp13d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d9" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	
	setMissionFaceCharacter( name, "louisxiii", "treville" ) ;
	bubInd = characterSay( "treville", true, -1, -1, true, getString( "mp13d10" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	-- king walks forward a bit
	setMissionFaceDirection( name, "louisxiii", 0, 1 ) ;
	placeCharacter( "louisxiii", "louvrehouse", -80, -227 ) ;
	addGoalGetToPointInLevel( "louisxiii", -80, -190, "louvrehouse", false, true ) ;
	bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d11" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d12" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	-- talk to dartagnan
	waitForNoGoal( "louisxiii" ) ;
	addGoalGetToPointInLevel( "louisxiii", -70, -180, "louvrehouse", false, true ) ;
	setMissionFaceCharacter( name, "louisxiii", "dartagnan" ) ;
	waitForNoGoal( "louisxiii" ) ;
	bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d13" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	-- dart responds
	addGoalGetToPointInLevel( "dartagnan", -65, -120, "louvrehouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mp13d14" ), getString( "mp13d15" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 0 ) then
		bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d16" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	else
		bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d17" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	end
	setMissionFaceCharacter( name, "louisxiii", "athos" ) ;
	bubInd = characterSay( "athos", true, -1, -1, true, getString( "mp13d18" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "louisxiii", "dartagnan" ) ;
	bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d19" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	-- gives dart money here
	playSound( "dropmoney", 0.5 ) ;
	setInventoryItem( "king_reward_money_pouch", 1 ) ;
	
	setMissionFaceCharacter( name, "louisxiii", "treville" ) ;
	bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d20" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d21" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	-- walk to out of screen
	addGoalGetToPointInLevel( "louisxiii", -839, 124, "louvrehouse2", false, true ) ;

	-- walk to front of louvre
	addGoalGetToPointInLevel( "treville", 611, 371, "france", false, true ) ;
	addGoalGetToPointInLevel( "tremouille", -79, 204, "france", false, true ) ;
	
	-- follow king
	wait( 0.5 ) ;
	addGoalGetToPointInLevel( "musketeer31", -839, 124, "louvrehouse2", false, true ) ;
	wait( 3.5 ) ;
	addGoalGetToPointInLevel( "musketeer30", -839, 124, "louvrehouse2", false, true ) ;
	
	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp13d22" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	setMissionFaceNone( name, "dartagnan" ) ;	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;

	unlockPlayerInPlace( ) ;

	local doorLockA = addDoorLock( name, "missionparis13LockOut", true, "louvrein" ) ;
	local triggerAreaA = addTriggerArea( name, "missionparis13LockOut", true, "louvrehouse", 
		{ -440, -366, -325, 231 }, { 162, -381, 322, 186 } ) ;
	
	
	local marker1 = addMarkerCharacter( name, true, getString( "mp13m2" ), "athos" ) ;
	local marker2 = addMarkerCharacter( name, true, getString( "mp13m2" ), "porthos" ) ;
	local marker3 = addMarkerCharacter( name, true, getString( "mp13m2" ), "aramis" ) ;
	
	local sharedMoney = false ;
	while ( not sharedMoney ) do
		waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
		
		lockPlayerInPlace( ) ;
		bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mp13d24" ), getString( "mp13d25" ) ) ;
		local option = waitForBubbleOption( bubInd ) ;
		if ( option == 0 ) then
			playSound( "dropmoney", 0.5 ) ;
			setInventoryItem( "king_reward_money_pouch", 0 ) ;
		
			setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
			bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mp13d26" ) ) ;
			waitForBubbleClosed( bubInd ) ;
			sharedMoney = true ;
		else
			setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
			bubInd = characterSay( "porthos", true, -1, -1, true, getString( "mp13d27" ) ) ;
			waitForBubbleClosed( bubInd ) ;
		end
		unlockPlayerInPlace( ) ;
	end
	
	removeMarker( name, marker1 ) ;
	removeMarker( name, marker2 ) ;
	removeMarker( name, marker3 ) ;

	lockPlayerInPlace( ) ;

	while ( isCharacterOnScreen( "louisxiii" )
		or  isCharacterOnScreen( "treville" )
		or  isCharacterOnScreen( "tremouille" ) ) do
		coroutine.yield( ) ;
	end

	-- fade to black
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "louisxiii" ) ;
	clearGoals( "musketeer30" ) ;
	clearGoals( "musketeer31" ) ;
	clearGoals( "tremouille" ) ;
	
	place_tremouilleA( "tremouille" ) ;
	place_athosA( "athos" ) ;
	place_porthosA( "porthos" ) ;
	place_aramisA( "aramis" ) ;
	
	placeCharacter( "louisxiii", "cardinalhouse", -66, -926 ) ;
	placeCharacter( "musketeer30", "cardinalhouse", -246, -950 ) ;
	placeCharacter( "musketeer31", "cardinalhouse", -246, -920 ) ;
	placeCharacter( "rochefort", "cardinalhouse", 224, -697 ) ;

	setMissionFaceDirection( name, "musketeer30", 1, 0 ) ;
	setMissionFaceDirection( name, "musketeer31", 1, 0 ) ;
	setMissionFaceCharacter( name, "louisxiii", "cardinal" ) ;
	setMissionFaceCharacter( name, "cardinal", "louisxiii" ) ;
	setMissionFaceCharacter( name, "rochefort", "cardinal" ) ;
	
	-- put rochefort, innkeeper and camera inside
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "cardinalhouse" ) ;
	setCameraTo( -77, -923 ) ;
	
	wait( 1 ) ; -- leave black for a second
	
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	-- scene with cardinal
	local bubInd = characterSay( "cardinal", true, -1, -1, true, getString( "mp13d28" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d29" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "cardinal", true, -1, -1, true, getString( "mp13d29_5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "louisxiii", true, -1, -1, true, getString( "mp13d30" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "cardinal", true, -1, -1, true, getString( "mp13d31" ) ) ;
	waitForBubbleClosed( bubInd ) ;
		
	addGoalGetToPointInLevel( "louisxiii", -715, -769, "cardinalhouse", false, true ) ;
	wait( 4 ) ;
	addGoalGetToPointInLevel( "musketeer30", -715, -769, "cardinalhouse", false, true ) ;
	addGoalGetToPointInLevel( "musketeer31", -715, -769, "cardinalhouse", false, true ) ;
	wait( 3 ) ;
	setMissionFaceCharacter( name, "cardinal", "rochefort" ) ;
	addGoalGetToPointInLevel( "rochefort", 82, -931, "cardinalhouse", false, true ) ;
	wait( 1 ) ;
	waitForNoGoal( "rochefort" ) ;
	
	bubInd = characterSay( "rochefort", true, -1, -1, true, getString( "mp13d32" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "cardinal", true, -1, -1, true, getString( "mp13d33" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "rochefort", true, -1, -1, true, getString( "mp13d34" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "cardinal", true, -1, -1, true, getString( "mp13d35" ) ) ;
	waitForBubbleClosed( bubInd ) ;
		
	-- fade back to black (to d'artagnan)
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	clearGoals( "louisxiii" ) ;
	clearGoals( "musketeer30" ) ;
	clearGoals( "musketeer31" ) ;
	clearGoals( "treville" ) ;
	place_louisxiiiA( "louisxiii" ) ;
	place_musketeer30( "musketeer30" ) ;
	place_musketeer31( "musketeer31" ) ;
	place_rochefortA( "rochefort" ) ;
	setCameraFollowCharacter( "dartagnan", false ) ;
	
	-- put dart in front of louvre
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	placeCharacter( "dartagnan", "france",  -76, 212 ) ;
	
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- unlock			
	removeDoorLock( doorLockA ) ;
	removeTriggerArea( triggerAreaA ) ;
	
	unlockPlayerInPlace( ) ;
	
	addMoney( 100 ) ;
	
	setCharacterOverrideName( "rochefort", false, getString( "unknownname" ) ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionparis14" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionparis13LockOut( )
	lockPlayerInPlace( ) ;

	local centerX = -80 ;
	local centerY = -44 ;

	local playerX, playerY = getCharacterPos( "dartagnan" ) ;

	local diffX = centerX - playerX ;
	local diffY = centerY - playerY ;	
	
	-- normalize
	local hyp = math.sqrt( diffX * diffX + diffY * diffY ) ;
	local directionX = diffX / hyp ;
	local directionY = diffY / hyp ;
	
	local distanceMoveInward = 50.0 ;
	local offsetX = directionX * distanceMoveInward ;
	local offsetY = directionY * distanceMoveInward ;
	
	local newPlayerX = playerX + offsetX ;
	local newPlayerY = playerY + offsetY ;
	
	--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "mp13d23" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp13d23" ) ) ;

	addGoalGetToPointInLevel( "dartagnan", newPlayerX, newPlayerY, "louvrehouse", false ) ;
	waitForNoGoal( "dartagnan" ) ;

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function execute_missionparis14( name )
	-- Talk to Musketeers and get Planchet
	DEBUG_OUTPUT( name .. " started" ) ;
	
	sitCharacter( "athos", "pommechair1" ) ;
	sitCharacter( "aramis", "pommechair2" ) ;
	sitCharacter( "porthos", "pommechair4" ) ;
	
	placeCharacter( "planchet", "pommedepinhouse", -37, -14 ) ;
	setMissionFaceDirection( name, "planchet", 0, 1 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mp14m1" ), "athos" ) ;
	waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
		
	removeMarker( name, marker ) ;	

	addGoalSitInChair( "dartagnan", "pommechair3", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	sayAndWait( "porthos", getString( "mp14d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mp14d2" ) ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	sayAndWait( "athos", getString( "mp14d3" ) ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	sayAndWait( "porthos", getString( "mp14d4" ) ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	sayAndWait( "aramis", getString( "mp14d5" ) ) ;
	
	local bubInd = characterSay( "dartagnan", false, -1, -1, true, 
		getString( "mp14d6" ), getString( "mp14d7" ), getString( "mp14d8" ), getString( "mp14d9" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 0 ) then
		sayAndWait( "porthos", getString( "mp14d10" ) ) ;
	elseif ( option == 1 ) then
		sayAndWait( "porthos", getString( "mp14d11" ) ) ;
	else
		sayAndWait( "porthos", getString( "mp14d12" ) ) ;
	end			
	sayAndWait( "porthos", getString( "mp14d13" ) ) ;

	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;
	addGoalGetToPointInLevel( "planchet", 83, 37, "pommedepinhouse", false ) ;
	waitForNoGoal( "planchet" ) ;

	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	setMissionFaceCharacter( name, "planchet", "porthos" ) ;
	sayAndWait( "porthos", getString( "mp14d14" ) ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;
	sayAndWait( "dartagnan", getString( "mp14d15" ) ) ;

	-- fade to black
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	place_planchetA( "planchet" ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
		
	playSound( "eating", 1.0 ) ;
				
	wait( 2 ) ;
		
	-- fade from black
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	sayAndWait( "aramis", getString( "mp14d16" ) ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	sayAndWait( "athos", getString( "mp14d17" ) ) ;
	sayAndWait( "dartagnan", getString( "mp14d18" ) ) ;

	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "planchet", false ) ;

	lockPlayerInPlace( ) ;
	setMissionFaceNone( name, "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", 35, 165, "pommedepinhouse", false, true ) ;
	addGoalGetToPointInLevel( "athos", getAthosAPosX( ), getAthosAPosY( ), getAthosALevel( ), false, true ) ;
	addGoalGetToPointInLevel( "porthos", getPorthosAPosX( ), getPorthosAPosY( ), getPorthosALevel( ), false, true ) ;
	addGoalGetToPointInLevel( "aramis", getAramisAPosX( ), getAramisAPosY( ), getAramisALevel( ), false, true ) ;
	
	waitForNoGoal( "dartagnan" ) ;
	unlockPlayerInPlace( ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis15" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis15( name )
	-- Join Monsieur d'Essart's guards
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "athos", getString( "mp14d19" ) ) ;
	setMissionChatString( name, "porthos", getString( "mp14d19" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp14d19" ) ) ;
		
	unequipItem( "tabbard_guard_1" ) ;
	setInventoryItem( "tabbard_guard_1", 0 ) ;	
	
	local marker = addMarkerCharacter( name, true, getString( "mp15m1" ), "essart" ) ;
	waitForTalk( "dartagnan", "essart", false ) ;
	removeMarker( name, marker ) ;	
	
	setMissionFreezeGame( name, true ) ;
	sayAndWait( "essart", getString( "mp15d1" ) ) ;
	sayAndWait( "essart", getString( "mp15d2" ) ) ;
	
	setInventoryItem( "tabbard_guard_1", 1 ) ;
	equipItem( "tabbard_guard_1" ) ;
		
	sayAndWait( "essart", getString( "mp15d3" ) ) ;
	setMissionFreezeGame( name, false ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis16" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis16( name )
	-- Aquire a ranged weapon
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "essart", getString( "mp16d2" ) ) ;

	setBoolean( "gunsAvailable", true ) ;

	local marker = addMarkerCharacter( name, true, getString( "mp16m1" ), "weapondealer1" ) ;

	while ( not hasRangedWeapon( ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	completeMission( name ) ;
	activateMission( "missionparis17" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis17( name )
	-- go back and get mission from d'Essart
	DEBUG_OUTPUT( name .. " started" ) ;
	
	forceKeepRangedWeapon( true ) ;
	ensureRangedIsEquipped( ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "reportessart" ), "essart" ) ;
	waitForTalk( "dartagnan", "essart", false ) ;
	removeMarker( name, marker ) ;	
	
	setMissionFreezeGame( name, true ) ;
	sayAndWait( "essart", getString( "mp17d1" ) ) ;
	setMissionFreezeGame( name, false ) ;
		
	completeMission( name ) ;
	activateMission( "missionparis18" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis18( name )
	-- do firearm tutorial
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "essart", getString( "mp17d2" ) ) ;
	
	forceKeepRangedWeapon( true ) ;
	ensureRangedIsEquipped( ) ;
	
	local overrideSaveID = createOverrideSavePos( "france", 947, 880 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -57, -686, 1957, 950 } ) ;

	local markerPosX = 950 ;
	local markerPosY = 435 ;
	local marker = addMarkerPosition( name, true, getString( "guardpontneuf" ), "france", markerPosX, markerPosY ) ;

	-- place enemy and lady
	local enemyStartX = 1188 ;
	local enemyStartY = 420 ;
	local enemy1 = createTempCharacter( getString( "kidnaper" ), "france", enemyStartX, enemyStartY ) ;
	setStatsCalculatorStatic( enemy1, 10, 10, 10, 10 ) ;
	randomDressEnemy( enemy1, 0.0, 146421 ) ;
	setMeleeWeapon( enemy1, "sword_1" ) ;

	local ladyStartX = enemyStartX + 40 ;
	local ladyStartY = enemyStartY ;
	local lady1 = createTempCharacter( getString( "distressedwoman" ), "france", ladyStartX, ladyStartY ) ;
	dress_missionparis18lady( lady1 ) ;
	--dress_lady1A( lady1 ) ;

	setMissionFaceCharacter( name, enemy1, lady1 ) ;
	setMissionFaceCharacter( name, lady1, enemy1 ) ;
	
	-- wait until close to distressed woman
	local triggerArea = addTriggerArea( name, "", false, "france", { 853, 269, 1338, 602 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;
	
	-- wait close to point
	--local dist = 250 ;
	--while ( distanceToPoint( "dartagnan", "france", markerPosX, markerPosY ) > dist ) do
	--	coroutine.yield( ) ;
	--end
	
	removeMarker( name, marker ) ;
	
	-- move D'Artagnan to point
	lockPlayerInPlace( ) ;
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", markerPosX, markerPosY, "france", false ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	faceCharacter( "dartagnan", lady1 ) ;

	sayAndWait( lady1, getString( "mp18d1" ) ) ;

	unlockPlayerInPlace( ) ;
	
	makeEnemies( "dartagnan", enemy1 ) ;
	addWatchCharacterUnlimited( enemy1 ) ;
	setIgnoreAll( enemy1, true ) ; -- enemy won't come at us
	
	local marker = addMarkerCharacter( name, true, getString( "mp18m2" ), enemy1 ) ;

	gTutAttackEnemyName = enemy1 ;	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "firearm", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	lockPlayerInPlace( ) ;
	while ( isRangedLoaded( ) ) do
		coroutine.yield( ) ;
	end
	unlockPlayerInPlace( ) ;
	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "reloadfirearm", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	DEBUG_OUTPUT( "setIgnoreAll" ) ;
	setIgnoreAll( enemy1, false ) ;
	
	while ( isCharacterAlive( enemy1 ) ) do
		coroutine.yield( ) ;
	end	
		
	removeMarker( name, marker ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mp18m3" ), lady1 ) ;
	
	waitForTalk( "dartagnan", lady1, false ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( lady1, true ) ;
	sayAndWait( lady1, getString( "mp18d2" ) ) ;
	
	local x, y = getCharacterPos( lady1 ) ;
	createMoney( "", 20, "france", x, y, true ) ;
	
	removeMarker( name, marker ) ;
	
	addGoalGetToPointInLevel( lady1, 1213, -757, "france", false, true ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp18d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( lady1, false ) ;

	--while ( isCharacterOnScreen( lady1 ) ) do
	--	coroutine.yield( ) ;
	--end

	--setMissionFreezeGame( name, false ) ;
	--setIgnoreFreeze( lady1, false ) ;
	
	--deleteTempCharacter( lady1 ) ;
	
	autoDeleteCharacterOffScreen( lady1 ) ;
	--gMissionParis18Lady1 = lady1 ;
	--activateScriptMessage( "deletegMissionParis18Lady1" ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
			
	completeMission( name ) ;
	activateMission( "missionparis19" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis19( name )
	-- meet planchet in house, then bonacieux, chase Man from Meung
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "essart", getString( "mp17d3" ) ) ;
		
	placeDead( "bonacieux" ) ; -- don't want bonacieux downstairs because if he was he would have talked to you already

	forceKeepRangedWeapon( false ) ;

	setCharacterOverrideName( "rochefort", true, getString( "rochefortunknown" ) ) ;

	local marker = addMarkerCharacter( name, true, getString( "checkplanchet" ), "planchet" ) ;

	waitForTalk( "dartagnan", "planchet", false ) ;
	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	sayAndWait( "dartagnan", getString( "mp19d1" ) ) ;
	sayAndWait( "planchet", getString( "mp19d2" ) ) ;
	
	placeCharacterInDoor( "bonacieux", "bonacieuxstairsup", false ) ;
	addGoalGetToPointInLevel( "bonacieux", -122, -19, "bonacieuxhouse2", false, true ) ;
	
	setMissionFaceCharacter( name, "bonacieux", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "bonacieux" ) ;
	waitForNoGoal( "bonacieux" ) ;

	sayAndWait( "bonacieux", getString( "mp19d3" ) ) ;
	sayAndWait( "dartagnan", getString( "mp19d4" ) ) ;
	sayAndWait( "bonacieux", getString( "mp19d5" ) ) ;
	sayAndWait( "dartagnan", getString( "mp19d6" ) ) ;
	sayAndWait( "bonacieux", getString( "mp19d7" ) ) ;
	sayAndWait( "dartagnan", getString( "mp19d8" ) ) ;
	sayAndWait( "bonacieux", getString( "mp19d9" ) ) ;
	sayAndWait( "bonacieux", getString( "mp19d10" ) ) ;
	sayAndWait( "dartagnan", getString( "mp19d11" ) ) ;
	sayAndWait( "bonacieux", getString( "mp19d12" ) ) ;
	sayAndWait( "dartagnan", getString( "mp19d13" ) ) ;
	sayAndWait( "bonacieux", getString( "mp19d14" ) ) ;
	sayAndWait( "dartagnan", getString( "mp19d15" ) ) ;
	sayAndWait( "bonacieux", getString( "mp19d16" ) ) ;
	sayAndWait( "dartagnan", getString( "mp19d17" ) ) ;
	sayAndWait( "bonacieux", getString( "mp19d18" ) ) ;
	
	local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mp19d19" ), getString( "mp19d20" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 0 ) then
		sayAndWait( "bonacieux", getString( "mp19d26" ) ) ;
	else
		sayAndWait( "bonacieux", getString( "mp19d21" ) ) ;
		sayAndWait( "bonacieux", getString( "mp19d22" ) ) ;
		sayAndWait( "bonacieux", getString( "mp19d23" ) ) ;
		sayAndWait( "bonacieux", getString( "mp19d24" ) ) ;
		sayAndWait( "bonacieux", getString( "mp19d25" ) ) ;
	end
	
	sayAndWait( "dartagnan", getString( "mp19d27" ) ) ;
	sayAndWait( "bonacieux", getString( "mp19d28" ) ) ;
	sayAndWait( "dartagnan", getString( "mp19d29" ) ) ;
	sayAndWait( "bonacieux", getString( "mp19d30" ) ) ;
	
	-- play music until looked around
	local tenseLocalMusicID1 = addLocalMusicInner( "extratense", "bonacieuxhouse2", -100000, -100000, 100000, 100000, 15 ) ;
	local tenseLocalMusicID2 = addLocalMusicInner( "extratense", "bonacieuxhouse", -100000, -100000, 100000, 100000, 15 ) ;
	local tenseLocalMusicID3 = addLocalMusicInner( "extratense", "france", 1562, 2610, 2406, 3002, 15 ) ;
	
	local tenseMusicID = addMusic( "extratense", 15 ) ; -- make sure outside music doesn't start playing
		
	-- look out window and see
	setMissionFaceDirection( name, "dartagnan", 1, 1 ) ;
	sayAndWait( "dartagnan", getString( "mp19d31" ) ) ;
	
	-- walk dartagnan to the window
	addGoalGetToPointInLevel( "dartagnan", -84, 102, "bonacieuxhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	-- dartagnan sees rochefort
	setMissionFaceDirection( name, "dartagnan", 1, 1 ) ;

	-- show Rochefort outside
	setMissionFaceDirection( name, "rochefort", 1, 1 ) ;
	placeCharacter( "rochefort", "france", 2099, 2822 ) ;
	
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	-- put rochefort outside
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "france" ) ;
	setCameraTo( 1760, 2577 ) ;

	-- fade from black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	local rochX, rochY = getCharacterPos( "rochefort" ) ;
	panCameraToWait( rochX, rochY, 400, true ) ;
	
	wait( 1 ) ;
	addGoalGetToPointInLevel( "rochefort", 2491, 2848, "france", false, true ) ;
	wait( 3 ) ;
		
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	clearGoals( "rochefort" ) ;
	place_rochefortA( "rochefort" ) ;
	setCameraFollowCharacter( "dartagnan", true ) ;
	
	-- fade from black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	removeMusic( tenseMusicID ) ;
		
	sayAndWait( "dartagnan", getString( "mp19d32" ) ) ;

	unlockPlayerInPlace( ) ;
	setMissionFaceNone( name, "dartagnan" ) ;
	
	placeCharacter( "athos", "france", 1760, 2770 ) ;
	placeCharacter( "porthos", "france", 1760, 2810 ) ;
	placeCharacter( "aramis", "france", 1760, 2850 ) ;
	addGoalGetToPointInLevel( "athos", 40, -16, "bonacieuxhouse2", false, true ) ;
	addGoalGetToPointInLevel( "porthos", 15, -36, "bonacieuxhouse2", false, true ) ;
	addGoalGetToPointInLevel( "aramis", 15, 4, "bonacieuxhouse2", false, true ) ;
	setMissionFaceDirection( name, "athos", -1, 0 ) ;
	setMissionFaceDirection( name, "porthos", 0, 1 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
	setMissionChatString( name, "bonacieux", getString( "mp19d35" ) ) ;
	setMissionChatString( name, "athos", getString( "mp19d34" ) ) ;
	setMissionChatString( name, "porthos", getString( "mp19d35" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp19d34" ) ) ;
	setMissionChatString( name, "planchet", getString( "mp19d36" ) ) ;
	
	local markerPosX = 2211 ;
	local markerPosY = 2859 ;
	local marker = addMarkerPosition( name, true, getString( "chaserochefort" ), "france", markerPosX, markerPosY ) ;
	
	while( not characterWithinOfPoint( "dartagnan", "france", markerPosX, markerPosY, 400.0 ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
		
	lockPlayerInPlace( ) ;
	addGoalGetToPointInLevel( "dartagnan", markerPosX, markerPosY, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	spinLook( "dartagnan" ) ;
	
	removeLocalMusic( "bonacieuxhouse2", tenseLocalMusicID1 ) ;
	removeLocalMusic( "bonacieuxhouse", tenseLocalMusicID2 ) ;
	removeLocalMusic( "france", tenseLocalMusicID3 ) ;
		
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp19d33" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	unlockPlayerInPlace( ) ;
	
	place_bonacieuxA( "bonacieux" ) ;
	
	setCharacterOverrideName( "rochefort", false, getString( "unknownname" ) ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis20" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis20( name )
	-- musketeers in darts room, bonacieux gets taken by guards
	DEBUG_OUTPUT( name .. " started" ) ;
	
	clearGoals( "athos" ) ;
	clearGoals( "porthos" ) ;
	clearGoals( "aramis" ) ;
	placeCharacter( "athos", "bonacieuxhouse2", 40, -16 ) ;
	placeCharacter( "porthos", "bonacieuxhouse2", 15, -36 ) ;
	placeCharacter( "aramis", "bonacieuxhouse2", 15, 4 ) ;
	setMissionFaceDirection( name, "athos", -1, 0 ) ;
	setMissionFaceDirection( name, "porthos", 0, 1 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
	
	setMissionChatString( name, "bonacieux", getString( "mp20d1" ) ) ;
	setMissionChatString( name, "planchet", getString( "mp20d24" ) ) ;
	
	local marker1 = addMarkerCharacter( name, true, getString( "speakmusk" ), "porthos" ) ;
	waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
	removeMarker( name, marker1 ) ;
		
	lockPlayerInPlace( ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp20d2" ) ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	setMissionFaceCharacter( name, "aramis", "porthos" ) ;
	sayAndWait( "porthos", getString( "mp20d3" ) ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp20d4" ) ) ;
	
	-- fade to black
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	wait( 1 ) ;
		
	-- fade from black
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setMissionFaceCharacter( name, "porthos", "athos" ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	setMissionFaceCharacter( name, "aramis", "athos" ) ;
	sayAndWait( "athos", getString( "mp20d5" ) ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp20d6" ) ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	setMissionFaceCharacter( name, "aramis", "porthos" ) ;
	sayAndWait( "porthos", getString( "mp20d7" ) ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp20d8" ) ) ;
	setMissionFaceCharacter( name, "athos", "aramis" ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	setMissionFaceCharacter( name, "porthos", "aramis" ) ;
	sayAndWait( "aramis", getString( "mp20d9" ) ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp20d10" ) ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "bonacieux" ) ;
	setMissionFaceCharacter( name, "athos", "bonacieux" ) ;
	setMissionFaceCharacter( name, "porthos", "bonacieux" ) ;
	setMissionFaceCharacter( name, "aramis", "bonacieux" ) ;
	setMissionFaceCharacter( name, "planchet", "bonacieux" ) ;
	
	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	placeCharacterInDoor( "bonacieux", "bonacieuxstairsup", false ) ;
	addGoalGetToPointInLevel( "bonacieux", -130, -40, "bonacieuxhouse2", false, true ) ;
	waitForNoGoal( "bonacieux" ) ;
	setMissionFaceCharacter( name, "bonacieux", "dartagnan" ) ;
	
	sayAndWait( "bonacieux", getString( "mp20d11" ) ) ;
	sayAndWait( "dartagnan", getString( "mp20d12" ) ) ;
	
	local cardGuard1 = createTempCharacter( getString( "cardinalsguard" ), "france", 910, 4039 ) ;
	randomDressCardinalsGuard( cardGuard1, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( cardGuard1, "sword_1" ) ;
	local cardGuard2 = createTempCharacter( getString( "cardinalsguard" ), "france", 950, 4039 ) ;
	randomDressCardinalsGuard( cardGuard2, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( cardGuard2, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard1, "bonacieux" ) ;
	setMissionFaceCharacter( name, cardGuard2, "bonacieux" ) ;
	placeCharacterInDoor( cardGuard1, "bonacieuxstairsup", false ) ;
	addGoalGetToPointInLevel( cardGuard1, -168, -15, "bonacieuxhouse2", false, true ) ;
	wait( 1 ) ;
	placeCharacterInDoor( cardGuard2, "bonacieuxstairsup", false ) ;
	addGoalGetToPointInLevel( cardGuard2, -175, -46, "bonacieuxhouse2", false, true ) ;
	
	waitForNoGoal( cardGuard1 ) ;
	waitForNoGoal( cardGuard2 ) ;
	
	sayAndWait( "dartagnan", getString( "mp20d13" ) ) ;
	sayAndWait( cardGuard1, getString( "mp20d14" ) ) ;
	
	addGoalGetToPointInLevel( "bonacieux", -125, -124, "bonacieuxhouse", false, true ) ;
	wait( 3 ) ;
	addGoalGetToPointInLevel( cardGuard1, -125, -124, "bonacieuxhouse", false, true ) ;
	addGoalGetToPointInLevel( cardGuard2, -125, -124, "bonacieuxhouse", false, true ) ;
	
	while ( isCharacterOnScreen( "bonacieux" )
		or  isCharacterOnScreen( cardGuard1 )
		or  isCharacterOnScreen( cardGuard2 ) ) do
		coroutine.yield( ) ;
	end
	
	deleteTempCharacter( cardGuard1 ) ;
	deleteTempCharacter( cardGuard2 ) ;
	clearGoals( "bonacieux" ) ;
	place_bonacieuxB( "bonacieux" ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;
	sayAndWait( "porthos", getString( "mp20d15" ) ) ;
	sayAndWait( "athos", getString( "mp20d16" ) ) ;
	sayAndWait( "aramis", getString( "mp20d17" ) ) ;

	removeMusic( tenseMusicID ) ;	
	local titleMusicID = addMusic( "title", 15 ) ;
	
	sayAndWait( "dartagnan", getString( "mp20d18" ) ) ;
	sayAndWait( "athos", getString( "mp20d19" ) ) ;
	sayAndWait( "aramis", getString( "mp20d20" ) ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	-- show comic
	local comic1 = createComic( "allforone1" ) ;

	addText( comic1, getString( "allforone1_d1" ), 31, 1, 767, 78 ) ;
	
	addMouseOver( comic1, getString( "aramis" ), 2, 249, 165, 596, 77, 256 ) ;
	addMouseOver( comic1, getString( "athos" ), 190, 274, 376, 592, 274, 278 ) ;
	addMouseOver( comic1, getString( "porthos" ), 610, 140, 797, 595, 744, 151 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 430, 301, 622, 594, 533, 305 ) ;
	
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	removeMusic( titleMusicID ) ;	
	
	sayAndWait( "athos", getString( "mp20d20_5" ) ) ;
		
	addGoalGetToPointInLevel( "athos", getAthosAPosX( ), getAthosAPosY( ), getAthosALevel( ), false, true ) ;
	addGoalGetToPointInLevel( "porthos", getPorthosAPosX( ), getPorthosAPosY( ), getPorthosALevel( ), false, true ) ;
	addGoalGetToPointInLevel( "aramis", getAramisAPosX( ), getAramisAPosY( ), getAramisALevel( ), false, true ) ;
	
	unlockPlayerInPlace( ) ;
			
	completeMission( name ) ;
	activateMission( "missionparis21" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis21( name )
	-- dart goes to sleep, mousetrap with constance happens
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "athos", getString( "mp20d21" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp20d22" ) ) ;
	setMissionChatString( name, "porthos", getString( "mp20d23" ) ) ;

	local marker = addMarkerCharacter( name, true, getString( "sleep" ), "planchet" ) ;

	waitForTalk( "dartagnan", "planchet", false ) ;
	removeMarker( name, marker ) ;
	
	clearGoals( "athos" ) ;
	clearGoals( "porthos" ) ;
	clearGoals( "aramis" ) ;
	place_athosA( "athos" ) ;
	place_porthosA( "porthos" ) ;
	place_aramisA( "aramis" ) ;

	lockPlayerInPlace( ) ;
	sayAndWait( "dartagnan", getString( "mp21d1" ) ) ;
	sayAndWait( "planchet", getString( "mp21d2" ) ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, -1 ) ;
	-- walk to bed
	addGoalGetToPointInLevel( "dartagnan", -58, 60, "bonacieuxhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	-- fade to black
	local fadeTime = 1.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	playSound( "snoring", 1.0 ) ;
	wait( 2.1 ) ;
	playSound( "snoring", 1.0 ) ;
	
	placeCharacter( "planchet", "bonacieuxhouse2", -86, 67 ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;
	
	wait( 2 ) ;
	
	local bubInd = characterSay( "planchet", true, -1, -1, true, getString( "mp21d3" ) ) ;
		
	-- fade from black
	local fadeTime = 1.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	waitForBubbleClosed( bubInd ) ;
	sayAndWait( "dartagnan", getString( "mp21d4" ) ) ;

	addGoalGetToPointInLevel( "dartagnan", -151, -5, "bonacieuxhouse2", false, true ) ;
	addGoalGetToPointInLevel( "planchet", -151, -42, "bonacieuxhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	waitForNoGoal( "planchet" ) ;
	
	--scene downstairs with baguette man
	
	setToggleVisElsVisible( "floorboard", true ) ;
	playSound( "floorboard", 1.0 ) ;
	wait( 1 ) ;
		
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	local cardGuard1 = createTempCharacter( getString( "cardinalsguard" ), "bonacieuxhouse", -70, -40 ) ;
	randomDressCardinalsGuard( cardGuard1, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard1, 10, 10, 10, 10 ) ;
	setMeleeWeapon( cardGuard1, "sword_1" ) ;
	local cardGuard2 = createTempCharacter( getString( "cardinalsguard" ), "bonacieuxhouse", -30, -45 ) ;
	randomDressCardinalsGuard( cardGuard2, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard2, 10, 10, 10, 10 ) ;
	setMeleeWeapon( cardGuard2, "sword_1" ) ;
	local cardGuard3 = createTempCharacter( getString( "cardinalsguard" ), "bonacieuxhouse", 10, -43 ) ;
	randomDressCardinalsGuard( cardGuard3, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard3, 10, 10, 10, 10 ) ;
	setMeleeWeapon( cardGuard3, "sword_1" ) ;
	local cardGuard4 = createTempCharacter( getString( "cardinalsguard" ), "bonacieuxhouse", 9, 105 ) ;
	randomDressCardinalsGuard( cardGuard4, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard4, 10, 10, 10, 10 ) ;
	setMeleeWeapon( cardGuard4, "sword_1" ) ;
	local cardGuard5 = createTempCharacter( getString( "cardinalsguard" ), "bonacieuxhouse", -20, 105 ) ;
	randomDressCardinalsGuard( cardGuard5, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard5, 10, 10, 10, 10 ) ;
	setMeleeWeapon( cardGuard5, "sword_1" ) ;
	
	setMissionFaceDirection( name, cardGuard1, 0, 1 ) ;
	setMissionFaceDirection( name, cardGuard2, 0, 1 ) ;
	setMissionFaceDirection( name, cardGuard3, 0, 1 ) ;
	setMissionFaceDirection( name, cardGuard4, -1, 0 ) ;
	setMissionFaceDirection( name, cardGuard5, -1, 0 ) ;
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "bonacieuxhouse" ) ;
	setCameraTo( -56, -23 ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	placeCharacterInDoor( "baguette", "bonacieuxhousein", false ) ;
	addGoalGetToPointInLevel( "baguette", -48, 34, "bonacieuxhouse", false, true ) ;
	setMissionFaceDirection( name, "baguette", 0, -1 ) ;
	setMissionFaceCharacter( name, cardGuard1, "baguette" ) ;
	setMissionFaceCharacter( name, cardGuard2, "baguette" ) ;
	setMissionFaceCharacter( name, cardGuard3, "baguette" ) ;
	setMissionFaceCharacter( name, cardGuard4, "baguette" ) ;
	setMissionFaceCharacter( name, cardGuard5, "baguette" ) ;
	waitForNoGoal( "baguette" ) ;

	-- guard blocks the exit
	addGoalGetToPointInLevel( cardGuard5, -58, 94, "bonacieuxhouse", false, true ) ;
	waitForNoGoal( cardGuard5 ) ;

	sayAndWait( cardGuard1, getString( "mp21d11" ) ) ;
	sayAndWait( "baguette", getString( "mp21d12" ) ) ;
	sayAndWait( cardGuard1, getString( "mp21d13" ) ) ;
	sayAndWait( "baguette", getString( "mp21d14" ) ) ;
	
	addGoalGetToPointInLevel( cardGuard5, 0, 47, "bonacieuxhouse", false, true ) ;
	sayAndWait( cardGuard5, getString( "mp21d15" ) ) ;
	waitForNoGoal( cardGuard5 ) ;
	
	addGoalGetToPointInLevel( "baguette", 1760, 2777, "france", false, true ) ;
	wait( 1 ) ;
	addGoalGetToPointInLevel( cardGuard5, 1760, 2777, "france", false, true ) ;

	while ( isCharacterOnScreen( "baguette" )
		or  isCharacterOnScreen( cardGuard5 ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "baguette" ) ;
	clearGoals( cardGuard5 ) ;
	place_baguetteA( "baguette" ) ;
	deleteTempCharacter( cardGuard5 ) ;

	wait( 1 ) ;
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	setCameraFollowCharacter( "dartagnan", true ) ;
		
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- dart and planchet comment on baguette man being taken
	sayAndWait( "dartagnan", getString( "mp21d16" ) ) ;
	sayAndWait( "planchet", getString( "mp21d17" ) ) ;
	sayAndWait( "dartagnan", getString( "mp21d18" ) ) ;
	
	-- fade to black
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setMissionFaceDirection( name, cardGuard1, 0, 1 ) ;
	setMissionFaceDirection( name, cardGuard2, 0, 1 ) ;
	setMissionFaceDirection( name, cardGuard3, 0, 1 ) ;
	setMissionFaceDirection( name, cardGuard4, -1, 0 ) ;

	stopCameraFollowCharacter( ) ;
	setActiveLevel( "bonacieuxhouse" ) ;
	setCameraTo( -56, -23 ) ;
	
	wait( 2 ) ;
	
	-- play music until fight
	local tenseLocalMusicID1 = addLocalMusicInner( "intense", "bonacieuxhouse2", -100000, -100000, 100000, 100000, 15 ) ;
	local tenseLocalMusicID2 = addLocalMusicInner( "intense", "bonacieuxhouse", -100000, -100000, 100000, 100000, 15 ) ;
	
	-- fade from black
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- bonacieux enters and gets captured

	placeCharacterInDoor( "constance", "bonacieuxhousein", false ) ;
	addGoalGetToPointInLevel( "constance", -48, 34, "bonacieuxhouse", false, true ) ;
	setMissionFaceDirection( name, "constance", 0, -1 ) ;
	setMissionFaceCharacter( name, cardGuard1, "constance" ) ;
	setMissionFaceCharacter( name, cardGuard2, "constance" ) ;
	setMissionFaceCharacter( name, cardGuard3, "constance" ) ;
	setMissionFaceCharacter( name, cardGuard4, "constance" ) ;
	waitForNoGoal( "constance" ) ;
	
	-- guard blocks the exit
	addGoalGetToPointInLevel( cardGuard4, -58, 94, "bonacieuxhouse", false, true ) ;
	waitForNoGoal( cardGuard4 ) ;

	sayAndWait( "constance", getString( "mp21d19" ) ) ;
	sayAndWait( cardGuard1, getString( "mp21d20" ) ) ;
	sayAndWait( "constance", getString( "mp21d21" ) ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	setCameraFollowCharacter( "dartagnan", true ) ;
		
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	sayAndWait( "dartagnan", getString( "mp21d22" ) ) ;
		
	setMissionFaceNone( name, "dartagnan" ) ;
	
	unlockPlayerInPlace( ) ;
	
	setToggleVisElsVisible( "floorboard", false ) ;
	playSound( "floorboard", 1.0 ) ;
	
	setMissionChatString( name, "planchet", getString( "mp21d24" ) ) ;
	setMissionChatString( name, "constance", getString( "mp21d25" ) ) ;
		
	local markerGuard1 = addMarkerCharacter( name, true, getString( "fightmarker" ), cardGuard1 ) ;
	local markerGuard2 = addMarkerCharacter( name, true, getString( "fightmarker" ), cardGuard2 ) ;
	local markerGuard3 = addMarkerCharacter( name, true, getString( "fightmarker" ), cardGuard3 ) ;
	local markerGuard4 = addMarkerCharacter( name, true, getString( "fightmarker" ), cardGuard4 ) ;
		
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "bonacieuxhouse" ) ) do
		coroutine.yield( ) ;
	end
	
	lockPlayerInPlace( ) ;
	setMissionFaceCharacter( name, "dartagnan", "constance" ) ;
	setMissionFaceCharacter( name, "constance", "dartagnan" ) ;
	setMissionFaceCharacter( name, cardGuard1, "dartagnan" ) ;
	setMissionFaceCharacter( name, cardGuard2, "dartagnan" ) ;
	setMissionFaceCharacter( name, cardGuard3, "dartagnan" ) ;
	setMissionFaceCharacter( name, cardGuard4, "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -79, -107, "bonacieuxhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	sayAndWait( "dartagnan", getString( "mp21d23" ) ) ;

	unlockPlayerInPlace( ) ;

	-- constance hides
	setMissionFaceDirection( name, "constance", -1, 0 ) ;
	addGoalGetToPointInLevel( "constance", -154, 44, "bonacieuxhouse", false, true ) ;
	
	-- lock door
	local doorLockA = addDoorLock( name, "", true, "bonacieuxhousein" ) ;

	removeLocalMusic( "bonacieuxhouse2", tenseLocalMusicID1 ) ;
	removeLocalMusic( "bonacieuxhouse", tenseLocalMusicID2 ) ;

	makeEnemies( "dartagnan", cardGuard1, cardGuard2, cardGuard3, cardGuard4 ) ;

	waitUntilDead( cardGuard1 ) ;
	waitUntilDead( cardGuard2 ) ;
	waitUntilDead( cardGuard3 ) ;
	waitUntilDead( cardGuard4 ) ;
	
	removeMarker( name, markerGuard1 ) ;
	removeMarker( name, markerGuard2 ) ;
	removeMarker( name, markerGuard3 ) ;
	removeMarker( name, markerGuard4 ) ;
		
	removeDoorLock( doorLockA ) ;
	
	-- three musketeers dissappear
	clearGoals( "athos" ) ;
	clearGoals( "porthos" ) ;
	clearGoals( "aramis" ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis22" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis22( name )
	-- after killing guards, talk to constance, escort to Athos' house
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "planchet", getString( "mp21d26" ) ) ;

	setMissionFaceDirection( name, "constance", -1, 0 ) ;
	ensureCharacterInLevel( "constance", "bonacieuxhouse", -154, 44 ) ;

	local marker = addMarkerCharacter( name, true, getString( "speakconstance" ), "constance" ) ;
	waitForTalk( "dartagnan", "constance", false ) ;
	setMissionFaceCharacter( name, "constance", "dartagnan" ) ;

	local loveLocalMusicID1 = addLocalMusicInner( "love", "bonacieuxhouse", -100000, -100000, 100000, 100000, 15 ) ;
	
	local overrideSaveID = createOverrideSavePos( "bonacieuxhouse", 20, 26 ) ;
	setOverrideSaveLevel( overrideSaveID, "bonacieuxhouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "athoshouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "athoshouse2" ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 1602, 2559, 2181, 2704, 1475, 3421, 922, 3110 } ) ;

	lockPlayerInPlace( ) ;
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "constance", getString( "mp22d1" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
	local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mp22d2" ), getString( "mp22d3" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	sayAndWait( "constance", getString( "mp22d4" ) ) ;
	sayAndWait( "dartagnan", getString( "mp22d5" ) ) ;
	sayAndWait( "constance", getString( "mp22d6" ) ) ;
	sayAndWait( "dartagnan", getString( "mp22d7" ) ) ;
	sayAndWait( "constance", getString( "mp22d8" ) ) ;
	sayAndWait( "dartagnan", getString( "mp22d9" ) ) ;
	sayAndWait( "dartagnan", getString( "mp22d9_5" ) ) ;
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "constance", getString( "mp22d10" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
	unlockPlayerInPlace( ) ;
	
	addTimedHeartMaker( "dartagnan", 7.0 ) ;
	
	setMissionChatString( name, "constance", getString( "mp22d17" ) ) ;
	
	removeMarker( name, marker ) ;
	local marker = addMarkerCharacter( name, true, getString( "escortconstance" ), "constance" ) ;

	local constanceLevel = "athoshouse2" ;
	local constanceDestX = 125 ;
	local constanceDestY = -127 ;
	
	local constanceID = addWatchCharacterUnlimited( "constance" ) ;
	addGoalGetToPointInLevel( "constance", constanceDestX, constanceDestY, constanceLevel, false, true ) ;
	
	local allowOffscreenTime = 10.0 ;
	local offscreenTime = 0.0 ;
	local walkWithoutDartTime = 2.0 ;
	local withoutDartTime = 0.0 ;
	while ( distanceToPoint( "constance", constanceLevel, constanceDestX, constanceDestY ) > 20 ) do
		if ( not isCharacterOnScreen( "constance" ) ) then
			offscreenTime = offscreenTime + getDeltaT( ) ;
		else
			-- reset
			offscreenTime = 0.0 ;
		end
		
		local pauseDist = 250 ;
		if ( distanceBetweenCharacters( "dartagnan", "constance" ) > pauseDist ) then
			withoutDartTime = withoutDartTime + getDeltaT( ) ;
		else
			withoutDartTime = 0.0 ;
		end
		
		-- pause constance when dartagnan gets too far away
		if ( withoutDartTime > walkWithoutDartTime ) then
			clearGoals( "constance" ) ;
			setStateMessageIdle( "constance" ) ;
		else
			if ( not characterHasGoal( "constance" ) ) then
				addGoalGetToPointInLevel( "constance", constanceDestX, constanceDestY, constanceLevel, false, true ) ;
			end
		end
		
		if ( offscreenTime >= allowOffscreenTime ) then
			failGame( getString( "mp22d11" ) ) ;
			
			while ( true ) do
				coroutine.yield( ) ;
			end
		end

		coroutine.yield( ) ;
	end
	
	waitForNoGoal( "constance" ) ;
	
	removeWatchCharacter( "constance", constanceID ) ;

	waitForTalk( "dartagnan", "constance", false ) ;
	
	lockPlayerInPlace( ) ;
	sayAndWait( "dartagnan", getString( "mp22d12" ) ) ;
	sayAndWait( "constance", getString( "mp22d13" ) ) ;
	sayAndWait( "constance", getString( "mp22d14" ) ) ;
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp22d15" ) ) ;
	sayAndWait( "constance", getString( "mp22d16" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
	unlockPlayerInPlace( ) ;
	
	removeMarker( name, marker ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
		
	removeLocalMusic( "bonacieuxhouse", loveLocalMusicID1 ) ;
				
	completeMission( name ) ;
	activateMission( "missionparis23" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis23( name )
	-- Go to Louvre with password, talk to Laporte
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "planchet", getString( "mp21d27" ) ) ;

	setMissionChatFunction( name, "constance", "chat_hearts_mp23d16" ) ;

	setMissionFaceCharacter( name, "constance", "dartagnan" ) ;
	ensureCharacterInLevel( "constance", "athoshouse2", 125, -127 ) ;
	
	local doorLockA = addDoorLock( name, "", true, "louvreout", "louvreout2" ) ;

	local marker = addMarkerCharacter( name, true, getString( "mp23m1" ), "germain" ) ;
	local passwordCorrect = false ;
	while ( not passwordCorrect ) do
		waitForTalk( "dartagnan", "germain", false ) ;

		setMissionFreezeGame( name, true ) ;
		setIgnoreFreeze( "germain", true ) ;
		setIgnoreFreeze( "laporte", true ) ;
		setMissionFaceCharacter( name, "germain", "dartagnan" ) ;
		local bubInd1 = characterSay( "dartagnan", false, -1, -1, true, getString( "mp23d1" ), 
			getString( "mp23d2" ), getString( "mp23d3" ), getString( "mp23d4" ), getString( "mp23d5" ) ) ;
		local option1 = waitForBubbleOption( bubInd1 ) ;
		local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, getString( "mp23d6" ), 
			getString( "mp23d7" ), getString( "mp23d8" ), getString( "mp23d9" ), getString( "mp23d4" ) ) ;
		local option2 = waitForBubbleOption( bubInd2 ) ;
		if ( option1 == 1 and option2 == 3 ) then
			passwordCorrect = true ;
			sayAndWait( "germain", getString( "mp23d11" ) ) ;
		else
			sayAndWait( "germain", getString( "mp23d10" ) ) ;
		end
		setMissionFreezeGame( name, false ) ;
		setIgnoreFreeze( "germain", false ) ;
		setIgnoreFreeze( "laporte", false ) ;
	end
	
	removeMarker( name, marker ) ;
	
	-- germain walks in, laporte walks out
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "germain", true ) ;
	setIgnoreFreeze( "laporte", true ) ;

	addGoalGetToPointInLevel( "germain", 821, -282, "louvrehouse", false, true ) ;
	waitForNoGoal( "germain" ) ;

	setMissionFaceCharacter( name, "laporte", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "laporte" ) ;

	placeCharacterInDoor( "laporte", "louvreout2", false ) ;
	addGoalGetToPointInLevel( "laporte", 633, 29, "france", false, true ) ;
	wait( 1 ) ;
	placeCharacterInDoor( "germain", "louvreout2", false ) ;
	addGoalGetToPointInLevel( "germain", getGermainAPosX( ), getGermainAPosY( ), getGermainALevel( ), false, true ) ;

	addGoalGetToPointInLevel( "dartagnan", 633, 70, "france", false, true ) ;
	waitForNoGoal( "laporte" ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mp23d12" ) ) ;
	sayAndWait( "laporte", getString( "mp23d13" ) ) ;
	sayAndWait( "dartagnan", getString( "mp23d14" ) ) ;
	sayAndWait( "laporte", getString( "mp23d15" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "germain", false ) ;
	setIgnoreFreeze( "laporte", false ) ;
	
	removeDoorLock( doorLockA ) ;

	completeMission( name ) ;
	activateMission( "missionparis24" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis24( name )
	-- Reset Treville's clock
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "planchet", getString( "mp21d27" ) ) ;

	setMissionChatString( name, "laporte", getString( "mp24d13" ) ) ;
	setMissionChatString( name, "germain", getString( "mp24d14" ) ) ;
	setMissionChatString( name, "musketeer28", getString( "mp24d16" ) ) ;
	setMissionChatString( name, "musketeer29", getString( "mp24d16" ) ) ;

	setMissionChatFunction( name, "constance", "chat_hearts_mp24d15" ) ;

	local overrideSaveID = createOverrideSavePos( "france", -496, 2398 ) ;
	setOverrideSaveLevel( overrideSaveID, "trevillehouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "trevillehouse2" ) ;
	setOverrideSaveLevel( overrideSaveID, "trevilleantechamber" ) ;
		
	setMissionFaceCharacter( name, "constance", "laporte" ) ;
	ensureCharacterInLevel( "constance", "athoshouse2", 125, -127 ) ;

	setMissionFaceCharacter( name, "laporte", "constance" ) ;
	addGoalGetToPointInLevel( "laporte", 85, -127, "athoshouse2", false, true ) ;

	local clockID = getClickObjectID( "trevilleclock" ) ;
	setClickObjectHighlightable( clockID, true ) ;
	local marker = addMarkerClickObject( name, true, getString( "mp24m1" ), clockID ) ;

	local setClockBack = false ;
	while ( not setClockBack ) do
		placeDead( "treville" ) ;

		local anteCenterX = -63 ;
		local anteCenterY = -122 ;
		local allowDist = 200.0 ;
		while ( distanceToPoint( "dartagnan", "trevillehouse2", anteCenterX, anteCenterY ) > allowDist ) do
			coroutine.yield( ) ;
		end
		
		lockPlayerInPlace( ) ;
		setMissionFaceCharacter( name, "dartagnan", "musketeer29" ) ;
		setMissionFaceCharacter( name, "musketeer29", "dartagnan" ) ;
		setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
		addGoalGetToPointInLevel( "dartagnan", anteCenterX, anteCenterY, "trevillehouse2", false, true ) ;
		waitForNoGoal( "dartagnan" ) ;
	
		sayAndWait( "musketeer29", getString( "mp24d1" ) ) ;
		unlockPlayerInPlace( ) ;
		setMissionFaceNone( name, "dartagnan" ) ;
		
		while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "trevilleantechamber" ) ) do
			coroutine.yield( ) ;
		end
		-- lock player into office once they get in there
		local doorLockA = addDoorLock( name, "missionparis24LockOut1", true, "trevilleantechamberin" ) ;

		gClockActivated = false ;

		local time = 0.0 ;
		local trevilleTime = 7.0 ;
		while ( time < trevilleTime and not gClockActivated ) do
			time = time + getDeltaT( ) ;
			
			coroutine.yield( ) ;
			
			if ( gClockActivated ) then
				lockPlayerInPlace( ) ;
				local bubInd = characterThink( "dartagnan", false, -1, -1, true, "", getString( "mp24d4" ), getString( "mp24d5" ) ) ;
				local option = waitForBubbleOption( bubInd ) ;
				if ( option == 0 ) then
					playSound( "clockreset", 1.0 ) ;
					setClockBack = true ;
				end
				unlockPlayerInPlace( ) ;
			end
		end
		
		setMissionFaceCharacter( name, "dartagnan", "treville" ) ;
		setMissionFaceCharacter( name, "treville", "dartagnan" ) ;
				
		lockPlayerInPlace( ) ;
		placeCharacterInDoor( "treville", "trevilleantechamberin", false ) ;
		addGoalGetToPointInLevel( "treville", 26, 31, "trevilleantechamber", false, true ) ;
		waitForNoGoal( "treville" ) ;
		unlockPlayerInPlace( ) ;
		
		if ( setClockBack ) then
			-- succeeded
			lockPlayerInPlace( ) ;
			sayAndWait( "treville", getString( "mp24d6" ) ) ;
			sayAndWait( "dartagnan", getString( "mp24d7" ) ) ;
			sayAndWait( "treville", getString( "mp24d8" ) ) ;
			addGoalGetToPointInLevel( "treville", -62, -202, "trevillehouse2", false, true ) ;
			local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp24d9" ) ) ;
			waitForBubbleClosed( bubInd ) ;
			
			while ( isCharacterOnScreen( "treville" ) ) do
				coroutine.yield( ) ;
			end
			clearGoals( "treville" ) ;
			placeDead( "treville" ) ;
			
			unlockPlayerInPlace( ) ;
			
			removeDoorLock( doorLockA ) ;
			setClickObjectHighlightable( clockID, true ) ;
			setMissionFaceNone( name, "dartagnan" ) ;
			
			local doorLockA = addDoorLock( name, "missionparis24LockOut2", true, "trevilleantechamberin" ) ;
						
			-- treville has left - need to set clock forward
			local setClockAhead = false ;
			gClockActivated = false ;
			while ( not setClockAhead ) do
				if ( gClockActivated ) then
					lockPlayerInPlace( ) ;
					local bubInd = characterThink( "dartagnan", false, -1, -1, true, "", getString( "mp24d10" ), getString( "mp24d5" ) ) ;
					local option = waitForBubbleOption( bubInd ) ;
					if ( option == 0 ) then
						playSound( "clockreset", 1.0 ) ;
						setClockAhead = true ;
					else
						-- give another chance to click
						gClockActivated = false ;
						setClickObjectHighlightable( clockID, true ) ;
					end
					unlockPlayerInPlace( ) ;
				end
				coroutine.yield( ) ;
			end
			
			removeDoorLock( doorLockA ) ;
		else
			-- failed
			lockPlayerInPlace( ) ;
			sayAndWait( "treville", getString( "mp24d11" ) ) ;
			
			-- fade to black
			local fadeTime = 0.5 ;
			setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
			fadeToColour( fadeTime ) ;
			while ( isFading( ) ) do
				coroutine.yield( ) ;
			end
				
			clearGoals( "dartagnan" ) ;
			placeCharacter( "dartagnan", "france", -503, 2397 ) ;
					
			-- fade from black
			local fadeTime = 0.5 ;
			setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
			fadeFromColour( fadeTime ) ;
			while ( isFading( ) ) do
				coroutine.yield( ) ;
			end
			unlockPlayerInPlace( ) ;
			
			removeDoorLock( doorLockA ) ;
			setClickObjectHighlightable( clockID, true ) ;
			setMissionFaceNone( name, "dartagnan" ) ;
		end
	end

	removeMarker( name, marker ) ;
	setClickObjectHighlightable( clockID, false ) ;

	removeOverrideSavePos( overrideSaveID ) ;

	completeMission( name ) ;
	activateMission( "missionparis25" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionparis24LockOut1( )
	lockPlayerInPlace( ) ;

	local x = -59 ;
	local y = 267 ;

	--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "mp24d3" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp24d3" ) ) ;

	addGoalGetToPointInLevel( "dartagnan", x, y, "trevilleantechamber", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function missionparis24LockOut2( )
	lockPlayerInPlace( ) ;

	local x = -59 ;
	local y = 267 ;

	--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "mp24d12" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp24d12" ) ) ;

	addGoalGetToPointInLevel( "dartagnan", x, y, "trevilleantechamber", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function execute_missionparis25( name )
	-- Go to Aramis' see Constance, escort her to Buckingham's
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "planchet", getString( "mp21d27" ) ) ;

	setMissionChatString( name, "constance", getString( "mp25d15" ) ) ;

	local overrideSaveID = createOverrideSavePos( "france", 187, 3453 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -131, 2761, 1482, 3961 } ) ;

	setMissionFaceDirection( name, "constance", 0, -1 ) ;
	placeCharacter( "constance", "france", 757, 3423 ) ;
	place_laporteA( "laporte" ) ;

	local marker = addMarkerPosition( name, true, getString( "mp25m1" ), "aramishouse", -69, 68 ) ;
	local doorLockA = addDoorLock( name, "", true, "aramishouseout" ) ;

	-- trigger in front of Aramis' place
	local triggerArea = addTriggerArea( name, "", false, "france", { 400, 3400, 932, 3600 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;

	setMissionFreezeGame( name, true ) ;
	setStateMessageIdle( "dartagnan" ) ;
	
	local loveMusicID = addMusic( "love", 15 ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	-- show comic
	local comic1 = createComic( "constance1" ) ;

	addText( comic1, getString( "constance1_d1" ), 16, 16, 199, 77 ) ;
	addText( comic1, getString( "constance1_d2" ), 16, 218, 154, 279 ) ;
	addText( comic1, getString( "constance1_d3" ), 307, 134, 421, 217 ) ;
	addText( comic1, getString( "constance1_d4" ), 504, 18, 594, 78 ) ;
	addText( comic1, getString( "constance1_d5" ), 724, 30, 784, 83 ) ;
	addText( comic1, getString( "constance1_d6" ), 514, 319, 627, 361 ) ;
	addText( comic1, getString( "constance1_d7" ), 463, 522, 622, 585 ) ;
	addText( comic1, getString( "constance1_d8" ), 666, 473, 780, 517 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 44, 67, 210, 299, 95, 78 ) ;

	addMouseOver( comic1, getString( "constance" ), 396, 19, 424, 54, 404, 22 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 224, 179, 367, 298, 280, 180 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 470, 24, 496, 53, 484, 19 ) ;
	addMouseOver( comic1, getString( "constance" ), 478, 108, 610, 298, 538, 108 ) ;

	addMouseOver( comic1, getString( "constance" ), 628, 62, 744, 294, 690, 64 ) ;

	addMouseOver( comic1, getString( "constance" ), 8, 356, 127, 591, 74, 368 ) ;

	addMouseOver( comic1, getString( "constance" ), 228, 365, 337, 596, 292, 370 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 457, 324, 636, 547, 525, 332 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 677, 382, 711, 415, 694, 386 ) ;
	addMouseOver( comic1, getString( "constance" ), 776, 442, 798, 467, 790, 447) ;
		
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	removeMusic( loveMusicID ) ;
		
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionFreezeGame( name, false ) ;

	removeMarker( name, marker ) ;	
	
	setMissionFaceCharacter( name, "constance", "dartagnan" ) ;
	local marker = addMarkerCharacter( name, true, getString( "speakconstance" ), "constance" ) ;
	waitForTalk( "dartagnan", "constance", false ) ;
	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	sayAndWait( "constance", getString( "mp25d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mp25d2" ) ) ;
	sayAndWait( "constance", getString( "mp25d3" ) ) ;
	sayAndWait( "dartagnan", getString( "mp25d4" ) ) ;
	sayAndWait( "constance", getString( "mp25d5" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp25d5_5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
		
	sayAndWait( "dartagnan", getString( "mp25d6" ) ) ;
	sayAndWait( "constance", getString( "mp25d6_5" ) ) ;
	sayAndWait( "constance", getString( "mp25d7" ) ) ;
	
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp25d8" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
		
	sayAndWait( "constance", getString( "mp25d9" ) ) ;
	sayAndWait( "dartagnan", getString( "mp25d10" ) ) ;
	
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "constance", getString( "mp25d10_5" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
	
	setMissionFreezeGame( name, false ) ;
	
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 621, 2819, 1429, 3467, 2635, 2425, 1544, 1812 } ) ;
	
	-- escort
	local marker = addMarkerCharacter( name, true, getString( "escortconstance" ), "constance" ) ;

	-- some enemies that attack dart along the way
	local cardGuard1X = 1514 ;
	local cardGuard1Y = 3197 ;
	local radius = 300.0 ;
	local cardGuard1 = createTempCharacter( getString( "cardinalsguard" ), "france", cardGuard1X, cardGuard1Y ) ;
	randomDressCardinalsGuard( cardGuard1, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard1, 12, 12, 12, 12 ) ;
	setMeleeWeapon( cardGuard1, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard1, "dartagnan" ) ;
	setContainZone( cardGuard1, true, cardGuard1X, cardGuard1Y, radius ) ;
	
	local cardGuard2X = 1589 ;
	local cardGuard2Y = 2842 ;
	local cardGuard2 = createTempCharacter( getString( "cardinalsguard" ), "france", cardGuard2X, cardGuard2Y ) ;
	randomDressCardinalsGuard( cardGuard2, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard2, 12, 12, 12, 12 ) ;
	setMeleeWeapon( cardGuard2, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard2, "dartagnan" ) ;
	setContainZone( cardGuard2, true, cardGuard2X, cardGuard2Y, radius ) ;

	local cardGuard3X = 937 ;
	local cardGuard3Y = 2867 ;
	local cardGuard3 = createTempCharacter( getString( "cardinalsguard" ), "france", cardGuard3X, cardGuard3Y ) ;
	randomDressCardinalsGuard( cardGuard3, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard3, 12, 12, 12, 12 ) ;
	setMeleeWeapon( cardGuard3, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard3, "dartagnan" ) ;
	setContainZone( cardGuard3, true, cardGuard3X, cardGuard3Y, radius ) ;
	
	makeEnemies( "dartagnan", cardGuard1, cardGuard2, cardGuard3 ) ;

	local constanceLevel = "france" ;
	local constanceDestX = 2038 ;
	local constanceDestY = 2338 ;
	
	local constanceID = addWatchCharacterUnlimited( "constance" ) ;
	addGoalGetToPointInLevel( "constance", constanceDestX, constanceDestY, constanceLevel, false, true ) ;
	
	local allowOffscreenTime = 10.0 ;
	local offscreenTime = 0.0 ;
	local walkWithoutDartTime = 1.0 ;
	local withoutDartTime = 0.0 ;
	while ( distanceToPoint( "constance", constanceLevel, constanceDestX, constanceDestY ) > 20 ) do
		if ( not isCharacterOnScreen( "constance" ) ) then
			offscreenTime = offscreenTime + getDeltaT( ) ;
		else
			-- reset
			offscreenTime = 0.0 ;
		end
		
		local pauseDist = 250 ;
		if ( distanceBetweenCharacters( "dartagnan", "constance" ) > pauseDist ) then
			withoutDartTime = withoutDartTime + getDeltaT( ) ;
		else
			withoutDartTime = 0.0 ;
		end
		
		-- pause constance when dartagnan gets too far away
		if ( withoutDartTime > walkWithoutDartTime ) then
			clearGoals( "constance" ) ;
			setStateMessageIdle( "constance" ) ;
		else
			if ( not characterHasGoal( "constance" ) ) then
				addGoalGetToPointInLevel( "constance", constanceDestX, constanceDestY, constanceLevel, false, true ) ;
			end
		end
		
		if ( offscreenTime >= allowOffscreenTime ) then
			failGame( getString( "mp25d14" ) ) ;
			
			while ( true ) do
				coroutine.yield( ) ;
			end
		end

		coroutine.yield( ) ;
	end
	
	waitForNoGoal( "constance" ) ;
	
	removeWatchCharacter( "constance", constanceID ) ;

	removeMarker( name, marker ) ;
	local marker = addMarkerCharacter( name, true, getString( "speakconstance" ), "constance" ) ;
	waitForTalk( "dartagnan", "constance", false ) ;
	removeMarker( name, marker ) ;
	
	deleteTempCharacter( cardGuard1 ) ;
	deleteTempCharacter( cardGuard2 ) ;
	deleteTempCharacter( cardGuard3 ) ;
		
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "constance", true ) ;
	sayAndWait( "constance", getString( "mp25d11" ) ) ;
	
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp25d12" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
	
	addGoalGetToPointInLevel( "constance", 0, 0, "buckinghamhouse", false, true ) ;
	
	while ( isCharacterOnScreen( "constance" ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "constance" ) ;
	placeDead( "constance" ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp25d13" ) ) ;
	waitForBubbleClosed( bubInd ) ;
			
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "constance", false ) ;
	
	--deleteTempCharacter( cardGuard1 ) ;
	--deleteTempCharacter( cardGuard2 ) ;
	--deleteTempCharacter( cardGuard3 ) ;
	
	removeDoorLock( doorLockA ) ;
			
	removeOverrideSavePos( overrideSaveID ) ;
				
	completeMission( name ) ;
	activateMission( "missionparis26" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis26( name )
	-- go speak to Planchet
	DEBUG_OUTPUT( name .. " started" ) ;

	local doorLockA = addDoorLock( name, "", true, "aramishouseout" ) ;
	local marker = addMarkerCharacter( name, true, getString( "mp26m1" ), "planchet" ) ;
	waitForTalk( "dartagnan", "planchet", false ) ;
	removeMarker( name, marker ) ;	
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	
	sayAndWait( "planchet", getString( "mp26d0_2" ) ) ;
	sayAndWait( "dartagnan", getString( "mp26d0_4" ) ) ;
	sayAndWait( "planchet", getString( "mp26d1" ) ) ;
	sayAndWait( "planchet", getString( "mp26d1_5" ) ) ;
	sayAndWait( "dartagnan", getString( "mp26d2" ) ) ;
	sayAndWait( "planchet", getString( "mp26d3" ) ) ;
	sayAndWait( "dartagnan", getString( "mp26d4" ) ) ;
	
	addGoalGetToPointInLevel( "planchet", -79, 13, "aramishouse", false, true ) ;
		
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp26d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	
	removeDoorLock( doorLockA ) ;

	completeMission( name ) ;
	activateMission( "missionparis27" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis27( name )
	-- go to Treville house - he isn't there
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "planchet", getString( "mp26d6" ) ) ;

	if ( not characterHasGoal( "planchet" ) ) then
		addGoalGetToPointInLevel( "planchet", -79, 13, "aramishouse", false, true ) ;
	end

	local doorLockA = addDoorLock( name, "", true, "aramishouseout" ) ;
	local marker = addMarkerCharacter( name, true, getString( "reporttreville" ), "musketeer29" ) ;
	waitForTalk( "dartagnan", "musketeer29", false ) ;
	removeMarker( name, marker ) ;	
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "musketeer29", true ) ;
	setMissionFaceCharacter( name, "musketeer29", "dartagnan" ) ;
	
	sayAndWait( "musketeer29", getString( "mp27d1" ) ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "musketeer29", false ) ;
	
	removeDoorLock( doorLockA ) ;

	completeMission( name ) ;
	activateMission( "missionparis28" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis28( name )
	-- go to Louvre (pointer to Pont Neuf) escort Buckingham and Constance to Louvre
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "musketeer29", getString( "mp27d2" ) ) ;

	local overrideSaveID = createOverrideSavePos( "france", 942, 2101 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 184, 1424, 1761, 2771 } ) ;
	
	clearGoals( "planchet" ) ;
	ensureCharacterInLevel( "planchet", "aramishouse", -79, 13 ) ;
	
	setCharacterOverrideName( "buckingham", true, getString( "musketeer" ) ) ;
	
	local doorLockA = addDoorLock( name, "", true, "aramishouseout" ) ;
	
	local markerPosX = 940 ;
	local markerPosY = 1919 ;
	local marker = addMarkerPosition( name, true, getString( "mp28m1" ), "france", markerPosX, markerPosY ) ;

	-- trigger in front of Pont Neuf' place
	local triggerArea = addTriggerArea( name, "", false, "france", { 867, 1812, 1018, 2012 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	removeTriggerArea( triggerArea ) ;
		
	setStateMessageIdle( "dartagnan" ) ;
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "constance", true ) ;
	setIgnoreFreeze( "buckingham", true ) ;
	
	addGoalGetToPointInLevel( "dartagnan", markerPosX, markerPosY, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	setMissionFaceCharacter( name, "constance", "dartagnan" ) ;
	setMissionFaceCharacter( name, "buckingham", "dartagnan" ) ;
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	placeCharacter( "constance", "france", 884, 2285 ) ;
	placeCharacter( "buckingham", "france", 910, 2295 ) ;
	
	addGoalGetToPointInLevel( "constance", 919, 2052, "france", false, true ) ;
	addGoalGetToPointInLevel( "buckingham", 960, 2052, "france", false, true ) ;

	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp28d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	waitForNoGoal( "constance" ) ;
	waitForNoGoal( "buckingham" ) ;
	
	sayAndWait( "buckingham", getString( "mp28d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mp28d3" ) ) ;
	sayAndWait( "buckingham", getString( "mp28d4" ) ) ;
	sayAndWait( "dartagnan", getString( "mp28d5" ) ) ;

	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "constance", false ) ;
	setIgnoreFreeze( "buckingham", false ) ;
	lockPlayerInPlace( ) ;

	removeMusic( tenseMusicID ) ;

	setCharacterSlowDamage( "dartagnan", true ) ;
	setCharacterSlowDamage( "buckingham", true ) ;
	makeEnemies( "dartagnan", "buckingham" ) ;
	
	setIgnoreAll( "buckingham", true ) ; -- enemy won't come at us
	
	setStateMessageFightWalk( "dartagnan", "buckingham" ) ;
	wait( 2 ) ;
	
	setIgnoreAll( "buckingham", false ) ; -- dartagnan will be close by now - defend self
	
	wait( 5 ) ;
	addGoalGetToPointInLevel( "constance", 928, 2019, "france", false, true ) ;
	waitForNoGoal( "constance" ) ;
	
	unlockPlayerInPlace( ) ;
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "constance", true ) ;
	setIgnoreFreeze( "buckingham", true ) ;
	
	-- stop fighting and reveal true name
	makeNotEnemies( "dartagnan", "buckingham" ) ;
	setCharacterSlowDamage( "dartagnan", false ) ;
	setCharacterSlowDamage( "buckingham", false ) ;
	setStateMessageIdle( "dartagnan" ) ;
	setStateMessageIdle( "buckingham" ) ;
	setCharacterOverrideName( "buckingham", false, getString( "unknownname" ) ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "constance" ) ;
	setMissionFaceCharacter( name, "buckingham", "constance" ) ;
	sayAndWait( "constance", getString( "mp28d6" ) ) ;
	setMissionFaceCharacter( name, "dartagnan", "buckingham" ) ;
	setMissionFaceCharacter( name, "constance", "dartagnan" ) ;
	setMissionFaceCharacter( name, "buckingham", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp28d7" ) ) ;
	setMissionFaceCharacter( name, "dartagnan", "buckingham" ) ;
	setMissionFaceCharacter( name, "constance", "buckingham" ) ;
	sayAndWait( "buckingham", getString( "mp28d8" ) ) ;
	
	setMissionFaceCharacter( name, "constance", "dartagnan" ) ;
	setMissionFaceCharacter( name, "buckingham", "dartagnan" ) ;
	setMissionFaceNone( name, "dartagnan" ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "constance", false ) ;
	setIgnoreFreeze( "buckingham", false ) ;

	setOverrideSaveArea( overrideSaveID, "france", 
		{ 702, 1516, 1427, 1637, 1248, -194, 228, -228 } ) ;

	-- escort
	local cardGuard1X = 921 ;
	local cardGuard1Y = 1174 ;
	local radius = 300.0 ;
	local cardGuard1 = createTempCharacter( getString( "cardinalsguard" ), "france", cardGuard1X, cardGuard1Y ) ;
	randomDressCardinalsGuard( cardGuard1, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard1, 13, 13, 13, 13 ) ;
	setMeleeWeapon( cardGuard1, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard1, "dartagnan" ) ;
	setContainZone( cardGuard1, true, cardGuard1X, cardGuard1Y, radius ) ;
	
	local cardGuard2X = 960 ;
	local cardGuard2Y = 1180 ;
	local cardGuard2 = createTempCharacter( getString( "cardinalsguard" ), "france", cardGuard2X, cardGuard2Y ) ;
	randomDressCardinalsGuard( cardGuard2, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard2, 13, 13, 13, 13 ) ;
	setMeleeWeapon( cardGuard2, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard2, "dartagnan" ) ;
	setContainZone( cardGuard2, true, cardGuard2X, cardGuard2Y, radius ) ;

	local cardGuard3X = 951 ;
	local cardGuard3Y = 710 ;
	local cardGuard3 = createTempCharacter( getString( "cardinalsguard" ), "france", cardGuard3X, cardGuard3Y ) ;
	randomDressCardinalsGuard( cardGuard3, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard3, 13, 13, 13, 13 ) ;
	setMeleeWeapon( cardGuard3, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard3, "dartagnan" ) ;
	setContainZone( cardGuard3, true, cardGuard3X, cardGuard3Y, radius ) ;
	

	makeEnemies( "dartagnan", cardGuard1, cardGuard2, cardGuard3 ) ;
	
	setMissionChatString( name, "constance", getString( "mp28d11" ) ) ;
	setMissionChatString( name, "buckingham", getString( "mp28d12" ) ) ;
		
	local constanceMarker = addMarkerCharacter( name, true, getString( "escort" ), "constance" ) ;
	local buckinghamMarker = addMarkerCharacter( name, true, getString( "escort" ), "buckingham" ) ;
	
	local constanceLevel = "france" ;
	local constanceDestX = 676 ;
	local constanceDestY = 50 ;
	local buckinghamLevel = "france" ;
	local buckinghamDestX = 710 ;
	local buckinghamDestY = 50 ;

	addGoalGetToPointInLevel( "constance", constanceDestX, constanceDestY, constanceLevel, false, true ) ;
	addGoalGetToPointInLevel( "buckingham", buckinghamDestX, buckinghamDestY, buckinghamLevel, false, true ) ;
	
	local constanceID = addWatchCharacterUnlimited( "constance" ) ;
	local buckinghamID = addWatchCharacterUnlimited( "buckingham" ) ;
	
	local allowOffscreenTime = 10.0 ;
	local offscreenTime = 0.0 ;
	local walkWithoutDartTime = 1.0 ;
	local withoutDartTime = 0.0 ;
	while ( distanceToPoint( "constance", constanceLevel, constanceDestX, constanceDestY ) > 20 ) do
		if ( not isCharacterOnScreen( "constance" ) ) then
			offscreenTime = offscreenTime + getDeltaT( ) ;
		else
			-- reset
			offscreenTime = 0.0 ;
		end
		
		local pauseDist = 150 ;
		if ( distanceBetweenCharacters( "dartagnan", "constance" ) > pauseDist ) then
			withoutDartTime = withoutDartTime + getDeltaT( ) ;
		else
			withoutDartTime = 0.0 ;
		end
		
		-- pause constance when dartagnan gets too far away
		if ( withoutDartTime > walkWithoutDartTime ) then
			DEBUG_OUTPUT( "remove" ) ;
			clearGoals( "constance" ) ;
			setStateMessageIdle( "constance" ) ;
			clearGoals( "buckingham" ) ;
			setStateMessageIdle( "buckingham" ) ;
		else
			if ( not characterHasGoal( "constance" ) ) then
				DEBUG_OUTPUT( "add" ) ;
				addGoalGetToPointInLevel( "constance", constanceDestX, constanceDestY, constanceLevel, false, true ) ;
			end
			if ( not characterHasGoal( "buckingham" ) ) then
				addGoalGetToPointInLevel( "buckingham", buckinghamDestX, buckinghamDestY, buckinghamLevel, false, true ) ;
			end
		end
		
		if ( offscreenTime >= allowOffscreenTime ) then
			failGame( getString( "mp28d10" ) ) ;
			
			while ( true ) do
				coroutine.yield( ) ;
			end
		end

		coroutine.yield( ) ;
	end
	
	waitForNoGoal( "constance" ) ;
	waitForNoGoal( "buckingham" ) ;
	
	removeWatchCharacter( "constance", constanceID ) ;
	removeWatchCharacter( "buckingham", buckinghamID ) ;

	removeMarker( name, constanceMarker ) ;
	removeMarker( name, buckinghamMarker ) ;
	
	local buckinghamMarker = addMarkerCharacter( name, true, getString( "mp28m2" ), "buckingham" ) ;
	waitForTalkTwo( "dartagnan", "buckingham", "constance", false ) ;
	--waitForTalk( "dartagnan", "buckingham", false ) ;
	removeMarker( name, buckinghamMarker ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "buckingham" ) ;
		
	deleteTempCharacter( cardGuard1 ) ;
	deleteTempCharacter( cardGuard2 ) ;
	deleteTempCharacter( cardGuard3 ) ;
		
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "constance", true ) ;
	setIgnoreFreeze( "buckingham", true ) ;
	sayAndWait( "buckingham", getString( "mp28d9" ) ) ;
	
	addHeartMaker( "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "constance" ) ;
	sayAndWait( "constance", getString( "mp28d9_5" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
	
	
	addGoalGetToPointInLevel( "constance", 822, -277, "louvrehouse", false, true ) ;
	wait( 1 ) ;
	addGoalGetToPointInLevel( "buckingham", 822, -277, "louvrehouse", false, true ) ;
	
	while ( isCharacterOnScreen( "constance" )
		or  isCharacterOnScreen( "buckingham" ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "constance" ) ;
	clearGoals( "buckingham" ) ;
	place_constanceA( "constance" ) ;
	place_buckinghamA( "buckingham" ) ;
	
	local loveMusicID = addMusic( "love", 15 ) ;
		
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	-- show comic
	local comic1 = createComic( "queen1" ) ;

	addText( comic1, getString( "queen1_d1" ), 114, 209, 229, 251 ) ;
	addText( comic1, getString( "queen1_d2" ), 324, 4, 466, 42 ) ;
	addText( comic1, getString( "queen1_d3" ), 419, 66, 558, 146 ) ;
	addText( comic1, getString( "queen1_d4" ), 574, 5, 768, 68 ) ;
	addText( comic1, getString( "queen1_d5" ), 574, 250, 792, 292 ) ;
	addText( comic1, getString( "queen1_d6" ), 240, 307, 408, 413 ) ;
	addText( comic1, getString( "queen1_d7" ), 556, 324, 724, 385 ) ;
	
	addMouseOver( comic1, getString( "donnaestefania" ), 7, 55, 80, 223, 37, 57 ) ;
	addMouseOver( comic1, getString( "constance" ), 267, 53, 313, 208, 290, 60 ) ;
	addMouseOver( comic1, getString( "queen" ), 55, 50, 132, 280, 94, 58 ) ;
	addMouseOver( comic1, getString( "buckingham" ), 216, 28, 284, 217, 236, 34 ) ;
	
	addMouseOver( comic1, getString( "buckingham" ), 470, 167, 541, 265, 500, 171 ) ;
	addMouseOver( comic1, getString( "queen" ), 355, 97, 461, 279, 396, 104 ) ;

	addMouseOver( comic1, getString( "buckingham" ), 724, 52, 798, 212, 764, 61 ) ;
	addMouseOver( comic1, getString( "queen" ), 597, 83, 736, 259, 655, 91 ) ;

	addMouseOver( comic1, getString( "queen" ), 139, 328, 180, 387, 155, 333 ) ;
	addMouseOver( comic1, getString( "madamelannoy" ), 10, 349, 86, 450, 46, 350 ) ;

	addMouseOver( comic1, getString( "queen" ), 131, 491, 178, 555, 148, 493 ) ;
	addMouseOver( comic1, getString( "madamelannoy" ), 15, 495, 77, 596, 46, 494 ) ;

	addMouseOver( comic1, getString( "queen" ), 402, 318, 536, 596, 454, 325 ) ;
	addMouseOver( comic1, getString( "buckingham" ), 257, 465, 394, 595, 354, 469 ) ;

	addMouseOver( comic1, getString( "buckingham" ), 737, 354, 778, 432, 756, 362 ) ;	
	addMouseOver( comic1, getString( "constance" ), 771, 366, 798, 434, 780, 368 ) ;	
	addMouseOver( comic1, getString( "donnaestefania" ), 541, 409, 594, 590, 566, 413 ) ;
	addMouseOver( comic1, getString( "queen" ), 590, 408, 707, 593, 614, 414 ) ;

	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	--deleteTempCharacter( cardGuard1 ) ;
	--deleteTempCharacter( cardGuard2 ) ;
	--deleteTempCharacter( cardGuard3 ) ;
	
	removeMusic( loveMusicID ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "constance", false ) ;
	setIgnoreFreeze( "buckingham", false ) ;

	removeDoorLock( doorLockA ) ;

	removeOverrideSavePos( overrideSaveID ) ;

	completeMission( name ) ;
	activateMission( "missionparis29" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis29( name )
	-- Meet in the Pomme de Pin, Athos in prison scene
	DEBUG_OUTPUT( name .. " started" ) ;
	
	clearGoals( "planchet" ) ;
	place_planchetA( "planchet" ) ;
	
	sitCharacter( "aramis", "pommechair2" ) ;
	sitCharacter( "porthos", "pommechair1" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mp29m1" ), "aramis" ) ;
	waitForTalkTwo( "dartagnan", "porthos", "aramis", false ) ;
		
	removeMarker( name, marker ) ;	

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "bonacieux", true ) ;
	setIgnoreFreeze( "magistrate", true ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	sayAndWait( "aramis", getString( "mp29d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mp29d2" ) ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	sayAndWait( "porthos", getString( "mp29d3" ) ) ;
	
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp29d4" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	sayAndWait( "aramis", getString( "mp29d5" ) ) ;
	
	
	-- athos in prison scene
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	clearGoals( "athos" ) ;
	clearGoals( "bonacieux" ) ;
	placeCharacter( "bonacieux", "bastillehouse", -97, 62 ) ;

	local cardGuard1 = createTempCharacter( getString( "cardinalsguard" ), "bastillehouse", -246, -48 ) ;
	randomDressCardinalsGuard( cardGuard1, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( cardGuard1, "sword_1" ) ;
	local cardGuard2 = createTempCharacter( getString( "cardinalsguard" ), "bastillehouse", 129, -45 ) ;
	randomDressCardinalsGuard( cardGuard2, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( cardGuard2, "sword_1" ) ;
	local cardGuard3 = createTempCharacter( getString( "cardinalsguard" ), "bastillehouse", -121, 255 ) ;
	randomDressCardinalsGuard( cardGuard3, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( cardGuard3, "sword_1" ) ;
	local cardGuard4 = createTempCharacter( getString( "cardinalsguard" ), "bastillehouse", -5, 255 ) ;
	randomDressCardinalsGuard( cardGuard4, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( cardGuard4, "sword_1" ) ;
	
	setMissionFaceDirection( name, cardGuard1, 0, 1 ) ;
	setMissionFaceDirection( name, cardGuard2, 0, 1 ) ;
	setMissionFaceDirection( name, cardGuard3, 0, -1 ) ;
	setMissionFaceDirection( name, cardGuard4, 0, -1 ) ;
	
	setIgnoreFreeze( cardGuard1, true ) ;
	setIgnoreFreeze( cardGuard2, true ) ;
	setIgnoreFreeze( cardGuard3, true ) ;
	setIgnoreFreeze( cardGuard4, true ) ;

	setMissionFaceCharacter( name, "magistrate", "bonacieux" ) ;
	setMissionFaceCharacter( name, "bonacieux", "magistrate" ) ;
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "bastillehouse" ) ;
	setCameraTo( -51, 86 ) ;
	
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	sayAndWait( "magistrate", getString( "mp29d6" ) ) ;
	sayAndWait( "bonacieux", getString( "mp29d7" ) ) ;
	sayAndWait( "magistrate", getString( "mp29d8" ) ) ;
	sayAndWait( "bonacieux", getString( "mp29d9" ) ) ;
	sayAndWait( "magistrate", getString( "mp29d10" ) ) ;
	sayAndWait( "bonacieux", getString( "mp29d11" ) ) ;
	sayAndWait( "magistrate", getString( "mp29d12" ) ) ;

	setMissionFaceCharacter( name, "magistrate", "athos" ) ;
	setMissionFaceCharacter( name, "bonacieux", "athos" ) ;
	setMissionFaceCharacter( name, "athos", "magistrate" ) ;
	
	placeCharacterInDoor( "athos", "bastillein", false ) ;
	addGoalGetToPointInLevel( "athos", -25, 55, "bastillehouse", false, true ) ;
	
	wait( 2 ) ;

	sayAndWait( "bonacieux", getString( "mp29d13" ) ) ;
	sayAndWait( "magistrate", getString( "mp29d14" ) ) ;
	sayAndWait( "bonacieux", getString( "mp29d15" ) ) ;

	waitForNoGoal( "athos" ) ;
	sayAndWait( "magistrate", getString( "mp29d16" ) ) ;
	sayAndWait( "athos", getString( "mp29d17" ) ) ;
	sayAndWait( "magistrate", getString( "mp29d18" ) ) ;
	sayAndWait( "athos", getString( "mp29d19" ) ) ;
	sayAndWait( "magistrate", getString( "mp29d20" ) ) ;
	sayAndWait( "athos", getString( "mp29d21" ) ) ;
	setMissionFaceCharacter( name, "bonacieux", "magistrate" ) ;
	sayAndWait( "magistrate", getString( "mp29d22" ) ) ;
	
	setMissionFaceCharacter( name, "magistrate", "bonacieux" ) ;
	setMissionFaceCharacter( name, "athos", "bonacieux" ) ;
	sayAndWait( "bonacieux", getString( "mp29d23" ) ) ;
	
	-- back to dartagnan
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	deleteTempCharacter( cardGuard1 ) ;
	deleteTempCharacter( cardGuard2 ) ;
	deleteTempCharacter( cardGuard3 ) ;
	deleteTempCharacter( cardGuard4 ) ;

	setCameraFollowCharacter( "dartagnan", false ) ;
	
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	sayAndWait( "porthos", getString( "mp29d24" ) ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	sayAndWait( "aramis", getString( "mp29d25" ) ) ;
	sayAndWait( "dartagnan", getString( "mp29d26" ) ) ;

	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "bonacieux", false ) ;
	setIgnoreFreeze( "magistrate", false ) ;
	
	addGoalGetToPointInLevel( "porthos", getPorthosAPosX( ), getPorthosAPosY( ), getPorthosALevel( ), false, true ) ;
	addGoalGetToPointInLevel( "aramis", getAramisAPosX( ), getAramisAPosY( ), getAramisALevel( ), false, true ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis30" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis30( name )
	-- Inform Treville of Athos
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "porthos", getString( "mp30d5" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp30d6" ) ) ;
		
	clearGoals( "treville" ) ;
	setMissionFaceDirection( name, "treville", 0, -1 ) ;
	placeCharacter( "treville", "trevilleantechamber", 11, -30 ) ;

	local marker = addMarkerCharacter( name, true, getString( "mp30m1" ), "treville" ) ;
	waitForTalk( "dartagnan", "treville", false ) ;
	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	setMissionFaceCharacter( name, "treville", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "treville" ) ;
	sayAndWait( "dartagnan", getString( "mp30d1" ) ) ;
	sayAndWait( "treville", getString( "mp30d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mp30d3" ) ) ;
	sayAndWait( "treville", getString( "mp30d4" ) ) ;
	
	addGoalGetToPointInLevel( "treville", -62, -200, "trevillehouse2", false, true ) ;

	while ( isCharacterOnScreen( "treville" ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "treville" ) ;
	placeDead( "treville" ) ;
	
	unlockPlayerInPlace( ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis31" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis31( name )
	-- Athos is out of prison, show scene with Bonacieux, Cardinal, and Rochefort
	DEBUG_OUTPUT( name .. " started" ) ;
	
	-- put musketeers outside Bastille
	clearGoals( "athos" ) ;
	clearGoals( "porthos" ) ;
	clearGoals( "aramis" ) ;
	
	placeDead( "athos" ) ;
	
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	
	placeCharacter( "porthos", "france", 4089, 772 ) ;
	placeCharacter( "aramis", "france", 4064, 747 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mp31m1" ), "aramis" ) ;
	waitForTalkTwo( "dartagnan", "aramis", "porthos", false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "cardinal", true ) ;
	setIgnoreFreeze( "bonacieux", true ) ;
	setIgnoreFreeze( "rochefort", true ) ;

	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	setMissionFaceCharacter( name, "porthos", "athos" ) ;
	setMissionFaceCharacter( name, "aramis", "athos" ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	
	placeCharacterInDoor( "athos", "bastilleout", false ) ;
	addGoalGetToPointInLevel( "athos", 4014, 686, "france", false, true ) ;
	waitForNoGoal( "athos" ) ;

	sayAndWait( "porthos", getString( "mp31d1" ) ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	sayAndWait( "athos", getString( "mp31d2" ) ) ;
	sayAndWait( "athos", getString( "mp31d3" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp31d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	sayAndWait( "dartagnan", getString( "mp31d5" ) ) ;
	sayAndWait( "athos", getString( "mp31d6" ) ) ;
	
	-- bonacieux and cardinal scene
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setCharacterOverrideName( "rochefort", true, getString( "rochefortunknown" ) ) ;
	placeCharacter( "rochefort", "cardinalhouse", 224, -697 ) ;
	placeCharacter( "bonacieux", "cardinalhouse", -51, -918 ) ;

	setMissionFaceCharacter( name, "rochefort", "cardinal" ) ;
	setMissionFaceCharacter( name, "bonacieux", "cardinal" ) ;

	local cardGuard1 = createTempCharacter( getString( "cardinalsguard" ), "cardinalhouse", -204, -930 ) ;
	randomDressCardinalsGuard( cardGuard1, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( cardGuard1, "sword_1" ) ;
	local cardGuard2 = createTempCharacter( getString( "cardinalsguard" ), "cardinalhouse", -204, -890 ) ;
	randomDressCardinalsGuard( cardGuard2, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( cardGuard2, "sword_1" ) ;
	
	setMissionFaceCharacter( name, cardGuard1, "cardinal" ) ;
	setMissionFaceCharacter( name, cardGuard2, "cardinal" ) ;
	
	setIgnoreFreeze( cardGuard1, true ) ;
	setIgnoreFreeze( cardGuard2, true ) ;
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "cardinalhouse" ) ;
	setCameraTo( -77, -923 ) ;
	
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	sayAndWait( "cardinal", getString( "mp31d7" ) ) ;
	sayAndWait( "bonacieux", getString( "mp31d8" ) ) ;
	setMissionFaceCharacter( name, "cardinal", "bonacieux" ) ;
	sayAndWait( "cardinal", getString( "mp31d9" ) ) ;
	sayAndWait( "bonacieux", getString( "mp31d10" ) ) ;
	
	setMissionFaceCharacter( name, "rochefort", "bonacieux" ) ;
	addGoalGetToPointInLevel( "rochefort", 81, -912, "cardinalhouse", false, true ) ;
	wait( 2 ) ;
	setMissionFaceCharacter( name, "cardinal", "rochefort" ) ;
	wait( 0.5 ) ;
	setMissionFaceCharacter( name, "bonacieux", "rochefort" ) ;
	
	sayAndWait( "bonacieux", getString( "mp31d11" ) ) ;
	setMissionFaceCharacter( name, "cardinal", cardGuard1 ) ;
	setMissionFaceCharacter( name, "bonacieux", "cardinal" ) ;
	sayAndWait( "cardinal", getString( "mp31d12" ) ) ;
	setMissionFaceCharacter( name, "cardinal", "bonacieux" ) ;
	sayAndWait( "bonacieux", getString( "mp31d13" ) ) ;
	sayAndWait( "cardinal", getString( "mp31d14" ) ) ;
	sayAndWait( "bonacieux", getString( "mp31d15" ) ) ;
	sayAndWait( "cardinal", getString( "mp31d16" ) ) ;
	sayAndWait( "bonacieux", getString( "mp31d17" ) ) ;
	
	addGoalGetToPointInLevel( "bonacieux", -586, -301, "cardinalhouse", false, true ) ;
	addGoalGetToPointInLevel( cardGuard1, -586, -301, "cardinalhouse", false, true ) ;
	addGoalGetToPointInLevel( cardGuard2, -586, -301, "cardinalhouse", false, true ) ;
	
	wait( 4 ) ;
	waitForNoGoal( "rochefort" ) ;
	setMissionFaceCharacter( name, "cardinal", "rochefort" ) ;
	setMissionFaceCharacter( name, "rochefort", "cardinal" ) ;
	sayAndWait( "cardinal", getString( "mp31d18" ) ) ;
	sayAndWait( "rochefort", getString( "mp31d19" ) ) ;
	sayAndWait( "cardinal", getString( "mp31d19_5" ) ) ;
	sayAndWait( "rochefort", getString( "mp31d20" ) ) ;
	sayAndWait( "cardinal", getString( "mp31d21" ) ) ;
	wait( 1 ) ;
	sayAndWait( "cardinal", getString( "mp31d22" ) ) ;
		
	-- back to dartagnan
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	clearGoals( "bonacieux" ) ;
	placeDead( "bonacieux" ) ;
	placeDead( "rochefort" ) ;

	deleteTempCharacter( cardGuard1 ) ;
	deleteTempCharacter( cardGuard2 ) ;
	
	setCharacterOverrideName( "rochefort", false, getString( "unknownname" ) ) ;
	setCameraFollowCharacter( "dartagnan", false ) ;
	
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	setMissionFaceCharacter( name, "porthos", "athos" ) ;
	setMissionFaceCharacter( name, "aramis", "athos" ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	sayAndWait( "athos", getString( "mp31d23" ) ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp31d24" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "cardinal", false ) ;
	setIgnoreFreeze( "bonacieux", false ) ;
	setIgnoreFreeze( "rochefort", false ) ;

	addGoalGetToPointInLevel( "athos", getAthosAPosX( ), getAthosAPosY( ), getAthosALevel( ), false, true ) ;
	addGoalGetToPointInLevel( "porthos", getPorthosAPosX( ), getPorthosAPosY( ), getPorthosALevel( ), false, true ) ;
	addGoalGetToPointInLevel( "aramis", getAramisAPosX( ), getAramisAPosY( ), getAramisALevel( ), false, true ) ;

	completeMission( name ) ;
	activateMission( "missionparis32" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis32( name )
	-- Go guard Pont Neuf, fight with Cardinal's men
	DEBUG_OUTPUT( name .. " started" ) ;
	
	local overrideSaveID = createOverrideSavePos( "france", 1334, 1296 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 135, 283, 2121, 2137 } ) ;
	
	local markerPosX = 950 ;
	local markerPosY = 1170 ;
	local marker = addMarkerPosition( name, true, getString( "guardpontneuf" ), "france", markerPosX, markerPosY ) ;

	-- trigger in front of Aramis' place
	local triggerArea = addTriggerArea( name, "", false, "france", { 818, 1038, 1056, 1291 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;
	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", markerPosX, markerPosY, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;	
	
	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	local cardGuard1 = createTempCharacter( getString( "cardinalsguard" ), "france", 937, 826 ) ;
	randomDressCardinalsGuard( cardGuard1, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard1, 14, 14, 14, 14 ) ;
	setMeleeWeapon( cardGuard1, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard1, "dartagnan" ) ;
	
	local cardGuard2 = createTempCharacter( getString( "cardinalsguard" ), "france", 1416, 1309 ) ;
	randomDressCardinalsGuard( cardGuard2, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard2, 14, 14, 14, 14 ) ;
	setMeleeWeapon( cardGuard2, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard2, "dartagnan" ) ;

	local cardGuard3 = createTempCharacter( getString( "cardinalsguard" ), "france", 940, 1535 ) ;
	randomDressCardinalsGuard( cardGuard3, 0.0, randomInt( 0, 99999 ) ) ;
	setStatsCalculatorStatic( cardGuard3, 14, 14, 14, 14 ) ;
	setMeleeWeapon( cardGuard3, "sword_1" ) ;
	setMissionFaceCharacter( name, cardGuard3, "dartagnan" ) ;

	setIgnoreFreeze( cardGuard1, true ) ;
	setIgnoreFreeze( cardGuard2, true ) ;
	setIgnoreFreeze( cardGuard3, true ) ;

	addGoalGetToPointInLevel( cardGuard1, 944, 1051, "france", false, true ) ;
	addGoalGetToPointInLevel( cardGuard2, 1043, 1186, "france", false, true ) ;
	addGoalGetToPointInLevel( cardGuard3, 947, 1249, "france", false, true ) ;
	
	-- dart spins around and looks at all the guards
	wait( 1 ) ;
	setMissionFaceCharacter( name, "dartagnan", cardGuard1 ) ;
	wait( 1 ) ;
	setMissionFaceCharacter( name, "dartagnan", cardGuard2 ) ;
	wait( 1 ) ;
	setMissionFaceCharacter( name, "dartagnan", cardGuard3 ) ;
	waitForNoGoal( cardGuard1 ) ;

	setMissionFaceCharacter( name, "dartagnan", cardGuard1 ) ;
	sayAndWait( cardGuard1, getString( "mp32d1" ) ) ;

	local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mp32d2" ), getString( "mp32d3" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 0 ) then
		sayAndWait( cardGuard1, getString( "mp32d4" ) ) ;
	else
		sayAndWait( cardGuard1, getString( "mp32d5" ) ) ;
	end
	
	waitForNoGoal( cardGuard2 ) ;
	waitForNoGoal( cardGuard3 ) ;

	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( cardGuard1, false ) ;
	setIgnoreFreeze( cardGuard2, false ) ;
	setIgnoreFreeze( cardGuard3, false ) ;
			
	setMissionFaceNone( name, "dartagnan" ) ;
	makeEnemies( "dartagnan", cardGuard1, cardGuard2, cardGuard3 ) ;
	
	removeMusic( tenseMusicID ) ;

	addWatchCharacterUnlimited( cardGuard1 ) ;
	addWatchCharacterUnlimited( cardGuard2 ) ;
	addWatchCharacterUnlimited( cardGuard3 ) ;

	local cardGuard1Marker = addMarkerCharacter( name, true, getString( "fight" ), cardGuard1 ) ;
	local cardGuard2Marker = addMarkerCharacter( name, true, getString( "fight" ), cardGuard2 ) ;
	local cardGuard3Marker = addMarkerCharacter( name, true, getString( "fight" ), cardGuard3 ) ;

	waitUntilDead( cardGuard1 ) ;
	waitUntilDead( cardGuard2 ) ;
	waitUntilDead( cardGuard3 ) ;

	setStateMessageIdle( "dartagnan" ) ;
	lockPlayerInPlace( ) ;	
	wait( 1 ) ;
	unlockPlayerInPlace( ) ;	
	
	setMissionFreezeGame( name, true ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp32d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
			
	completeMission( name ) ;
	activateMission( "missionparis33" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis33( name )
	-- D'Artagnan goes to sleep. King meets with Queen, Constance meets with Queen, Constance meets with Bonacieux.
	DEBUG_OUTPUT( name .. " started" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "sleep" ), "planchet" ) ;

	waitForTalk( "dartagnan", "planchet", false ) ;
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	sayAndWait( "dartagnan", getString( "mp33d1" ) ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, -1 ) ;
	-- walk to bed
	addGoalGetToPointInLevel( "dartagnan", -58, 60, "bonacieuxhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	-- fade to black
	local fadeTime = 1.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "louvrehouse2" ) ;
	setCameraTo( -684, -942 ) ;
	
	placeCharacter( "queen", "louvrehouse2", -710, -940 ) ;
	placeCharacter( "louisxiii", "louvrehouse2", -670, -940 ) ;
	placeCharacter( "constance", "louvrehouse2", -585, -552 ) ;
	setMissionFaceCharacter( name, "queen", "louisxiii" ) ;
	setMissionFaceCharacter( name, "louisxiii", "queen" ) ;
	setMissionFaceDirection( name, "constance", 1, 0 ) ;
					
	-- fade from black
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	addGoalGetToPointInLevel( "constance", -678, -813, "louvrehouse2", false, true ) ;
	addGoalGetToPointInLevel( "constance", -727, -729, "louvrehouse2", false, true ) ;
		
	sayAndWait( "louisxiii", getString( "mp33d2" ) ) ;
	sayAndWait( "queen", getString( "mp33d3" ) ) ;
	sayAndWait( "louisxiii", getString( "mp33d4" ) ) ;
	sayAndWait( "queen", getString( "mp33d5" ) ) ;
	sayAndWait( "louisxiii", getString( "mp33d6" ) ) ;
	sayAndWait( "queen", getString( "mp33d7" ) ) ;
	sayAndWait( "louisxiii", getString( "mp33d7_4" ) ) ;
	sayAndWait( "queen", getString( "mp33d7_6" ) ) ;
	sayAndWait( "louisxiii", getString( "mp33d7_8" ) ) ;
	
	addGoalGetToPointInLevel( "louisxiii", -579, -495, "louvrehouse2", false, true ) ;

	wait( 5 ) ;
	setMissionFaceDirection( name, "queen", 0, -1 ) ;
	setMissionFaceCharacter( name, "constance", "queen" ) ;
	addGoalGetToPointInLevel( "constance", -678, -863, "louvrehouse2", false, true ) ;
	sayAndWait( "queen", getString( "mp33d8" ) ) ;
	waitForNoGoal( "constance" ) ;
	setMissionFaceCharacter( name, "queen", "constance" ) ;
	sayAndWait( "constance", getString( "mp33d9" ) ) ;
	sayAndWait( "queen", getString( "mp33d10" ) ) ;
	sayAndWait( "constance", getString( "mp33d11" ) ) ;
	sayAndWait( "queen", getString( "mp33d12" ) ) ;
	sayAndWait( "constance", getString( "mp33d13" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	sayAndWait( "queen", getString( "mp33d14" ) ) ;

	-- fade to black	
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	clearGoals( "louisxiii" ) ;
	place_louisxiiiA( "louisxiii" ) ;
	place_queenA( "queen" ) ;
	place_constanceA( "constance" ) ;

	setCameraFollowCharacter( "dartagnan", true ) ;

	placeCharacter( "planchet", "bonacieuxhouse2", -86, 67 ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;

	wait( 2 ) ;

	local bubInd = characterSay( "planchet", true, -1, -1, true, getString( "mp33d15" ) ) ;
	
	-- fade from black	
	local fadeTime = 1.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;
	
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp33d16" ) ) ;
	
	-- go to floorboard		
	addGoalGetToPointInLevel( "dartagnan", -151, -5, "bonacieuxhouse2", false, true ) ;
	addGoalGetToPointInLevel( "planchet", -151, -42, "bonacieuxhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	waitForNoGoal( "planchet" ) ;

	removeHeartMaker( "dartagnan" ) ;

	setToggleVisElsVisible( "floorboard", true ) ;
	playSound( "floorboard", 1.0 ) ;
	wait( 1 ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "bonacieuxhouse" ) ;
	setCameraTo( -34, -33 ) ;
	
	setMissionFaceCharacter( name, "constance", "bonacieux" ) ;
	setMissionFaceCharacter( name, "bonacieux", "constance" ) ;
	place_constanceB( "constance" ) ;
	placeCharacter( "bonacieux", "bonacieuxhouse", 0, -115 ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	sayAndWait( "constance", getString( "mp33d17" ) ) ;
	sayAndWait( "bonacieux", getString( "mp33d18" ) ) ;
	sayAndWait( "constance", getString( "mp33d19" ) ) ;
	sayAndWait( "bonacieux", getString( "mp33d20" ) ) ;
	sayAndWait( "bonacieux", getString( "mp33d21" ) ) ;
	sayAndWait( "constance", getString( "mp33d22" ) ) ;
	sayAndWait( "bonacieux", getString( "mp33d23" ) ) ;

	addGoalGetToPointInLevel( "bonacieux", 1760, 2782, "france", false, true ) ;

	while ( isCharacterOnScreen( "bonacieux" ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "bonacieux" ) ;
	place_bonacieuxB( "bonacieux" ) ;

	sayAndWait( "constance", getString( "mp33d24" ) ) ;
	
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setCameraFollowCharacter( "dartagnan", true ) ;

	-- fade from black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	unlockPlayerInPlace( ) ;
	
	setToggleVisElsVisible( "floorboard", false ) ;	
	playSound( "floorboard", 1.0 ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis34" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis34( name )
	-- talk to Constance about going to London
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setInventoryItem( "letter_toengland", 0 ) ;
	setInventoryItem( "constance_money_pouch", 0 ) ;
		
	setMissionFaceCharacter( name, "constance", "dartagnan" ) ;
	place_constanceB( "constance" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mp34m1" ), "constance" ) ;
	waitForTalk( "dartagnan", "constance", false ) ;
	removeMarker( name, marker ) ;
	
	local loveMusicID = addMusic( "love", 15 ) ;
		
	setMissionFreezeGame( name, true ) ;
	
	addHeartMaker( "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mp34d1" ) ) ;
	sayAndWait( "constance", getString( "mp34d2" ) ) ;
	
	removeHeartMaker( "dartagnan" ) ;
	
	local bubInd = characterSay( "dartagnan", false, -1, -1, true, getString( "mp34d3" ), 
		getString( "mp34d4" ), getString( "mp34d5" ), getString( "mp34d6" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 1 ) then
		sayAndWait( "constance", getString( "mp34d7" ) ) ;
	elseif ( option == 2 ) then
		sayAndWait( "constance", getString( "mp34d8" ) ) ;
	end
	sayAndWait( "constance", getString( "mp34d9" ) ) ;
	
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp34d10" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	setInventoryItem( "letter_toengland", 1 ) ;
	
	addHeartMaker( "constance" ) ;
	sayAndWait( "constance", getString( "mp34d10_5" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
	removeHeartMaker( "constance" ) ;
	
	sayAndWait( "constance", getString( "mp34d11" ) ) ;
	sayAndWait( "dartagnan", getString( "mp34d12" ) ) ;
	sayAndWait( "constance", getString( "mp34d13" ) ) ;
	
	playSound( "dropmoney", 0.5 ) ;
	setInventoryItem( "constance_money_pouch", 1 ) ;
		
	sayAndWait( "dartagnan", getString( "mp34d14" ) ) ;
	sayAndWait( "constance", getString( "mp34d15" ) ) ;

	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp34d16" ) ) ;
	removeHeartMaker( "dartagnan" ) ;

	removeMusic( loveMusicID ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp34d17" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	
	addMoney( 250 ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis35" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis35( name )
	-- Ask Treville for leave
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatFunction( name, "constance", "chat_hearts_mp34d18" ) ;
		
	local triggerAreaA = addTriggerArea( name, "missionparis35LockOut", true, "france", 
		{ 3930, -733, 4107, -400 } ) ;
		
	local marker = addMarkerCharacter( name, true, getString( "mp35m1" ), "treville" ) ;

	waitForTalk( "dartagnan", "treville", false ) ;
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	sayAndWait( "dartagnan", getString( "mp35d1" ) ) ;
	sayAndWait( "treville", getString( "mp35d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mp35d3" ) ) ;
	sayAndWait( "treville", getString( "mp35d4" ) ) ;
	sayAndWait( "dartagnan", getString( "mp35d5" ) ) ;
	sayAndWait( "treville", getString( "mp35d6" ) ) ;
	sayAndWait( "treville", getString( "mp35d7" ) ) ;
	sayAndWait( "dartagnan", getString( "mp35d8" ) ) ;
	unlockPlayerInPlace( ) ;
	
	removeTriggerArea( triggerAreaA ) ;
	
	completeMission( name ) ;
	activateMission( "missionparis36" ) ;
	activateMission( "missionparis37" ) ;
	activateMission( "missionparis38" ) ;
	activateMission( "missionparis39" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionparis35LockOut( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mp35d9" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp35d9" ) ) ;
	
	local playerX, playerY = getCharacterPos( "dartagnan" ) ;
	local x = playerX - 50 ;
	local y = playerY ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end

function execute_missionparis36( name )
	-- Get Aramis' help
	DEBUG_OUTPUT( name .. " started" ) ;

	clearGoals( "aramis" ) ;
	place_aramisA( "aramis" ) ;

	local marker = addMarkerCharacter( name, true, getString( "mp36m1" ), "aramis" ) ;

	waitForTalk( "dartagnan", "aramis", false ) ;
	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp36d1" ) ) ;
	sayAndWait( "aramis", getString( "mp36d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mp36d3" ) ) ;
	sayAndWait( "aramis", getString( "mp36d4" ) ) ;
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "aramis", false ) ;

	completeMission( name ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis37( name )
	-- Get Porthos' help
	DEBUG_OUTPUT( name .. " started" ) ;
	
	clearGoals( "porthos" ) ;
	place_porthosA( "porthos" ) ;

	local marker = addMarkerCharacter( name, true, getString( "mp37m1" ), "porthos" ) ;

	waitForTalk( "dartagnan", "porthos", false ) ;
	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp37d1" ) ) ;
	sayAndWait( "porthos", getString( "mp37d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mp37d3" ) ) ;
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	
	completeMission( name ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis38( name )
	-- Get Athos' help
	DEBUG_OUTPUT( name .. " started" ) ;
	
	clearGoals( "athos" ) ;
	place_athosA( "athos" ) ;

	local marker = addMarkerCharacter( name, true, getString( "mp38m1" ), "athos" ) ;

	waitForTalk( "dartagnan", "athos", false ) ;
	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	sayAndWait( "athos", getString( "mp38d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mp38d2" ) ) ;
	sayAndWait( "athos", getString( "mp38d3" ) ) ;
	sayAndWait( "dartagnan", getString( "mp38d4" ) ) ;
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	
	completeMission( name ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis39( name )
	-- musketeers walk over to city gate
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "essart", getString( "mp35d12" ) ) ;
		
	setMissionChatString( name, "treville", getString( "mp35d10" ) ) ;
	setMissionChatString( name, "athos", getString( "mp35d11" ) ) ;
	setMissionChatString( name, "porthos", getString( "mp35d11" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp35d11" ) ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", 3799, -536 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 2999, -1310, 5533, 503 } ) ;
		
	local triggerAreaA = addTriggerArea( name, "missionparis39LockOut", true, "france", 
		{ 4373, -1042, 4516, -302 } ) ;
	
	while ( ( not isMissionComplete( "missionparis36" ) )
		or ( not isMissionComplete( "missionparis37" ) )
		or ( not isMissionComplete( "missionparis38" ) ) ) do
		coroutine.yield( ) ;
	end ;
	
	local marker = addMarkerPosition( name, true, getString( "mp39m1" ), "france", 4125, -750 ) ;
		
	placeCharactersHorseClose( "athos" ) ;
	addGoalGetToPointInLevel( "athos", 4050, -750, "france", true, true ) ;	

	placeCharactersHorseClose( "porthos" ) ;
	addGoalGetToPointInLevel( "porthos", 4125, -750, "france", true, true ) ;	

	placeCharactersHorseClose( "aramis" ) ;
	addGoalGetToPointInLevel( "aramis", 4200, -750, "france", true, true ) ;
	
	placeCharactersHorseClose( "planchet" ) ;
	addGoalGetToPointInLevel( "planchet", 4100, -450, "france", true, true ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "planchet" ) ;

	removeMarker( name, marker ) ;
	
	removeTriggerArea( triggerAreaA ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
			
	completeMission( name ) ;
	activateMission( "missionparis40" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionparis39LockOut( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mp39d1" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp39d1" ) ) ;

	local playerX, playerY = getCharacterPos( "dartagnan" ) ;
	local x = playerX - 50 ;
	local y = playerY ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function execute_missionparis40( name )
	-- talk to musketeers before leaving
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "essart", getString( "mp35d12" ) ) ;
	
	setMissionChatString( name, "treville", getString( "mp35d10" ) ) ;
	
	local overrideSaveID = createOverrideSavePos( "france", 3799, -536 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 2999, -1310, 5533, 503 } ) ;
		
	local triggerAreaA = addTriggerArea( name, "missionparis39LockOut", true, "france", 
		{ 4373, -1042, 4516, -302 } ) ;
		
	local withinDist = 400.0 ;
	ensureCharacterAroundPoint( "athos", "france", 4050, -750, withinDist ) ;
	ensureCharacterAroundPoint( "porthos", "france", 4125, -750, withinDist ) ;
	ensureCharacterAroundPoint( "aramis", "france", 4200, -750, withinDist ) ;
	ensureCharacterAroundPoint( "planchet", "france", 4100, -450, withinDist ) ;
	
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "porthos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;

	setMissionFaceDirection( name, "athos", -1, 1 ) ;
	setMissionFaceDirection( name, "porthos", -1, 1 ) ;
	setMissionFaceDirection( name, "aramis", -1, 1 ) ;
	setMissionFaceDirection( name, "planchet", -1, -1 ) ;
	
	setMissionChatString( name, "planchet", getString( "mp40d4" ) ) ;

	local marker = addMarkerCharacter( name, true, getString( "mp39m1" ), "athos" ) ;
	waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mp40d1" ) ) ;
	
	playSound( "dropmoney", 0.5 ) ;
		
	removeTriggerArea( triggerAreaA ) ;
	
	if ( hasOwnedHorse( "dartagnan" ) ) then
		local bubInd = characterSay( "athos", true, -1, -1, false, getString( "mp41d1" ) ) ;
		waitForBubbleDone( bubInd ) ;
		setBubbleToBackgroundOpacity( bubInd ) ;
		local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mp41d2" ), getString( "mp41d3" ) ) ;
		local option = waitForBubbleOption( bubInd2 ) ;
		deleteBubble( bubInd ) ;
	
		setMissionFreezeGame( name, false ) ;
		setIgnoreFreeze( "athos", false ) ;
		setIgnoreFreeze( "porthos", false ) ;
		setIgnoreFreeze( "aramis", false ) ;

		setInventoryItem( "constance_money_pouch", 0 ) ;
	
		if ( option == 0 ) then
			-- player has horse and said he wants to leave now
			completeMission( name ) ;
			activateMission( "missionlondon1" ) ;
		else
			-- player has horse but doesn't want to leave now
			completeMission( name ) ;
			activateMission( "missionparis42" ) ;
		end
	else
		sayAndWait( "porthos", getString( "mp40d2" ) ) ;
		setMissionFreezeGame( name, false ) ;
		setIgnoreFreeze( "athos", false ) ;
		setIgnoreFreeze( "porthos", false ) ;
		setIgnoreFreeze( "aramis", false ) ;

		setInventoryItem( "constance_money_pouch", 0 ) ;
		
		completeMission( name ) ;
		activateMission( "missionparis41" ) ;
	end
		
	removeOverrideSavePos( overrideSaveID ) ;
			
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis41( name )
	-- Player needs to buy horse
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "essart", getString( "mp35d12" ) ) ;
	
	setMissionChatString( name, "treville", getString( "mp35d10" ) ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", 3799, -536 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 2999, -1310, 5533, 503 } ) ;
		
	local triggerAreaA = addTriggerArea( name, "missionparis39LockOut", true, "france", 
		{ 4373, -1042, 4516, -302 } ) ;
		
	local withinDist = 400.0 ;
	ensureCharacterAroundPoint( "athos", "france", 4050, -750, withinDist ) ;
	ensureCharacterAroundPoint( "porthos", "france", 4125, -750, withinDist ) ;
	ensureCharacterAroundPoint( "aramis", "france", 4200, -750, withinDist ) ;
	ensureCharacterAroundPoint( "planchet", "france", 4100, -450, withinDist ) ;
	
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "porthos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	setMissionFaceDirection( name, "athos", -1, 1 ) ;
	setMissionFaceDirection( name, "porthos", -1, 1 ) ;
	setMissionFaceDirection( name, "aramis", -1, 1 ) ;
	setMissionFaceDirection( name, "planchet", -1, -1 ) ;
	
	setMissionChatString( name, "athos", getString( "mp40d3" ) ) ;
	setMissionChatString( name, "porthos", getString( "mp40d3" ) ) ;
	setMissionChatString( name, "aramis", getString( "mp40d3" ) ) ;
	setMissionChatString( name, "planchet", getString( "mp40d4" ) ) ;
		
	local marker = addMarkerCharacter( name, true, getString( "mp40m1" ), "horsedealer1" ) ;
	
	while ( not hasOwnedHorse( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	removeTriggerArea( triggerAreaA ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
			
	completeMission( name ) ;
	activateMission( "missionparis42" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparis42( name )
	-- Meet with Musketeers again and leave Paris
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "essart", getString( "mp35d12" ) ) ;

	setMissionChatString( name, "treville", getString( "mp35d10" ) ) ;

	local overrideSaveID = createOverrideSavePos( "france", 3799, -536 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 2999, -1310, 5533, 503 } ) ;
	
	local withinDist = 400.0 ;
	ensureCharacterAroundPoint( "athos", "france", 4050, -750, withinDist ) ;
	ensureCharacterAroundPoint( "porthos", "france", 4125, -750, withinDist ) ;
	ensureCharacterAroundPoint( "aramis", "france", 4200, -750, withinDist ) ;
	ensureCharacterAroundPoint( "planchet", "france", 4100, -450, withinDist ) ;
	
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "porthos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
		
	setMissionFaceDirection( name, "planchet", -1, -1 ) ;
	
	setMissionChatString( name, "planchet", getString( "mp40d4" ) ) ;
	
	local doneLoop = false ;
	while ( not doneLoop ) do
		local triggerAreaA = addTriggerArea( name, "missionparis39LockOut", true, "france", 
			{ 4373, -1042, 4516, -302 } ) ;
	
		setMissionFaceDirection( name, "athos", -1, 1 ) ;
		setMissionFaceDirection( name, "porthos", -1, 1 ) ;
		setMissionFaceDirection( name, "aramis", -1, 1 ) ;
		
		local marker = addMarkerCharacter( name, true, getString( "mp39m1" ), "athos" ) ;
		waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
		removeMarker( name, marker ) ;
		
		setMissionFreezeGame( name, true ) ;
		setIgnoreFreeze( "athos", true ) ;
		setIgnoreFreeze( "porthos", true ) ;
		setIgnoreFreeze( "aramis", true ) ;
		setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
		setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
		setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
				
		removeTriggerArea( triggerAreaA ) ;
		
		if ( not hasOwnedHorse( "dartagnan" ) ) then
			sayAndWait( "porthos", getString( "mp40d2" ) ) ;
			setMissionFreezeGame( name, false ) ;
			setIgnoreFreeze( "athos", false ) ;
			setIgnoreFreeze( "porthos", false ) ;
			setIgnoreFreeze( "aramis", false ) ;
		else
			local bubInd = characterSay( "athos", true, -1, -1, false, getString( "mp41d1" ) ) ;
			waitForBubbleDone( bubInd ) ;
			setBubbleToBackgroundOpacity( bubInd ) ;
			local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mp41d2" ), getString( "mp41d3" ) ) ;
			local option = waitForBubbleOption( bubInd2 ) ;
			deleteBubble( bubInd ) ;
			setMissionFreezeGame( name, false ) ;
			setIgnoreFreeze( "athos", false ) ;
			setIgnoreFreeze( "porthos", false ) ;
			setIgnoreFreeze( "aramis", false ) ;
	
			if ( option == 0 ) then
				doneLoop = true ;
				
				completeMission( name ) ;
				activateMission( "missionlondon1" ) ;
			end
		end
	end
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionlondon1( name )
	-- 1st leg, lose Porthos
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "athos", getString( "ml1d14" ) ) ;
	setMissionChatString( name, "porthos", getString( "ml1d14" ) ) ;
	setMissionChatString( name, "aramis", getString( "ml1d14" ) ) ;
	
	-- create enemy
	local enemy1 = createTempCharacter( getString( "cardinalist" ), "stmartinhouse", -191, 20 ) ;
	setStatsCalculatorDynamic( enemy1, 0, 0, 1, 1000, 0.5 ) ;
	randomDressEnemy( enemy1, 1.0, 419771 ) ;
	setMeleeWeapon( enemy1, "sword_1" ) ;
	sitCharacter( enemy1, "stmartinchair1" ) ;
	
	local triggerAreaA = addTriggerArea( name, "missionlondon1LockOut1", true, "france", 
		{ 3773, -748, 3927, -322 } ) ;
	
	local triggerAreaB = addTriggerArea( name, "missionlondon1LockOut2", true, "france", 
		{ 5798, -3528, 6728, -4084, 5569, -3857, 6422, -4269 } ) ;
	
	local withinDist = 400.0 ;
	ensureCharacterAroundPoint( "athos", "france", 4050, -750, withinDist ) ;
	ensureCharacterAroundPoint( "porthos", "france", 4125, -750, withinDist ) ;
	ensureCharacterAroundPoint( "aramis", "france", 4200, -750, withinDist ) ;
	ensureCharacterAroundPoint( "planchet", "france", 4100, -450, withinDist ) ;
	
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "porthos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;

	local markerPosX = 6600 ;
	local markerPosY = -3212 ;
	local marker = addMarkerPosition( name, true, getString( "ml1m1" ), "france", markerPosX, markerPosY ) ;

	local destPosX = 6625 ;
	local destPosY = -3000 ;
	
	local athosDestPosX = 6550 ;
	local athosDestPosY = -3000 ;

	local porthosDestPosX = 6625 ;
	local porthosDestPosY = -3000 ;

	local aramisDestPosX = 6700 ;
	local aramisDestPosY = -3000 ;
	
	local planchetDestPosX = 6600 ;
	local planchetDestPosY = -3350 ;

	local startDist = 100 ;
	local stopDist = 50 ;
	local athosStartDist = startDist ;
	local athosStopDist = stopDist ;
	local porthosStartDist = startDist + 75 ;
	local porthosStopDist = stopDist + 85 ;
	local aramisStartDist = startDist + 150 ;
	local aramisStopDist = stopDist + 140 ;
	local planchetStartDist = startDist + 250 ;
	local planchetStopDist = stopDist + 255 ;
	
	while( not characterWithinOfPoint( "dartagnan", "france", markerPosX, markerPosY, 500.0 ) ) do
		local playerDestDist = distanceToPoint( "dartagnan", "france", destPosX, destPosY ) ;
		local aheadOfAthos = distanceToPoint( "athos", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfPorthos = distanceToPoint( "porthos", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfAramis = distanceToPoint( "aramis", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfPlanchet = distanceToPoint( "planchet", "france", destPosX, destPosY ) - playerDestDist ;
		
		-- Athos
		if ( aheadOfAthos > athosStartDist ) then
			-- start going
			if ( not characterHasGoal( "athos" ) ) then
				addGoalGetToPointInLevel( "athos", athosDestPosX, athosDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfAthos < athosStopDist ) then
			-- stop going
			clearGoals( "athos" ) ;
			setStateMessageIdle( "athos" ) ;
		end
		
		-- Porthos
		if ( aheadOfPorthos > porthosStartDist ) then
			-- start going
			if ( not characterHasGoal( "porthos" ) ) then
				addGoalGetToPointInLevel( "porthos", porthosDestPosX, porthosDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfPorthos < porthosStopDist ) then
			-- stop going
			clearGoals( "porthos" ) ;
			setStateMessageIdle( "porthos" ) ;
		end
		
		-- Aramis
		if ( aheadOfAramis > aramisStartDist ) then
			-- start going
			if ( not characterHasGoal( "aramis" ) ) then
				addGoalGetToPointInLevel( "aramis", aramisDestPosX, aramisDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfAramis < aramisStopDist ) then
			-- stop going
			clearGoals( "aramis" ) ;
			setStateMessageIdle( "aramis" ) ;
		end
		
		-- Planchet
		if ( aheadOfPlanchet > planchetStartDist ) then
			-- start going
			if ( not characterHasGoal( "planchet" ) ) then
				addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfPlanchet < planchetStopDist ) then
			-- stop going
			clearGoals( "planchet" ) ;
			setStateMessageIdle( "planchet" ) ;
		end
		
		coroutine.yield( ) ;
	end
	
	setMissionChatString( name, "planchet", getString( "ml1d23" ) ) ;
	setMissionChatString( name, "athos", getString( "ml1d15" ) ) ;
	setMissionChatString( name, "porthos", getString( "ml1d15" ) ) ;
	setMissionChatString( name, "aramis", getString( "ml1d15" ) ) ;
	setMissionChatString( name, enemy1, getString( "hellotraveller" ) ) ;

	if ( not characterHasGoal( "athos" ) ) then
		addGoalGetToPointInLevel( "athos", athosDestPosX, athosDestPosY, "france", true, true ) ;
	end
	if ( not characterHasGoal( "porthos" ) ) then
		addGoalGetToPointInLevel( "porthos", porthosDestPosX, porthosDestPosY, "france", true, true ) ;
	end
	if ( not characterHasGoal( "aramis" ) ) then
		addGoalGetToPointInLevel( "aramis", aramisDestPosX, aramisDestPosY, "france", true, true ) ;
	end
	if ( not characterHasGoal( "planchet" ) ) then
		addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
	end

	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	while( not characterWithinOfPoint( "dartagnan", "france", markerPosX, markerPosY, 300.0 ) ) do
		coroutine.yield( ) ;
	end

	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", markerPosX, markerPosY, "france", false, true ) ;
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "planchet" ) ;
	waitForNoGoal( "dartagnan" ) ;
	sayAndWait( "porthos", getString( "ml1d3" ) ) ;
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	
	addGoalSitInChair( "athos", "stmartinchair2", true, true ) ;
	addGoalSitInChair( "porthos", "stmartinchair3", true, true ) ;
	addGoalSitInChair( "aramis", "stmartinchair5", true, true ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "aramis" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "ml1m2" ), "athos" ) ;
	waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	addGoalSitInChair( "dartagnan", "stmartinchair4", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	sayAndWait( enemy1, getString( "ml1d4" ) ) ;
	sayAndWait( "porthos", getString( "ml1d5" ) ) ;
	
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	playSound( "eating", 1.0 ) ;
		
	wait( 1 ) ;
	
	-- fade from black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	placeCharacterInDoor( "planchet", "stmartinout", false ) ;
	addGoalGetToPointInLevel( "planchet", -112, 35, "stmartinhouse", false, true ) ;
	setMissionFaceDirection( name, "planchet", 0, -1 ) ;
	
	sayAndWait( "porthos", getString( "ml1d6" ) ) ;
	
	waitForNoGoal( "planchet" ) ;
	
	sayAndWait( "planchet", getString( "ml1d7" ) ) ;
	sayAndWait( "porthos", getString( "ml1d8" ) ) ;
	
	addGoalGetToPointInLevel( "porthos", -138, -104, "stmartinhouse", false, true ) ;
	addGoalGetToPointInLevel( "athos", -196, -68, "stmartinhouse", false, true ) ;
	addGoalGetToPointInLevel( "dartagnan", -137, 31, "stmartinhouse", false, true ) ;
	addGoalGetToPointInLevel( "aramis", -70, 29, "stmartinhouse", false, true ) ;
	addGoalGetToPointInLevel( enemy1, -251, -104, "stmartinhouse", false, true ) ;
	
	placeCharactersHorseClose( "planchet" ) ;
	addGoalGetToLevel( "planchet", "france", false, true ) ;
	addGoalDriveVehicle( "planchet", getCharacterOwnedHorseName( "planchet" ), true ) ;
	addGoalGetToPointInLevel( "planchet", 6623, -3369, "france", true, true ) ;
	
	setMissionFaceCharacter( name, "athos", enemy1 ) ;
	setMissionFaceCharacter( name, "aramis", "porthos" ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	setMissionFaceCharacter( name, enemy1, "porthos" ) ;
	setMissionFaceCharacter( name, "porthos", enemy1 ) ;
	
	setMissionFaceDirection( name, "stmartinkeeper", -1, 1 ) ;
		
	waitForNoGoal( enemy1 ) ;
	sayAndWait( enemy1, getString( "ml1d9" ) ) ;
	waitForNoGoal( "porthos" ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	sayAndWait( "porthos", getString( "ml1d10" ) ) ;
	
	local tenseLocalMusicID = addLocalMusicInner( "intense", "stmartinhouse", -100000, -100000, 100000, 100000, 15 ) ;
	
	setMissionFaceCharacter( name, "athos", enemy1 ) ;
	sayAndWait( enemy1, getString( "ml1d11" ) ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	sayAndWait( "porthos", getString( "ml1d12" ) ) ;
		
	setMissionFaceCharacter( name, "athos", enemy1 ) ;
	waitForNoGoal( "athos" ) ;
	drawMeleeWeapon( enemy1, true ) ;
	wait( 1.5 ) ;

	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	local bubInd = characterSay( "athos", true, -1, -1, true, getString( "ml1d13" ) ) ;
	while ( isBubbleOpen( bubInd ) ) do
		-- keep sword drawn until athos speaks
		drawMeleeWeapon( enemy1, true ) ;
		coroutine.yield( ) ;
	end
	deleteBubble( bubInd ) ;

	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "dartagnan" ) ;

	makeEnemies( "porthos", enemy1 ) ;
	setCharacterSlowDamage( "porthos", true ) ;
	setCharacterSlowDamage( enemy1, true ) ;
	
	placeCharactersHorseClose( "athos" ) ;
	addGoalGetToLevel( "athos", "france", false, true ) ;
	addGoalDriveVehicle( "athos", getCharacterOwnedHorseName( "athos" ), true ) ;
	addGoalGetToPointInLevel( "athos", 6550, -3074, "france", true, true ) ;
	
	placeCharactersHorseClose( "aramis" ) ;
	addGoalGetToLevel( "aramis", "france", false, true ) ;
	addGoalDriveVehicle( "aramis", getCharacterOwnedHorseName( "aramis" ), true ) ;
	addGoalGetToPointInLevel( "aramis", 6661, -3101, "france", true, true ) ;

	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;	
	setMissionFaceNone( name, "dartagnan" ) ;

	unlockPlayerInPlace( ) ;
	
	setMissionChatString( name, "athos", getString( "ml1d16" ) ) ;
	setMissionChatString( name, "aramis", getString( "ml1d16" ) ) ;
	setMissionChatString( name, "porthos", getString( "ml1d17" ) ) ;
	setMissionChatString( name, enemy1, getString( "ml1d18" ) ) ;
	setMissionChatNone( name, "planchet" ) ;
	
	setMissionChatString( name, "stmartinkeeper", getString( "ml1d19" ) ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "planchet" ) ;
	
	local markerPosX = 6598 ;
	local markerPosY = -3098 ;
	local marker = addMarkerPosition( name, true, getString( "ml2m1" ), "france", markerPosX, markerPosY ) ;
		
	--while( not characterWithinOfPoint( "dartagnan", "france", markerPosX, markerPosY, 300.0 ) ) do
	--	coroutine.yield( ) ;
	--end
	
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "france" ) ) do
		coroutine.yield( ) ;
	end
	
	--DEBUG_OUTPUT( "Within dist!" ) ;
	
	removeMarker( name, marker ) ;
		
	setRatioHealth( "porthos", 1.0 ) ;
	setCharacterSlowDamage( "porthos", false ) ;
	deleteTempCharacter( enemy1 ) ;
	
	removeTriggerArea( triggerAreaA ) ;
	removeTriggerArea( triggerAreaB ) ;
		
	removeLocalMusic( "stmartinhouse", tenseLocalMusicID ) ;
			
	completeMission( name ) ;
	activateMission( "missionlondon2" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionlondon1LockOut1( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "ml1d1" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "ml1d1" ) ) ;
	
	local x = 4022 ;
	local y = -558 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function missionlondon1LockOut2( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "ml1d2" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "ml1d2" ) ) ;

	local x = 6299 ;
	local y = -3718 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function execute_missionlondon2( name )
	-- 2nd leg, get to point and wait for Porthos, then get past Road workers
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "athos", getString( "ml1d20" ) ) ;
	setMissionChatString( name, "aramis", getString( "ml1d20" ) ) ;
		
	local doorLockA = addDoorLock( name, "missionlondon2LockOut3", true, "stmartinout" ) ;
	
	local triggerAreaA = addTriggerArea( name, "missionlondon2LockOut1", true, "france", 
		{ 5880, -2751, 6894, -2407, 6651, -1849, 5473, -2646 } ) ;
	
	local triggerAreaB = addTriggerArea( name, "", false, "france", 
		{ 3816, -5628, 4919, -5645, 4957, -5532, 3932, -4834 } ) ;

	local withinDist = 400.0 ;
	ensureCharacterAroundPoint( "athos", "france", 6550, -3074, withinDist ) ;
	ensureCharacterAroundPoint( "aramis", "france", 6661, -3101, withinDist ) ;
	ensureCharacterAroundPoint( "planchet", "france", 6623, -3369, withinDist ) ;
	
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;


	local destPosX = 4466 ;
	local destPosY = -5487 ;
	local marker = addMarkerPosition( name, true, getString( "ml2m1" ), "france", destPosX, destPosY ) ;

	local athosDestPosX = destPosX - 50 ;
	local athosDestPosY = destPosY + 125 ;

	local aramisDestPosX = destPosX + 50 ;
	local aramisDestPosY = destPosY + 125 ;
	
	local planchetDestPosX = destPosX ;
	local planchetDestPosY = destPosY + 225 ;

	local startDist = 100 ;
	local stopDist = 50 ;
	local athosStartDist = startDist ;
	local athosStopDist = stopDist ;
	local aramisStartDist = startDist + 75 ;
	local aramisStopDist = stopDist + 85 ;
	local planchetStartDist = startDist + 180 ;
	local planchetStopDist = stopDist + 170 ;
	
	while( not triggerAreaTriggered( triggerAreaB ) ) do
		local playerDestDist = distanceToPoint( "dartagnan", "france", destPosX, destPosY ) ;
		local aheadOfAthos = distanceToPoint( "athos", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfAramis = distanceToPoint( "aramis", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfPlanchet = distanceToPoint( "planchet", "france", destPosX, destPosY ) - playerDestDist ;
		
		-- Athos
		if ( aheadOfAthos > athosStartDist ) then
			-- start going
			if ( not characterHasGoal( "athos" ) ) then
				addGoalGetToPointInLevel( "athos", athosDestPosX, athosDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfAthos < athosStopDist ) then
			-- stop going
			clearGoals( "athos" ) ;
			setStateMessageIdle( "athos" ) ;
		end
		
		-- Aramis
		if ( aheadOfAramis > aramisStartDist ) then
			-- start going
			if ( not characterHasGoal( "aramis" ) ) then
				addGoalGetToPointInLevel( "aramis", aramisDestPosX, aramisDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfAramis < aramisStopDist ) then
			-- stop going
			clearGoals( "aramis" ) ;
			setStateMessageIdle( "aramis" ) ;
		end
		
		-- Planchet
		if ( aheadOfPlanchet > planchetStartDist ) then
			-- start going
			if ( not characterHasGoal( "planchet" ) ) then
				addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfPlanchet < planchetStopDist ) then
			-- stop going
			clearGoals( "planchet" ) ;
			setStateMessageIdle( "planchet" ) ;
		end
		
		coroutine.yield( ) ;
	end

	if ( not characterHasGoal( "athos" ) ) then
		addGoalGetToPointInLevel( "athos", athosDestPosX, athosDestPosY, "france", true, true ) ;
	end
	if ( not characterHasGoal( "aramis" ) ) then
		addGoalGetToPointInLevel( "aramis", aramisDestPosX, aramisDestPosY, "france", true, true ) ;
	end
	if ( not characterHasGoal( "planchet" ) ) then
		addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
	end

	removeTriggerArea( triggerAreaB ) ;

	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "planchet", true ) ;	
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", destPosX, destPosY, "france", false, true ) ;
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "planchet" ) ;
	waitForNoGoal( "dartagnan" ) ;

	local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "ml2d3" ), getString( "ml2d4" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 0 ) then
		
		-- fade to black
		local fadeTime = 0.5 ;
		setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
		fadeToColour( fadeTime ) ;
		while ( isFading( ) ) do
			coroutine.yield( ) ;
		end
		
		wait( 1 ) ;
			
		-- fade from black
		local fadeTime = 0.5 ;
		setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
		fadeFromColour( fadeTime ) ;
		while ( isFading( ) ) do
			coroutine.yield( ) ;
		end
		
		sayAndWait( "athos", getString( "ml2d5" ) ) ;
		sayAndWait( "aramis", getString( "ml2d6" ) ) ;
	else
		sayAndWait( "aramis", getString( "ml2d7" ) ) ;
	end


	-- place "road workers"
	local groupX = 4507 ;
	local groupY = -6252 ;
	local enemy1 = createTempCharacter( getString( "roadworker" ), "france", groupX - 100, groupY - 20 ) ;
	setStatsCalculatorStatic( enemy1, 15, 15, 15, 15 ) ;
	randomDressEnemy( enemy1, 0.0, 45311 ) ;
	
	local enemy2 = createTempCharacter( getString( "roadworker" ), "france", groupX - 60, groupY + 10 ) ;
	setStatsCalculatorStatic( enemy2, 15, 15, 15, 15 ) ;
	randomDressEnemy( enemy2, 0.0, 1399 ) ;

	local enemy3 = createTempCharacter( getString( "roadworker" ), "france", groupX - 0, groupY - 25 ) ;
	setStatsCalculatorStatic( enemy3, 15, 15, 15, 15 ) ;
	randomDressEnemy( enemy3, 0.0, 4678111 ) ;
	
	local enemy4 = createTempCharacter( getString( "roadworker" ), "france", groupX + 20, groupY + 10 ) ;
	setStatsCalculatorStatic( enemy4, 15, 15, 15, 15 ) ;
	randomDressEnemy( enemy4, 0.0, 1144 ) ;
	
	local enemy5 = createTempCharacter( getString( "roadworker" ), "france", groupX + 60, groupY - 50 ) ;
	setStatsCalculatorStatic( enemy5, 15, 15, 15, 15 ) ;
	randomDressEnemy( enemy5, 0.0, 77895 ) ;
	
	local enemy6 = createTempCharacter( getString( "roadworker" ), "france", groupX +60, groupY + 40 ) ;
	setStatsCalculatorStatic( enemy6, 15, 15, 15, 15 ) ;
	randomDressEnemy( enemy6, 0.0, 333312 ) ;
	
	local enemy7 = createTempCharacter( getString( "roadworker" ), "france", groupX +30, groupY - 70 ) ;
	setStatsCalculatorStatic( enemy7, 15, 15, 15, 15 ) ;
	randomDressEnemy( enemy7, 0.0, 771366 ) ;
	
	local enemy8 = createTempCharacter( getString( "roadworker" ), "france", groupX -20, groupY - 60 ) ;
	setStatsCalculatorStatic( enemy8, 15, 15, 15, 15 ) ;
	randomDressEnemy( enemy8, 0.0, 987441 ) ;

	setMissionFaceCharacter( name, enemy1, "dartagnan" ) ;
	setMissionFaceCharacter( name, enemy2, "dartagnan" ) ;
	setMissionFaceCharacter( name, enemy3, "dartagnan" ) ;
	setMissionFaceCharacter( name, enemy4, "dartagnan" ) ;
	setMissionFaceCharacter( name, enemy5, "dartagnan" ) ;
	setMissionFaceCharacter( name, enemy6, "dartagnan" ) ;
	setMissionFaceCharacter( name, enemy7, "dartagnan" ) ;
	setMissionFaceCharacter( name, enemy8, "dartagnan" ) ;

	setMissionFaceCharacter( name, "dartagnan", enemy3 ) ;
	setMissionFaceCharacter( name, "athos", enemy3 ) ;
	setMissionFaceCharacter( name, "aramis", enemy5 ) ;
	setMissionFaceCharacter( name, "planchet", enemy5 ) ;

	setIgnoreFreeze( enemy1, true ) ;
	setIgnoreFreeze( enemy2, true ) ;
	setIgnoreFreeze( enemy3, true ) ;
	setIgnoreFreeze( enemy4, true ) ;
	setIgnoreFreeze( enemy5, true ) ;
	setIgnoreFreeze( enemy6, true ) ;
	setIgnoreFreeze( enemy7, true ) ;
	setIgnoreFreeze( enemy8, true ) ;

	local dartPosX = 4464 ;
	local dartPosY = -6117 ;

	addGoalGetToPointInLevel( "dartagnan", dartPosX, dartPosY, "france", false, true ) ;
	addGoalGetToPointInLevel( "athos", dartPosX - 30, dartPosY + 100, "france", true, true ) ;
	addGoalGetToPointInLevel( "aramis", dartPosX + 30, dartPosY + 100, "france", true, true ) ;
	addGoalGetToPointInLevel( "planchet", dartPosX, dartPosY + 200, "france", true, true ) ;
	
	wait( 2 ) ;
	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	waitForNoGoal( "dartagnan" ) ;
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "planchet" ) ;

	sayAndWait( "aramis", getString( "ml2d8" ) ) ;
	sayAndWait( enemy3, getString( "ml2d9" ) ) ;
	sayAndWait( "aramis", getString( "ml2d10" ) ) ;
	sayAndWait( enemy3, getString( "ml2d11" ) ) ;

	local gunPosX = 4300 ;
	local gunPosY = -6141 ;
	addGoalGetToPointInLevel( enemy1, gunPosX, gunPosY, "france", false, true ) ;
	wait( 0.05 ) ;
	addGoalGetToPointInLevel( enemy2, gunPosX, gunPosY + 40, "france", false, true ) ;
	wait( 0.05 ) ;
	addGoalGetToPointInLevel( enemy3, gunPosX, gunPosY + 80, "france", false, true ) ;
	wait( 0.05 ) ;
	addGoalGetToPointInLevel( enemy4, gunPosX, gunPosY + 120, "france", false, true ) ;
	wait( 0.05 ) ;
	addGoalGetToPointInLevel( enemy5, 4630, -6000, "france", false, true ) ;
	wait( 0.05 ) ;
	addGoalGetToPointInLevel( enemy6, 4630, -5920, "france", false, true ) ;
	wait( 0.05 ) ;
	addGoalGetToPointInLevel( enemy7, 4630, -6060, "france", false, true ) ;
	wait( 0.05 ) ;
	addGoalGetToPointInLevel( enemy8, gunPosX, gunPosY - 40, "france", false, true ) ;
	
	waitForNoGoal( enemy1 ) ;
	waitForNoGoal( enemy2 ) ;
	waitForNoGoal( enemy3 ) ;
	waitForNoGoal( enemy4 ) ;
	waitForNoGoal( enemy5 ) ;
	waitForNoGoal( enemy6 ) ;
	waitForNoGoal( enemy7 ) ;
	waitForNoGoal( enemy8 ) ;
	
	setIgnoreAll( "aramis", true ) ; -- aramis shouldn't start attacking them
		
	setCharacterSlowDamage( "dartagnan", true ) ;
	setCharacterSlowDamage( "athos", true ) ;
	setCharacterSlowDamage( "aramis", true ) ;
	setCharacterSlowDamage( "planchet", true ) ;
	
	
	setRangedWeapon( enemy1, "musket_matchlock_1" ) ;
	setRangedWeapon( enemy2, "musket_matchlock_1" ) ;
	wait( 0.2 ) ;
	setRangedWeapon( enemy3, "musket_matchlock_1" ) ;
	wait( 0.1 ) ;
	setRangedWeapon( enemy4, "musket_matchlock_1" ) ;
	setRangedWeapon( enemy5, "musket_matchlock_1" ) ;
	setRangedWeapon( enemy6, "musket_matchlock_1" ) ;
	setRangedWeapon( enemy7, "musket_matchlock_1" ) ;
	setRangedWeapon( enemy8, "musket_matchlock_1" ) ;
	
	setRangedLoadedRatio( enemy1, 1.0 ) ;
	setRangedLoadedRatio( enemy2, 0.99 ) ;
	setRangedLoadedRatio( enemy3, 0.98 ) ;
	setRangedLoadedRatio( enemy4, 0.5 ) ;
	setRangedLoadedRatio( enemy5, 0.3 ) ;
	setRangedLoadedRatio( enemy6, 0.1 ) ;
	setRangedLoadedRatio( enemy7, 0.995 ) ;
	setRangedLoadedRatio( enemy8, 0.6 ) ;
	
	removeMusic( tenseMusicID ) ;
		
	makeEnemies( enemy1, "aramis" ) ;
	makeEnemies( enemy2, "dartagnan" ) ;
	makeEnemies( enemy3, "aramis" ) ;
	makeEnemies( enemy4, "dartagnan" ) ;
	makeEnemies( enemy5, "aramis" ) ;
	makeEnemies( enemy6, "aramis" ) ;
	makeEnemies( enemy7, "aramis" ) ;
	makeEnemies( enemy8, "aramis" ) ;

	wait( 1 ) ;
			
	setRatioHealth( "aramis", 0.1 ) ;
	sayAndWait( "dartagnan", getString( "ml2d12" ) ) ;

	makeNotEnemies( enemy1, "aramis", "dartagnan" ) ;
	makeNotEnemies( enemy2, "aramis", "dartagnan" ) ;
	makeNotEnemies( enemy3, "aramis", "dartagnan" ) ;
	makeNotEnemies( enemy4, "aramis", "dartagnan" ) ;
	makeNotEnemies( enemy5, "aramis", "dartagnan" ) ;
	makeNotEnemies( enemy6, "aramis", "dartagnan" ) ;
	makeNotEnemies( enemy7, "aramis", "dartagnan" ) ;
	makeNotEnemies( enemy8, "aramis", "dartagnan" ) ;

	setStateMessageIdle( enemy1 ) ;
	setStateMessageIdle( enemy2 ) ;
	setStateMessageIdle( enemy3 ) ;
	setStateMessageIdle( enemy4 ) ;
	setStateMessageIdle( enemy5 ) ;
	setStateMessageIdle( enemy6 ) ;
	setStateMessageIdle( enemy7 ) ;
	setStateMessageIdle( enemy8 ) ;

	setIgnoreAll( "aramis", false ) ;

	makeEnemies( "dartagnan", enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7, enemy8 ) ;
	setCharacterSlowDamage( "dartagnan", false ) ;

	-- everyone ride off
	setMissionFaceNone( name, "dartagnan" ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;
	
	--local bubInd = characterSay( "aramis", true, -1, 300.0, true, getString( "ml2d13" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterSay( "aramis", false, 6.0, 300.0, true, getString( "ml2d13" ) ) ;
	autoDeleteBubble( bubInd ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	setIgnoreFreeze( enemy1, false ) ;
	setIgnoreFreeze( enemy2, false ) ;
	setIgnoreFreeze( enemy3, false ) ;
	setIgnoreFreeze( enemy4, false ) ;
	setIgnoreFreeze( enemy5, false ) ;
	setIgnoreFreeze( enemy6, false ) ;
	setIgnoreFreeze( enemy7, false ) ;
	setIgnoreFreeze( enemy8, false ) ;

	setCharacterSlowDamage( "dartagnan", false ) ;
	setCharacterSlowDamage( "athos", false ) ;
	setCharacterSlowDamage( "aramis", false ) ;
	setCharacterSlowDamage( "planchet", false ) ;
	
	setMissionChatString( name, "athos", getString( "ml1d21" ) ) ;
	setMissionChatString( name, "aramis", getString( "ml1d21" ) ) ;
		
	local destPosX = 4705 ;
	local destPosY = -8878 ;
	local marker = addMarkerPosition( name, true, getString( "ml2m1" ), "france", destPosX, destPosY ) ;
	
	addGoalGetToPointInLevel( "athos", destPosX - 50, destPosY + 75, "france", true, true ) ;
	addGoalGetToPointInLevel( "aramis", destPosX + 50, destPosY + 75, "france", true, true ) ;
	addGoalGetToPointInLevel( "planchet", destPosX, destPosY + 150, "france", true, true ) ;
	
	local triggerAreaB = addTriggerArea( name, "", false, "france", 
		{ 3869, -8610, 5107, -8445 } ) ;
	
	while( not triggerAreaTriggered( triggerAreaB ) ) do
		coroutine.yield( ) ;
	end
	
	removeTriggerArea( triggerAreaB ) ;
	removeMarker( name, marker ) ;
		
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "planchet", true ) ;	
	
	setStateMessageIdle( "dartagnan" ) ;
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	addGoalGetToPointInLevel( "dartagnan", destPosX, destPosY, "france", false, true ) ;
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "planchet" ) ;
	waitForNoGoal( "dartagnan" ) ;

	sayAndWait( "athos", getString( "ml2d14" ) ) ;
	sayAndWait( "aramis", getString( "ml2d15" ) ) ;

	addGoalGetToLevel( "aramis", "crevecoeurhousea", false, true ) ;
	
	sayAndWait( "athos", getString( "ml2d16" ) ) ;
	
	waitForNoGoal( "aramis" ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	
	deleteTempCharacter( enemy1 ) ;
	deleteTempCharacter( enemy2 ) ;
	deleteTempCharacter( enemy3 ) ;
	deleteTempCharacter( enemy4 ) ;
	deleteTempCharacter( enemy5 ) ;
	deleteTempCharacter( enemy6 ) ;
	deleteTempCharacter( enemy7 ) ;
	deleteTempCharacter( enemy8 ) ;
	
	removeDoorLock( doorLockA ) ;
	removeTriggerArea( triggerAreaA ) ;
			
	completeMission( name ) ;
	activateMission( "missionlondon3" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionlondon2LockOut1( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "notwaylondon" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "notwaylondon" ) ) ;
	
	local x = 6473 ;
	local y = -2651 ;
	
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end

function missionlondon2LockOut3( )
	--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "ml2d1" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "ml2d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
end

function execute_missionlondon3( name )
	-- 3rd leg, get to Amiens, sleep, lose Athos for suspected counterfitting
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "athos", getString( "ml1d14" ) ) ;
	
	local doorLockA = addDoorLock( name, "missionlondon3LockOut3", true, "crevecoeurhouseaout" ) ;
	
	local triggerAreaA = addTriggerArea( name, "missionlondon3LockOut1", true, "france", 
		{ 3943, -8449, 5155, -8112 } ) ;

	local triggerAreaB = addTriggerArea( name, "missionlondon3LockOut2", true, "france", 
		{ 6405, -13865, 7863, -13527 } ) ;
	
	local triggerAreaC = addTriggerArea( name, "", false, "france", 
		{ 6421, -12147, 7778, -12000 } ) ;

	local withinDist = 400.0 ;
	ensureCharacterAroundPoint( "athos", "france", 4655, -8803, withinDist ) ;
	ensureCharacterAroundPoint( "planchet", "france", 4705, -8728, withinDist ) ;
	
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;
		
	local destPosX = 7245 ;
	local destPosY = -12542 ;
	local marker = addMarkerPosition( name, true, getString( "ml3m1" ), "france", destPosX, destPosY ) ;

	local athosDestPosX = destPosX - 75 ;
	local athosDestPosY = destPosY + 75 ;

	local planchetDestPosX = destPosX + 75 ;
	local planchetDestPosY = destPosY + 75 ;

	local startDist = 100 ;
	local stopDist = 50 ;
	local athosStartDist = startDist ;
	local athosStopDist = stopDist ;
	local planchetStartDist = startDist + 75 ;
	local planchetStopDist = stopDist + 85 ;
	
	while( not triggerAreaTriggered( triggerAreaC ) ) do
		local playerDestDist = distanceToPoint( "dartagnan", "france", destPosX, destPosY ) ;
		local aheadOfAthos = distanceToPoint( "athos", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfPlanchet = distanceToPoint( "planchet", "france", destPosX, destPosY ) - playerDestDist ;
		
		-- Athos
		if ( aheadOfAthos > athosStartDist ) then
			-- start going
			if ( not characterHasGoal( "athos" ) ) then
				addGoalGetToPointInLevel( "athos", athosDestPosX, athosDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfAthos < athosStopDist ) then
			-- stop going
			clearGoals( "athos" ) ;
			setStateMessageIdle( "athos" ) ;
		end
		
		-- Planchet
		if ( aheadOfPlanchet > planchetStartDist ) then
			-- start going
			if ( not characterHasGoal( "planchet" ) ) then
				addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfPlanchet < planchetStopDist ) then
			-- stop going
			clearGoals( "planchet" ) ;
			setStateMessageIdle( "planchet" ) ;
		end
		
		coroutine.yield( ) ;
	end

	if ( not characterHasGoal( "athos" ) ) then
		addGoalGetToPointInLevel( "athos", athosDestPosX, athosDestPosY, "france", true, true ) ;
	end
	if ( not characterHasGoal( "planchet" ) ) then
		addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
	end

	removeTriggerArea( triggerAreaC ) ;

	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "planchet", true ) ;	
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", destPosX, destPosY, "france", false, true ) ;
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "planchet" ) ;
	waitForNoGoal( "dartagnan" ) ;

	sayAndWait( "athos", getString( "ml3d4" ) ) ;

	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	
	setMissionChatString( name, "athos", getString( "ml1d22" ) ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	addGoalGetToPointInLevel( "athos", -190, 9, "lirdorhouse", true, true ) ;
	addGoalGetToPointInLevel( "planchet", -124, 71, "lirdorhouse", true, true ) ;
	
	setMissionFaceCharacter( name, "athos", "lirdorkeeper" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "ml3m2" ), "lirdorkeeper" ) ;
	waitForTalk( "dartagnan", "lirdorkeeper", false ) ;
	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "planchet" ) ;
	sayAndWait( "dartagnan", getString( "ml3d5" ) ) ;
	sayAndWait( "lirdorkeeper", getString( "ml3d6" ) ) ;
	sayAndWait( "athos", getString( "ml3d7" ) ) ;
	sayAndWait( "lirdorkeeper", getString( "ml3d8" ) ) ;
	
	-- put enemies outside - ready to come in
	local enemy1 = createTempCharacter( getString( "thug" ), "france", 0, 0 ) ;
	setStatsCalculatorDynamic( enemy1, 0, 0, 1, 1000, 0.5 ) ;
	randomDressEnemy( enemy1, 0.5, 1347776 ) ;
	setMeleeWeapon( enemy1, "sword_1" ) ;
	setRangedWeapon( enemy1, "musket_matchlock_1" ) ;
	setMissionFaceCharacter( name, enemy1, "athos" ) ;
	
	local enemy2 = createTempCharacter( getString( "thug" ), "france", 0, 0 ) ;
	setStatsCalculatorDynamic( enemy2, 0, 0, 1, 1000, 0.5 ) ;
	randomDressEnemy( enemy2, 0.5, 13577 ) ;
	setMeleeWeapon( enemy2, "sword_1" ) ;
	setRangedWeapon( enemy2, "musket_matchlock_1" ) ;
	setMissionFaceCharacter( name, enemy2, "athos" ) ;

	local enemy3 = createTempCharacter( getString( "thug" ), "france", 0, 0 ) ;
	setStatsCalculatorDynamic( enemy3, 0, 0, 1, 1000, 0.5 ) ;
	randomDressEnemy( enemy3, 0.5, 134726 ) ;
	setMeleeWeapon( enemy3, "sword_1" ) ;
	setRangedWeapon( enemy3, "musket_matchlock_1" ) ;
	setMissionFaceCharacter( name, enemy3, "athos" ) ;

	local enemy4 = createTempCharacter( getString( "thug" ), "france", 0, 0 ) ;
	setStatsCalculatorDynamic( enemy4, 0, 0, 1, 1000, 0.5 ) ;
	randomDressEnemy( enemy4, 0.5, 1341176 ) ;
	setMeleeWeapon( enemy4, "sword_1" ) ;
	setRangedWeapon( enemy4, "musket_matchlock_1" ) ;
	setMissionFaceCharacter( name, enemy4, "athos" ) ;
	
	local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "ml3d9" ), getString( "ml3d10" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 0 ) then
		-- sleep in private rooms - fail game
		setMissionFaceDirection( name, "dartagnan", 1, 0 ) ;
		setMissionFaceDirection( name, "athos", -1, 0 ) ;
		addGoalGetToPointInLevel( "dartagnan", 154, -43, "lirdorhouse", false, true ) ;
		addGoalGetToPointInLevel( "athos", 203, 205, "lirdorhouse", false, true ) ;
		waitForNoGoal( "dartagnan" ) ;
		waitForNoGoal( "athos" ) ;
		
		-- fade to black
		local fadeTime = 0.5 ;	
		setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
		fadeToColour( fadeTime ) ;
		while ( isFading( ) ) do
			coroutine.yield( ) ;
		end
		playSound( "snoring", 1.0 ) ;
		wait( 2 ) ;
		
		failGame( getString( "ml3d11" ) ) ;
		
		while ( true ) do
			coroutine.yield( ) ;
		end
		
	else
		-- sleep in common room
		sayAndWait( "lirdorkeeper", getString( "ml3d12" ) ) ;
		
		setMissionFaceDirection( name, "dartagnan", 0, -1 ) ;
		setMissionFaceDirection( name, "athos", 0, -1 ) ;
		setMissionFaceDirection( name, "planchet", 0, 1 ) ;
		addGoalGetToPointInLevel( "dartagnan", -131, 252, "lirdorhouse", false, true ) ;
		addGoalGetToPointInLevel( "athos", -266, 259, "lirdorhouse", false, true ) ;
		addGoalGetToPointInLevel( "planchet", -207, 184, "lirdorhouse", false, true ) ;
		waitForNoGoal( "planchet" ) ;
		sayAndWait( "planchet", getString( "ml3d13" ) ) ;

		waitForNoGoal( "dartagnan" ) ;
		waitForNoGoal( "athos" ) ;
		
		-- fade to black
		local fadeTime = 0.5 ;	
		setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
		fadeToColour( fadeTime ) ;
		while ( isFading( ) ) do
			coroutine.yield( ) ;
		end
		
		playSound( "snoring", 1.0 ) ;
		wait( 2.1 ) ;
		playSound( "snoring", 1.0 ) ;

		wait( 2 ) ;
		-- fade from black	
		local fadeTime = 0.5 ;
		setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
		fadeFromColour( fadeTime ) ;
		while ( isFading( ) ) do
			coroutine.yield( ) ;
		end	
		
		sayAndWait( "planchet", getString( "ml3d14" ) ) ;
		sayAndWait( "athos", getString( "ml3d15" ) ) ;
		
		setMissionFaceDirection( name, "dartagnan", -1, -1 ) ;
		setMissionFaceDirection( name, "athos", 0, -1 ) ;
		setMissionFaceDirection( name, "planchet", -1, -1 ) ;
		addGoalGetToPointInLevel( "dartagnan", 47, 174, "lirdorhouse", false, true ) ;
		addGoalGetToPointInLevel( "athos", -163, 3, "lirdorhouse", false, true ) ;
		
		placeCharactersHorseClose( "planchet" ) ;
		addGoalGetToLevel( "planchet", "france", false, true ) ;
		addGoalDriveVehicle( "planchet", getCharacterOwnedHorseName( "planchet" ), true ) ;
		
		waitForNoGoal( "athos" ) ;

		sayAndWait( "athos", getString( "ml3d16" ) ) ;
		
		local tenseMusicID = addMusic( "intense", 15 ) ;
			
		placeCharacterInDoor( enemy1, "lirdorin", false ) ;
		addGoalGetToPointInLevel( enemy1, -150, 50, "lirdorhouse", false, true ) ;
		
		wait( 1 ) ;
		placeCharacterInDoor( enemy2, "lirdorin", false ) ;
		addGoalGetToPointInLevel( enemy2, -120, 20, "lirdorhouse", false, true ) ;
		
		wait( 1 ) ;
		placeCharacterInDoor( enemy3, "lirdorin", false ) ;
		addGoalGetToPointInLevel( enemy3, -54, 47, "lirdorhouse", false, true ) ;
		
		wait( 1 ) ;
		placeCharacterInDoor( enemy4, "lirdorin", false ) ;
		addGoalGetToPointInLevel( enemy4, -98, 91, "lirdorhouse", false, true ) ;
		
		sayAndWait( "lirdorkeeper", getString( "ml3d17" ) ) ;
		sayAndWait( "athos", getString( "ml3d18" ) ) ;
		
		waitForNoGoal( enemy1 ) ;
		waitForNoGoal( enemy2 ) ;
		waitForNoGoal( enemy3 ) ;
		waitForNoGoal( enemy4 ) ;
		
		setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
		sayAndWait( "athos", getString( "ml3d19" ) ) ;

		setMissionFaceNone( name, "athos" ) ;
		setCharacterSlowDamage( "athos", true ) ;
		
		makeEnemies( "athos", enemy1, enemy2, enemy3, enemy4 ) ;
	
		placeCharactersHorseClose( "dartagnan" ) ;
		addGoalGetToLevel( "dartagnan", "france", false, true ) ;
		addGoalDriveVehicle( "dartagnan", getCharacterOwnedHorseName( "dartagnan" ), true ) ;

		waitForNoGoal( "dartagnan" ) ;
		waitForNoGoal( "planchet" ) ;
		
		removeMusic( tenseMusicID ) ;
	end
	
	unlockPlayerInPlace( ) ;

	setRatioHealth( "athos", 1.0 ) ;
	setCharacterSlowDamage( "athos", false ) ;
	deleteTempCharacter( enemy1 ) ;
	deleteTempCharacter( enemy2 ) ;
	deleteTempCharacter( enemy3 ) ;
	deleteTempCharacter( enemy4 ) ;
	
	removeDoorLock( doorLockA ) ;
	removeTriggerArea( triggerAreaA ) ;
	removeTriggerArea( triggerAreaB ) ;
			
	completeMission( name ) ;
	activateMission( "missionlondon4" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionlondon3LockOut1( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "needtolondon" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "needtolondon" ) ) ;
		
	local x = 4668 ;
	local y = -8536 ;
	
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end

function missionlondon3LockOut2( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "ml3d3" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "ml3d3" ) ) ;
		
	local x = 7163 ;
	local y = -13450 ;
	
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end

function missionlondon3LockOut3( )
	--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "ml3d2" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "ml3d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
end

function execute_missionlondon4( name )
	-- 4th leg, get to Calais
	DEBUG_OUTPUT( name .. " started" ) ;
	
	local doorLockA = addDoorLock( name, "missionlondon4LockOut3", true, "lirdorout" ) ;
	
	local triggerAreaA = addTriggerArea( name, "missionlondon4LockOut1", true, "france", 
		{ 6571, -12108, 7946, -11679 } ) ;

	local triggerAreaB = addTriggerArea( name, "missionlondon4LockOut2", true, "france", 
		{ 7157, -16156, 7849, -15290, 8215, -15853, 7275, -16519 } ) ;
	
	local withinDist = 400.0 ;
	ensureCharacterAroundPoint( "planchet", "france", 7489, -12437, withinDist ) ;
	
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;
	
	placeCharacter( "dewardes", "france", 4903, -18944 ) ;
	placeCharacter( "lubin", "france", 4855, -18907 ) ;
	setMissionFaceCharacter( name, "dewardes", "calaiscaptain" ) ;
	setMissionFaceCharacter( name, "lubin", "calaiscaptain" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "ml4m1" ), "calaiscaptain" ) ;
	
	local dartListenPosX = 5079 ;
	local dartListenPosY = -18879 ;
	
	local planchetDestPosX = dartListenPosX ;
	local planchetDestPosY = dartListenPosY + 50 ;

	local startDist = 100 ;
	local stopDist = 50 ;
	local planchetStartDist = startDist ;
	local planchetStopDist = stopDist ;
	
	local dist = 250.0
	while ( distanceBetweenCharacters( "dartagnan", "calaiscaptain" ) > dist ) do
		local playerDestDist = distanceBetweenCharacters( "dartagnan", "calaiscaptain" ) ;
		local aheadOfPlanchet = distanceBetweenCharacters( "planchet", "calaiscaptain" ) - playerDestDist ;
		
		-- Planchet
		if ( aheadOfPlanchet > planchetStartDist ) then
			-- start going
			if ( not characterHasGoal( "planchet" ) ) then
				addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfPlanchet < planchetStopDist ) then
			-- stop going
			clearGoals( "planchet" ) ;
			setStateMessageIdle( "planchet" ) ;
		end
		
		coroutine.yield( ) ;
	end

	if ( not characterHasGoal( "planchet" ) ) then
		addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
	end

	setMissionFaceCharacter( name, "dartagnan", "calaiscaptain" ) ;
	setMissionFaceCharacter( name, "planchet", "calaiscaptain" ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	setIgnoreFreeze( "dewardes", true ) ;
	setIgnoreFreeze( "lubin", true ) ;
	setIgnoreFreeze( "calaiscaptain", true ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", dartListenPosX, dartListenPosY, "france", false, true ) ;
	waitForNoGoal( "planchet" ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	setMissionFaceCharacter( name, "calaiscaptain", "dewardes" ) ;
	sayAndWait( "dewardes", getString( "ml4d2" ) ) ;
	sayAndWait( "calaiscaptain", getString( "ml4d3" ) ) ;
	sayAndWait( "dewardes", getString( "ml4d4" ) ) ;
	sayAndWait( "calaiscaptain", getString( "ml4d5" ) ) ;
	sayAndWait( "dewardes", getString( "ml4d6" ) ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan"  ) ;
	
	sayAndWait( "dartagnan", getString( "ml4d7" ) ) ;
	
	setMissionFaceNone( name, "calaiscaptain" ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	setIgnoreFreeze( "dewardes", false ) ;
	setIgnoreFreeze( "lubin", false ) ;
	setIgnoreFreeze( "calaiscaptain", false ) ;
	
	removeDoorLock( doorLockA ) ;
	removeTriggerArea( triggerAreaA ) ;
	removeTriggerArea( triggerAreaB ) ;
			
	completeMission( name ) ;
	activateMission( "missionlondon5" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionlondon4LockOut1( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "needtolondon" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "needtolondon" ) ) ;
	
	local x = 7196 ;
	local y = -12177 ;
	
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end

function missionlondon4LockOut2( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "notwaylondon" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "notwaylondon" ) ) ;
	
	local x = 7349 ;
	local y = -15682 ;
	
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end
	
	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end

function missionlondon4LockOut3( )
	--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "ml4d1" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "ml4d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
end

function execute_missionlondon5( name )
	-- Ambush Comte de Wardes in the forest and then talk to calais governor
	DEBUG_OUTPUT( name .. " started" ) ;
	
	local ointmentPosX = 5145 ;
	local ointmentPosY = -18821 ;
	if ( getDiedDuringMission( name ) >= 2 ) then
		createItem( "", "ointment", "france", ointmentPosX, ointmentPosY, false ) ;
		createItem( "", "ointment", "france", ointmentPosX + 20, ointmentPosY + 2, false ) ;
		createItem( "", "ointment", "france", ointmentPosX - 27, ointmentPosY - 2, false ) ;
		createItem( "", "ointment", "france", ointmentPosX, ointmentPosY + 23, false ) ;
		createItem( "", "ointment", "france", ointmentPosX + 2, ointmentPosY - 27, false ) ;
	end

	if ( getDiedDuringMission( name ) >= 3 ) then
		local ointmentPosX = 5145 ;
		local ointmentPosY = -18821 ;
		createItem( "", "ointment", "france", ointmentPosX + 45, ointmentPosY - 20, false ) ;
		createItem( "", "ointment", "france", ointmentPosX + 45, ointmentPosY, false ) ;
		createItem( "", "ointment", "france", ointmentPosX + 45, ointmentPosY + 20, false ) ;
	end
	
	
	setInventoryItem( "letter_calaisunsigned", 0 ) ;
	setInventoryItem( "letter_calaissigned", 0 ) ;
	
	local doorLockA = addDoorLock( name, "missionlondon5LockOut3", true, "boattoengland" ) ;
	
	local triggerAreaA = addTriggerArea( name, "missionlondon5LockOut1", true, "france", 
		{ 5890, -17472, 6975, -17215 } ) ;

	local withinDist = 400.0 ;
	ensureCharacterAroundPoint( "planchet", "france", 5079, -18829, withinDist ) ;
	
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	ensureCharacterAroundPoint( "dewardes", "france", 4903, -18944, withinDist ) ;
	ensureCharacterAroundPoint( "lubin", "france", 4855, -18907, withinDist ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "ml5m1" ), "dewardes" ) ;
	
	setMissionChatFunction( name, "dewardes", "chat_missionlondon5notyet" ) ;
	setMissionChatFunction( name, "lubin", "chat_missionlondon5notyet" ) ;
	
	addGoalGetToPointInLevel( "dewardes", 4302, -16976, "france", false, true ) ;
	wait( 1 ) ; -- let dewardes be in front
	addGoalGetToPointInLevel( "lubin", 4370, -16972, "france", false, true ) ;
	
	local enteredForest = false ;
	local waitingTalkNum1 = -1 ;
	local waitingTalkNum2 = -1 ;
	local chatInForest = false ;
	
	local destPosX = 4340 ;
	local destPosY = -16951 ;
	
	local planchetDestX = 4437 ;
	local planchetDestY = -16945 ;
	
	local startDist = 130 ;
	local stopDist = 80 ;
	local planchetStartDist = startDist ;
	local planchetStopDist = stopDist ;

	while( not chatInForest ) do
		if ( ( not enteredForest ) and ( distanceToPoint( "dewardes", "france", 4986, -17670 ) < 600.0 ) ) then
			DEBUG_OUTPUT( "entered" ) ;
			setMissionChatNone( name, "dewardes" ) ;
			setMissionChatNone( name, "lubin" ) ;
			enteredForest = true ;
			waitingTalkNum1 = setWaitingForTalk( "dartagnan", "dewardes", false ) ;
			waitingTalkNum2 = setWaitingForTalk( "dartagnan", "lubin", false ) ;
		end
		
		local endMissionDist = 600.0 ;
		if ( distanceToPoint( "dewardes", "france", 4333, -16972 ) < endMissionDist ) then
			failGame( getString( "ml5d3" ) ) ;

			while ( true ) do
				coroutine.yield( ) ;
			end
		end

			
		local playerDestDist = distanceToPoint( "dartagnan", "france", destPosX, destPosY ) ;
		local aheadOfPlanchet = distanceToPoint( "planchet", "france", destPosX, destPosY ) - playerDestDist ;
		
		-- Planchet follow dart
		if ( aheadOfPlanchet > planchetStartDist ) then
			-- start going
			if ( not characterHasGoal( "planchet" ) ) then
				addGoalGetToPointInLevel( "planchet", planchetDestX, planchetDestY, "france", true, true ) ;
			end
		end
		if ( aheadOfPlanchet < planchetStopDist ) then
			-- stop going
			clearGoals( "planchet" ) ;
			setStateMessageIdle( "planchet" ) ;
		end
		
		coroutine.yield( ) ;
		
		if ( enteredForest and ( hasWaitingTalkOccured( waitingTalkNum1 ) or hasWaitingTalkOccured( waitingTalkNum2 ) ) ) then
			chatInForest = true ;
			setDoneWaitingTalk( waitingTalkNum1 ) ;
			setDoneWaitingTalk( waitingTalkNum2 ) ;
		end
	end
	
	removeMarker( name, marker ) ;
	
	-- chatting with de Wardes in forest now
	clearGoals( "planchet" ) ;
	clearGoals( "dewardes" ) ;
	clearGoals( "lubin" ) ;
	
	setStateMessageIdle( "planchet" ) ;
	setStateMessageIdle( "dartagnan" ) ;
	setStateMessageIdle( "dewardes" ) ;
	setStateMessageIdle( "lubin" ) ;

	setMissionFaceCharacter( name, "dewardes", "dartagnan" ) ;
	setMissionFaceCharacter( name, "lubin", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "dewardes" ) ;
	setMissionFaceCharacter( name, "planchet", "dewardes" ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "dewardes", true ) ;
	setIgnoreFreeze( "lubin", true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	
	sayAndWait( "dartagnan", getString( "ml5d4" ) ) ;
	sayAndWait( "dewardes", getString( "ml5d5" ) ) ;
	sayAndWait( "dartagnan", getString( "ml5d6" ) ) ;
	sayAndWait( "dewardes", getString( "ml5d7" ) ) ;
	sayAndWait( "dartagnan", getString( "ml5d8" ) ) ;
	sayAndWait( "dewardes", getString( "ml5d9" ) ) ;
	sayAndWait( "dartagnan", getString( "ml5d10" ) ) ;
	sayAndWait( "dewardes", getString( "ml5d11" ) ) ;
	sayAndWait( "dartagnan", getString( "ml5d12" ) ) ;
	
	setMissionFaceCharacter( name, "dewardes", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "dewardes" ) ;
	setMissionFaceCharacter( name, "planchet", "lubin" ) ;
	setMissionFaceCharacter( name, "lubin", "planchet" ) ;
	
	local planchetX, planchetY = getCharacterPos( "planchet" ) ;
	local lubinX, lubinY = getCharacterPos( "lubin" ) ;
	
	local middleX = ( planchetX + lubinX ) / 2 ;
	local middleY = ( planchetY + lubinY ) / 2 ;
	
	removeDriver( getCharacterOwnedHorseName( "planchet" ), "planchet" ) ;
	addGoalGetToPointInLevel( "planchet", middleX, middleY, "france", false, true ) ;
	addGoalGetToPointInLevel( "lubin", middleX, middleY, "france", false, true ) ;
	
	-- try to get dartagnan and dewardes out of the way
	addGoalGetToPointInLevel( "dartagnan", destPosX, destPosY, "france", false, true ) ;
	addGoalGetToPointInLevel( "dewardes", destPosX, destPosY, "france", false, true ) ;
	wait( 0.5 ) ;
	clearGoals( "dartagnan" ) ;
	setStateMessageIdle( "dartagnan" ) ;
	wait( 0.5 ) ;
	clearGoals( "dewardes" ) ;
	setStateMessageIdle( "dewardes" ) ;
	
	local fightDist = 25 ;
	while ( distanceBetweenCharacters( "planchet", "lubin" ) > fightDist ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "planchet" ) ;
	clearGoals( "lubin" ) ;
	
	takeDamage( "lubin", 150 ) ;
	
	wait( 1 ) ;
	
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;
	sayAndWait( "planchet", getString( "ml5d13" ) ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "dewardes", false ) ;
	setIgnoreFreeze( "lubin", false ) ;
	setIgnoreFreeze( "planchet", false ) ;

	local dewardesID = addWatchCharacterUnlimited( "dewardes" ) ;
	
	makeEnemies( "dartagnan", "dewardes" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "fight" ), "dewardes" ) ;
		
	while ( isCharacterAlive( "dewardes" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
		
	setMissionFaceNone( name, "dartagnan" ) ;
	
	makeNotEnemies( "dartagnan", "dewardes" ) ;

	removeWatchCharacter( "dewardes", dewardesID ) ;
	
	-- de Wardes drop letter
	local dewardesX, dewardesY = getCharacterPos( "dewardes" ) ;
	createItem( "l1", "letter_calaisunsigned", "france", dewardesX, dewardesY, true ) ;
	
	addMarkerPickUp( name, true, getString( "ml5m2" ), "l1" ) ;

	while ( numOfItemType( "letter_calaisunsigned" ) < 1 ) do
		coroutine.yield( ) ;
	end
	
	setMissionChatString( name, "calaiscaptain", getString( "ml5d21" ) ) ;
		
	local marker = addMarkerCharacter( name, true, getString( "ml5m3" ), "calaisgovernor" ) ;
	
	local waitingTalkNum = setWaitingForTalk( "dartagnan", "calaisgovernor", false ) ;
		
	while( not hasWaitingTalkOccured( waitingTalkNum ) ) do
		local playerDestDist = distanceToPoint( "dartagnan", "france", destPosX, destPosY ) ;
		local aheadOfPlanchet = distanceToPoint( "planchet", "france", destPosX, destPosY ) - playerDestDist ;
		
		-- Planchet follow dart
		if ( aheadOfPlanchet > planchetStartDist ) then
			-- start going
			if ( not characterHasGoal( "planchet" ) ) then
				addGoalGetToPointInLevel( "planchet", planchetDestX, planchetDestY, "france", true, true ) ;
			end
		end
		if ( aheadOfPlanchet < planchetStopDist ) then
			-- stop going
			clearGoals( "planchet" ) ;
			setStateMessageIdle( "planchet" ) ;
		end
		
		coroutine.yield( ) ;
	end
	
	setDoneWaitingTalk( waitingTalkNum ) ;
	if ( not characterHasGoal( "planchet" ) ) then
		addGoalGetToPointInLevel( "planchet", planchetDestX, planchetDestY, "france", true, true ) ;
	end
	
	removeMarker( name, marker ) ;
		
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "calaisgovernor", true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	setMissionFaceCharacter( name, "calaisgovernor", "dartagnan" ) ;
	
	playSound( "paper", 1.0 ) ;
	sayAndWait( "dartagnan", getString( "ml5d14" ) ) ;
	
	playSound( "writing", 1.0 ) ;
	sayAndWait( "calaisgovernor", getString( "ml5d15" ) ) ;
	
	sayAndWait( "dartagnan", getString( "ml5d16" ) ) ;
	sayAndWait( "calaisgovernor", getString( "ml5d17" ) ) ;
	sayAndWait( "dartagnan", getString( "ml5d18" ) ) ;
	sayAndWait( "calaisgovernor", getString( "ml5d19" ) ) ;
	sayAndWait( "dartagnan", getString( "ml5d20" ) ) ;

	playSound( "paper", 1.0 ) ;
	
	-- sign letter
	setInventoryItem( "letter_calaisunsigned", 0 ) ;
	setInventoryItem( "letter_calaissigned", 1 ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "calaisgovernor", false ) ;
	setIgnoreFreeze( "planchet", false ) ;
		
	removeDoorLock( doorLockA ) ;
	removeTriggerArea( triggerAreaA ) ;
				
	completeMission( name ) ;
	activateMission( "missionlondon6" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionlondon5LockOut1( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "needtolondon" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "needtolondon" ) ) ;
	
	local x = 6537 ;
	local y = -17588 ;
	
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function missionlondon5LockOut3( )
	--local bubInd = characterSay( "calaiscaptain", true, -1, BUBBLE_PROX_N, true, getString( "ml5d1" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "ml5d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
end

function chat_missionlondon5notyet( )
	--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "ml5d2" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "ml5d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
end

function execute_missionlondon6( name )
	-- Get on boat to England
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "calaisgovernor", getString( "ml5d23" ) ) ;
	
	local withinDist = 400.0 ;
	ensureCharacterAroundPoint( "planchet", "france", 4437, -16945, withinDist ) ;
	
	setInventoryItem( "letter_calaisunsigned", 0 ) ;
	setInventoryItem( "letter_calaissigned", 1 ) ;

	local doorLockA = addDoorLock( name, "missionlondon5LockOut3", true, "boattoengland" ) ;
	
	local triggerAreaA = addTriggerArea( name, "missionlondon5LockOut1", true, "france", 
		{ 5890, -17472, 6975, -17215 } ) ;

	clearGoals( "planchet" ) ;
	addGoalGetToPointInLevel( "planchet", 4942, -18927, "france", true, true ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "ml6m1" ), "calaiscaptain" ) ;
	waitForTalk( "dartagnan", "calaiscaptain", false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "calaiscaptain", true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	setMissionFaceCharacter( name, "calaiscaptain", "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "ml6d1" ) ) ;
	playSound( "paper", 1.0 ) ;
	
	sayAndWait( "calaiscaptain", getString( "ml6d2" ) ) ;
	sayAndWait( "dartagnan", getString( "ml6d3" ) ) ;
	sayAndWait( "calaiscaptain", getString( "ml6d4" ) ) ;
	
	setInventoryItem( "letter_calaissigned", 0 ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "calaiscaptain", false ) ;
	setIgnoreFreeze( "planchet", false ) ;

	setMissionChatString( name, "calaiscaptain", getString( "ml5d22" ) ) ;

	removeDoorLock( doorLockA ) ;
	
	local marker = addMarkerDoor( name, true, getString( "ml6m2" ), "boattoengland" ) ;
	
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "england" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	enableRainSound( false ) ; -- stop rain from playing in comic
	
	local comic1 = createComic( "boat1" ) ;

	addMouseOver( comic1, getString( "planchet" ), 135, 172, 154, 193, 142, 172 ) ;
	addMouseOver( comic1, getString( "captain_m" ), 159, 193, 174, 211, 164, 193 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 146, 196, 162, 215, 153, 197 ) ;
	
	setComicFadeFrom( getBlueDoorColourR( ), getBlueDoorColourG( ), getBlueDoorColourB( ), getBlueDoorColourA( ) ) ;
	setComicFadeTo( getBlueDoorColourR( ), getBlueDoorColourG( ), getBlueDoorColourB( ), getBlueDoorColourA( ) ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	enableRainSound( true ) ;	
			
	placeVehicle( getCharacterOwnedHorseName( "dartagnan" ), "england", 409, 17 ) ;
	
	removeTriggerArea( triggerAreaA ) ;
				
	completeMission( name ) ;
	activateMission( "missionlondon7" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionlondon7( name )
	-- Get to London, talk to Patrick
	DEBUG_OUTPUT( name .. " started" ) ;
	
	placeCharacter( "planchet", "england", 517, -152 ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;

	local doorLockA = addDoorLock( name, "missionlondon7LockOut3", true, "boattofrance" ) ;

	local planchetDestX = -5504 ;
	local planchetDestY = -5124 ;

	local startDist = 100 ;
	local stopDist = 50 ;
	local planchetStartDist = 120 ;
	local planchetStopDist = 70 ;


	local marker = addMarkerCharacter( name, true, getString( "ml7m1" ), "patrick" ) ;

	while( distanceToPoint( "dartagnan", "england", planchetDestX, planchetDestY ) > 500.0 ) do
		local playerDestDist = distanceToPoint( "dartagnan", "england", planchetDestX, planchetDestY ) ;
		local aheadOfPlanchet = distanceToPoint( "planchet", "england", planchetDestX, planchetDestY ) - playerDestDist ;
		
		-- Planchet follow dart
		if ( aheadOfPlanchet > planchetStartDist ) then
			-- start going
			if ( not characterHasGoal( "planchet" ) ) then
				addGoalGetToPointInLevel( "planchet", planchetDestX, planchetDestY, "england", true, true ) ;
			end
		end
		if ( aheadOfPlanchet < planchetStopDist ) then
			-- stop going
			clearGoals( "planchet" ) ;
			setStateMessageIdle( "planchet" ) ;
		end
		
		coroutine.yield( ) ;
	end
	
	if ( not characterHasGoal( "planchet" ) ) then
		addGoalGetToPointInLevel( "planchet", planchetDestX, planchetDestY, "england", true, true ) ;
	end

	waitForTalk( "dartagnan", "patrick", false ) ;
	removeMarker( name, marker ) ;

	--local tenseMusicID = addMusic( "tense", 15 ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	setIgnoreFreeze( "patrick", true ) ;
	
	-- bring planchet in
	clearGoals( "planchet" ) ;
	placeCharacterInDoor( "planchet", "buckinghamenglandin", false ) ;
	addGoalGetToPointInLevel( "planchet", -5, 7, "buckinghamenglandhouse", false, true ) ;
	wait( 1 ) ;

	setMissionFaceCharacter( name, "patrick", "dartagnan" ) ;
	setMissionFaceCharacter( name, "planchet", "patrick" ) ;

	sayAndWait( "dartagnan", getString( "ml7d1" ) ) ;
	sayAndWait( "patrick", getString( "ml7d2" ) ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "ml7d3" ) ) ;
	
	--removeMusic( tenseMusicID ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	setIgnoreFreeze( "patrick", false ) ;
	
	-- put dewardes back to default
	giveHealth( "dewardes", 200 ) ;
	reviveCharacter( "dewardes" ) ;
	placeNowhere( "dewardes" ) ;

	giveHealth( "lubin", 200 ) ;
	reviveCharacter( "lubin" ) ;
	placeNowhere( "lubin" ) ;
	
	removeDoorLock( doorLockA ) ;
			
	completeMission( name ) ;
	activateMission( "missionlondon8" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionlondon7LockOut3( )
	--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "needtolondon" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "needtolondon" ) ) ;
	waitForBubbleClosed( bubInd ) ;
end

function execute_missionlondon8( name )
	-- Get to Buckingham with Patrick (go to Windsor)
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "planchet", getString( "ml8d9" ) ) ;
	setMissionChatString( name, "patrick", getString( "ml8d10" ) ) ;

	setInventoryItem( "letter_toengland", 1 ) ;

	local overrideSaveID = createOverrideSavePos( "buckinghamenglandhouse", -102, 9 ) ;
	setOverrideSaveArea( overrideSaveID, "england", 
		{ -4971, -5629, -5026, -4865, -8273, -4748, -8308, -5595 },
		{ -8273, -4748, -8308, -5595, -10275, -5022, -10088, -3935 },
		{ -10275, -5022, -10088, -3935, -12782, -5183, -12547, -3549 } ) ;
	
	local doorLockA = addDoorLock( name, "missionlondon8LockOut3", true, "boattofrance" ) ;

	-- walk Planchet to room to rest in
	ensureCharacterInLevel( "planchet", "buckinghamenglandhouse", -5, 7 ) ;
	clearGoals( "planchet" ) ;
	addGoalGetToPointInLevel( "planchet", -441, 144, "buckinghamenglandhouse2", false, true ) ;

	local patrickHuntDestX = -12027 ;
	local patrickHuntDestY = -4409 ;
	local dartHuntDestX = patrickHuntDestX ;
	local dartHuntDestY = patrickHuntDestY + 100 ;

	-- Patrick needs horse, ride it out to Buckingham
	setOwnedHorse( "patrick", "buckhorse1" ) ;
	placeVehicle( "buckhorse1", "england", -5449, -5110 ) ;
	addGoalGetToPointInLevel( "patrick", patrickHuntDestX, patrickHuntDestY, "england", true, true ) ;
	
	setMissionFaceCharacter( name, "patrick", "dartagnan" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "ml8m1" ), "patrick" ) ;
	waitForNoGoal( "patrick" ) ;
	
	local closeDist = 300.0 ;
	while ( distanceBetweenCharacters( "dartagnan", "patrick" ) > closeDist ) do
		coroutine.yield( ) ;
	end

	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "patrick", true ) ;
	setIgnoreFreeze( "buckingham", true ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", dartHuntDestX, dartHuntDestY, "england", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	setMissionFaceCharacter( name, "patrick", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "patrick" ) ;
	
	sayAndWait( "patrick", getString( "ml8d1" ) ) ;
	sayAndWait( "dartagnan", getString( "ml8d2" ) ) ;
	sayAndWait( "patrick", getString( "ml8d3" ) ) ;

	-- Patrick rides off and comes back with Buckinham	
	addGoalGetToPointInLevel( "patrick", patrickHuntDestX - 460, patrickHuntDestY, "england", true, true ) ;
	waitForNoGoal( "patrick" ) ;
	wait( 1 ) ;

	placeCharacter( "buckingham", "england", patrickHuntDestX - 460, patrickHuntDestY + 60 ) ;
	addGoalGetToPointInLevel( "patrick", patrickHuntDestX - 100, patrickHuntDestY, "england", true, true ) ;
	addGoalGetToPointInLevel( "buckingham", patrickHuntDestX - 100, patrickHuntDestY + 100, "england", false, true ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "buckingham" ) ;
	setMissionFaceCharacter( name, "buckingham", "dartagnan" ) ;
	
	waitForNoGoal( "patrick" ) ;
	waitForNoGoal( "buckingham" ) ;
	
	addHeartMaker( "buckingham" ) ;
	sayAndWait( "buckingham", getString( "ml8d4" ) ) ;
	removeHeartMaker( "buckingham" ) ;

	sayAndWait( "dartagnan", getString( "ml8d5" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	setInventoryItem( "letter_toengland", 0 ) ;
		
	sayAndWait( "buckingham", getString( "ml8d6" ) ) ;
	sayAndWait( "dartagnan", getString( "ml8d7" ) ) ;
	sayAndWait( "buckingham", getString( "ml8d8" ) ) ;
	
	
	-- Patrick gets off his horse and leaves, Buckingham gets on the horse
	removeDriver( "buckhorse1", "patrick" ) ;
	removeOwnedHorse( "patrick" ) ;	
	addGoalGetToPointInLevel( "patrick", patrickHuntDestX - 500, patrickHuntDestY, "england", false, true ) ;
	
	setOwnedHorse( "buckingham", "buckhorse1" ) ;
	addGoalDriveVehicle( "buckingham", "buckhorse1", true ) ;
	
	if( isCharacterOnScreen( "patrick" ) ) then
		DEBUG_OUTPUT( "onscreen" ) ;
	end
	
	if ( characterHasGoal( "patrick" ) ) then
		DEBUG_OUTPUT( "hasGoal" ) ;
	end
	
	while ( isCharacterOnScreen( "patrick" ) and characterHasGoal( "patrick" ) ) do
		coroutine.yield( ) ;
	end
	
	waitForNoGoal( "buckingham" ) ;
	
	clearGoals( "patrick" ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "patrick", false ) ;
	setIgnoreFreeze( "buckingham", false ) ;
	
	removeDoorLock( doorLockA ) ;

	removeOverrideSavePos( overrideSaveID ) ;
				
	completeMission( name ) ;
	activateMission( "missionlondon9" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionlondon8LockOut3( )
	--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "nobacktofrance" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "nobacktofrance" ) ) ;
	waitForBubbleClosed( bubInd ) ;
end

function execute_missionlondon9( name )
	-- Get back to Buckinham's house and talk to Buckingham
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "buckingham", getString( "ml8d11" ) ) ;
	setMissionChatString( name, "planchet", getString( "ml8d12" ) ) ;

	local overrideSaveID = createOverrideSavePos( "england", -11774, -4437 ) ;
	setOverrideSaveArea( overrideSaveID, "england", 
		{ -4971, -5629, -5026, -4865, -8273, -4748, -8308, -5595 },
		{ -8273, -4748, -8308, -5595, -10275, -5022, -10088, -3935 },
		{ -10275, -5022, -10088, -3935, -12782, -5183, -12547, -3549 } ) ;
	setOverrideSaveLevel( overrideSaveID, "buckinghamenglandhouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "buckinghamenglandhouse2" ) ;
	setOverrideSaveLevel( overrideSaveID, "buckinghamenglandhouse3" ) ;

	local doorLockA = addDoorLock( name, "missionlondon8LockOut3", true, "boattofrance" ) ;

	clearGoals( "patrick" ) ;
	placeDead( "patrick" ) ;

	clearGoals( "planchet" ) ;
	placeCharacter( "planchet", "buckinghamenglandhouse2", -441, 144 ) ;

	local withinDist = 400.0 ;
	ensureCharacterAroundPoint( "buckingham", "england", -12132, -4399, withinDist ) ;
	putCharacterInPlaceOnHorse( "buckingham" ) ;

	local buckShrinePosX = 331 ;
	local buckShrinePosY = -279 ;
	local buckShrine = "buckinghamenglandhouse3" ;
	
	addGoalGetToPointInLevel( "buckingham", buckShrinePosX, buckShrinePosY, buckShrine, true, true ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "ml9m1" ), "buckingham" ) ;
	waitForNoGoal( "buckingham" ) ;
	
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == buckShrine ) ) do
		coroutine.yield( ) ;	
	end
	
	removeMarker( name, marker ) ;


	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "buckingham", true ) ;
	setIgnoreFreeze( "jackson", true ) ;
	setIgnoreFreeze( "oreilly", true ) ;

	--local tenseMusicID = addMusic( "tense", 15 ) ;
	
	setMissionFaceCharacter( name, "buckingham", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "buckingham" ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", buckShrinePosX + 40, buckShrinePosY, buckShrine, false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	sayAndWait( "buckingham", getString( "ml9d1" ) ) ;
	sayAndWait( "buckingham", getString( "ml9d2" ) ) ;
	sayAndWait( "buckingham", getString( "ml9d3" ) ) ;
	sayAndWait( "dartagnan", getString( "ml9d4" ) ) ;
	sayAndWait( "buckingham", getString( "ml9d5" ) ) ;
	sayAndWait( "dartagnan", getString( "ml9d6" ) ) ;
	sayAndWait( "buckingham", getString( "ml9d7" ) ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	local buckHouse1 = "buckinghamenglandhouse" ;
	placeCharacter( "buckingham", buckHouse1, -107, -118 ) ;
	placeCharacter( "dartagnan", buckHouse1, -57, -118 ) ;
	placeCharacter( "jackson", buckHouse1, -107, -68 ) ;
	
	setMissionFaceCharacter( name, "buckingham", "jackson" ) ;
	setMissionFaceCharacter( name, "dartagnan", "jackson" ) ;
	setMissionFaceCharacter( name, "jackson", "buckingham" ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	sayAndWait( "buckingham", getString( "ml9d8" ) ) ;
	sayAndWait( "jackson", getString( "ml9d9" ) ) ;
	
	-- jackson leave, oreilly comes in
	addGoalGetToPointInLevel( "jackson", -5457, -5116, "england", false, true ) ;
	
	placeCharacterInDoor( "oreilly", "buckinghamenglandin", false ) ;
	addGoalGetToPointInLevel( "oreilly", -107, -68, buckHouse1, false ) ;
	
	setMissionFaceCharacter( name, "buckingham", "oreilly" ) ;
	setMissionFaceCharacter( name, "dartagnan", "oreilly" ) ;
	setMissionFaceCharacter( name, "oreilly", "buckingham" ) ;
		
	waitForNoGoal( "oreilly" ) ;
	
	sayAndWait( "buckingham", getString( "ml9d10" ) ) ;
	sayAndWait( "oreilly", getString( "ml9d11" ) ) ;
	sayAndWait( "buckingham", getString( "ml9d12" ) ) ;
	sayAndWait( "oreilly", getString( "ml9d13" ) ) ;
	sayAndWait( "buckingham", getString( "ml9d14" ) ) ;
	sayAndWait( "oreilly", getString( "ml9d15" ) ) ;
	
	addGoalGetToPointInLevel( "oreilly", -5457, -5116, "england", false, true ) ;
	wait( 0.5 ) ;
	
	-- fade to black
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	wait( 2 ) ;
	
	local buckPos2X = -437 ;
	local buckPos2Y = -123 ;
	
	clearGoals( "oreilly" ) ;
	setStateMessageIdle( "oreilly" ) ;
	
	placeCharacter( "buckingham", buckHouse1, buckPos2X, buckPos2Y ) ;
	placeCharacter( "dartagnan", buckHouse1, buckPos2X + 50, buckPos2Y ) ;
	clearGoals( "oreilly" ) ;
	clearGoals( "jackson" ) ;
	placeDead( "oreilly" ) ;
	placeDead( "jackson" ) ;
	
	setMissionFaceCharacter( name, "buckingham", "dartagnan" ) ;
	
	moveCameraToDest( ) ;
	
	-- fade from black
	local fadeTime = 1.0 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "buckingham", false ) ;
	setIgnoreFreeze( "jackson", false ) ;
	setIgnoreFreeze( "oreilly", false ) ;
	
	removeDoorLock( doorLockA ) ;
				
	removeOverrideSavePos( overrideSaveID ) ;
		
	--removeMusic( tenseMusicID ) ;
		
	completeMission( name ) ;
	activateMission( "missionlondon9_5" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end
	
function chat_missionlondon9_5( )
	local talkText = "" ;
	if ( randomInt( 1, 3 ) == 1 ) then
		talkText = getString( "ml9_5d1" ) ;
	else
		talkText = getString( "ml9_5d14" ) ;
	end
	
	addTimedHeartMaker( "buckingham", 5.0 ) ;
	
	--autoDeleteFaceChat( "buckingham", "dartagnan", talkText ) ;
	sayAndWait( "buckingham", talkText ) ;	
end
	
function execute_missionlondon9_5( name )
	-- D'Artagnan can wonder around England until studs are ready
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "planchet", getString( "ml8d12" ) ) ;
		
	setInventoryItem( "diamond_studs", 0 ) ;
		
	local doorLockA = addDoorLock( name, "missionlondon8LockOut3", true, "boattofrance" ) ;
		
	placeDead( "oreilly" ) ;
	placeDead( "jackson" ) ;
	
	clearGoals( "patrick" ) ;
	placeDead( "patrick" ) ;
	
	placeCharacter( "planchet", "buckinghamenglandhouse2", -441, 144 ) ;
	
	local buckPos2X = -437 ;
	local buckPos2Y = -123 ;
	placeCharacter( "buckingham", "buckinghamenglandhouse", buckPos2X, buckPos2Y ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "ml9_5m1" ), "buckingham" ) ;
	
	setMissionChatFunction( name, "buckingham", "chat_missionlondon9_5" ) ;
	setMissionFaceCharacter( name, "buckingham", "dartagnan" ) ;

	wait( 30 ) ; -- force player to wait this long
	
	waitForTalk( "dartagnan", "buckingham", false ) ;
	
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "buckingham", true ) ;
	setIgnoreFreeze( "jackson", true ) ;
	setIgnoreFreeze( "oreilly", true ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "buckingham" ) ;
	addGoalGetToPointInLevel( "dartagnan", buckPos2X, buckPos2Y + 40, "buckinghamenglandhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
		
	sayAndWait( "buckingham", getString( "ml9_5d2" ) ) ;
	
	setMissionFaceCharacter( name, "buckingham", "oreilly" ) ;
	setMissionFaceCharacter( name, "oreilly", "buckingham" ) ;
	placeCharacterInDoor( "oreilly", "buckinghamenglandin", false ) ;
	addGoalGetToPointInLevel( "oreilly", buckPos2X + 60, buckPos2Y, "buckinghamenglandhouse", false, true ) ;
	
	wait( 2 ) ;
	sayAndWait( "buckingham", getString( "ml9_5d3" ) ) ;
	setMissionFaceCharacter( name, "dartagnan", "oreilly" ) ;
	
	waitForNoGoal( "oreilly" ) ;
		
	-- O'Neil has finished studs, gives them and leaves
	sayAndWait( "oreilly", getString( "ml9_5d4" ) ) ;
	addGoalGetToPointInLevel( "oreilly", -5457, -5116, "england", false, true ) ;
	
	setMissionFaceCharacter( name, "buckingham", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "buckingham" ) ;
	
	sayAndWait( "buckingham", getString( "ml9_5d5" ) ) ;
	sayAndWait( "dartagnan", getString( "ml9_5d6" ) ) ;
	sayAndWait( "buckingham", getString( "ml9_5d7" ) ) ;
	sayAndWait( "buckingham", getString( "ml9_5d8" ) ) ;
	sayAndWait( "buckingham", getString( "ml9_5d9" ) ) ;
	sayAndWait( "buckingham", getString( "ml9_5d10" ) ) ;
	sayAndWait( "buckingham", getString( "ml9_5d11" ) ) ;
	sayAndWait( "dartagnan", getString( "ml9_5d12" ) ) ;
	sayAndWait( "buckingham", getString( "ml9_5d13" ) ) ;
	
	setInventoryItem( "diamond_studs", 1 ) ;
		
	local floatMusicID = addMusic( "float", 15 ) ;
		
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "oreilly" ) ;
	clearGoals( "jackson" ) ;
	place_oreilly( "oreilly" ) ;
	place_jackson( "jackson" ) ;
	place_buckinghamA( "buckingham" ) ;
	
	--local dartHorse = getCharacterOwnedHorseName( "dartagnan" ) ;
	--setStringVar( "ml9horse", dartHorse ) ;
	--removeOwnedHorse( "dartagnan" ) ;
	
	--if ( dartHorse ~= "" ) then
	--	setHorseToDealer( dartHorse, 1, true ) ;
	--end
	
	
	-- Give player his old horse back (the one he actually paid for)
	--local playersOldHorse = getStringVar( "ml9horse" ) ;
	--if ( not ( playersOldHorse == "" ) ) then
	--	setOwnedHorse( "dartagnan", playersOldHorse ) ;
	--end
	
	placeCharacter( "dartagnan", "france", -996, -21377 ) ;
	
	-- show comic
	local comic1 = createComic( "boat2" ) ;
	
	addText( comic1, getString( "boat2_d1" ), 178, 149, 274, 224 ) ;
	addText( comic1, getString( "boat2_d2" ), 311, 40, 450, 102 ) ;
	addText( comic1, getString( "boat2_d3" ), 160, 442, 249, 504 ) ;
	addText( comic1, getString( "boat2_d4" ), 290, 338, 432, 401 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 35, 49, 156, 240, 113, 53 ) ;

	addMouseOver( comic1, getString( "captain_m" ), 473, 51, 543, 244, 508, 56 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 370, 122, 459, 290, 411, 128 ) ;

	addMouseOver( comic1, getString( "milady" ), 561, 155, 678, 294, 611, 159 ) ;

	addMouseOver( comic1, getString( "milady" ), 189, 381, 214, 406, 203, 383 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 21, 366, 131, 590, 90, 379 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 415, 433, 435, 451, 426, 434 ) ;

	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	removeMusic( floatMusicID ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "buckingham", false ) ;
	setIgnoreFreeze( "jackson", false ) ;
	setIgnoreFreeze( "oreilly", false ) ;
	
	local dartHorse = getCharacterOwnedHorseName( "dartagnan" ) ;
	setStringVar( "ml9horse", dartHorse ) ;
	removeOwnedHorse( "dartagnan" ) ;
	
	if ( dartHorse ~= "" ) then
		setHorseToDealer( dartHorse, 1, true ) ;
	end
	
	removeDoorLock( doorLockA ) ;
					
	completeMission( name ) ;
	activateMission( "missionlondon10" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionlondon10( name )
	-- Race back to Paris using post horses along the way
	DEBUG_OUTPUT( name .. " started" ) ;

	setInventoryItem( "diamond_studs", 1 ) ;

	-- player might have had horse before (if they just failed this mission
	local dartHorse = getCharacterOwnedHorseName( "dartagnan" ) ;
	removeOwnedHorse( "dartagnan" ) ;
	if ( not ( dartHorse == "" ) ) then
		placeVehicle( dartHorse, "france", -30000, 0 ) ;
	end
	
	if ( getDiedDuringMission( name ) >= 2 ) then
		local dartX, dartY = getCharacterPos( "dartagnan" ) ;
		
		createItem( "", "ointment", "france", dartX + 60, dartY, false ) ;
		createItem( "", "ointment", "france", dartX + 60, dartY + 20, false ) ;
		createItem( "", "ointment", "france", dartX + 80, dartY + 10, false ) ;
	end
	
	local doorLockA = addDoorLock( name, "", true, "louvreout", "louvreout2" ) ;

	setMissionFreezeGame( name, true ) ;
	setStateMessageIdle( "dartagnan" ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "ml10d24" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;
	
	-- create enemies along the way
	local enemy1 = createTempCharacter( getString( "assassin" ), "france", -2516, -17821 ) ;
	setStatsCalculatorStatic( enemy1, 16, 16, 16, 16 ) ;
	randomDressEnemy( enemy1, 0.0, 13544 ) ;
	setRangedWeapon( enemy1, "musket_matchlock_1" ) ;
	loadRanged( enemy1 ) ;
	
	local enemy2 = createTempCharacter( getString( "assassin" ), "france", -5715, -14720 ) ;
	setStatsCalculatorStatic( enemy2, 16, 16, 16, 16 ) ;
	randomDressEnemy( enemy2, 0.0, 1379 ) ;
	setRangedWeapon( enemy2, "musket_matchlock_1" ) ;
	loadRanged( enemy2 ) ;

	local enemy3 = createTempCharacter( getString( "assassin" ), "france", -5721, -7105 ) ;
	setStatsCalculatorStatic( enemy3, 16, 16, 16, 16 ) ;
	randomDressEnemy( enemy3, 0.0, 4673311 ) ;
	setRangedWeapon( enemy3, "musket_matchlock_1" ) ;
	loadRanged( enemy3 ) ;
	
	local enemy4 = createTempCharacter( getString( "assassin" ), "france", -2769, -5201 ) ;
	setStatsCalculatorStatic( enemy4, 16, 16, 16, 16 ) ;
	randomDressEnemy( enemy4, 0.0, 1944 ) ;
	setRangedWeapon( enemy4, "musket_matchlock_1" ) ;
	loadRanged( enemy4 ) ;
	
	local enemy5 = createTempCharacter( getString( "assassin" ), "france", -1682, -4178 ) ;
	setStatsCalculatorStatic( enemy5, 16, 16, 16, 16 ) ;
	randomDressEnemy( enemy5, 0.0, 7195 ) ;
	setRangedWeapon( enemy5, "musket_matchlock_1" ) ;
	loadRanged( enemy5 ) ;
	
	local enemy6 = createTempCharacter( getString( "assassin" ), "france", -725, -3396 ) ;
	setStatsCalculatorStatic( enemy6, 16, 16, 16, 16 ) ;
	randomDressEnemy( enemy6, 0.0, 3332312 ) ;
	setRangedWeapon( enemy6, "musket_matchlock_1" ) ;
	loadRanged( enemy6 ) ;
	
	makeEnemies( "dartagnan", enemy1, enemy2, enemy3, enemy4, enemy5, enemy6 ) ;
	
	
	-- label for timer
	gRaceTimerLabel = addLabel( ) ;
	setLabelFont( gRaceTimerLabel, "title_font" ) ;
	setLabelColour( gRaceTimerLabel, gLightTextR, gLightTextG, gLightTextB, gLightTextA ) ;
	setLabelShadow( gRaceTimerLabel, true, 2, 2 ) ;
	setLabelShadowColour( gRaceTimerLabel, gLightTextShadowR, gLightTextShadowG, gLightTextShadowB, gLightTextShadowA ) ;
	setWindowAlign( gRaceTimerLabel, "right", "top" ) ;
	setWindowPos( gRaceTimerLabel, 20, 20 ) ;
	
	local failedTimes = getInt( "london10timedFails" ) ;
	gRaceTimer = 200 ;
	if ( failedTimes > 7 ) then
		gRaceTimer = 320 ;
	elseif ( failedTimes > 3 ) then
		gRaceTimer = 230 ;
	end
	
	activateScriptMessage( "runRaceTimer" ) ;

	-- get to first Inn Keeper and get horse
	local passwordCorrect = false ;
	while ( not passwordCorrect ) do

		local marker = addMarkerCharacter( name, true, getString( "ml10m1" ), "stvaleryinnkeeper" ) ;
		waitForTalk( "dartagnan", "stvaleryinnkeeper", false ) ;
		removeMarker( name, marker ) ;
		
		lockPlayerInPlace( ) ;
		sayAndWait( "stvaleryinnkeeper", getString( "ml10d1" ) ) ;
		
		local bubInd = characterSay( "dartagnan", false, -1, -1, true, getString( "ml10d2" ), getString( "ml10d3" ), getString( "ml10d4" ), getString( "ml10d5" ) ) ;
		local option = waitForBubbleOption( bubInd ) ;
		if ( option == 0 ) then
			sayAndWait( "stvaleryinnkeeper", getString( "ml10d7" ) ) ;
			passwordCorrect = true ;
		else
			sayAndWait( "stvaleryinnkeeper", getString( "ml10d6" ) ) ;
		end
		
		unlockPlayerInPlace( ) ;
	end
	
	setOwnedHorse( "dartagnan", "posthorse1" ) ;
	placeVehicle( "posthorse1", "france", -766, -21375 ) ;
	local marker = addMarkerVehicle( name, true, getString( "ml10m2" ), "posthorse1" ) ;
	
	while ( not characterIsDriving( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	gHorseFatigueName = "posthorse1" ;
	activateScriptMessage( "runHorseFatigue" ) ;
	
	-- second Innkeeper and horse
	local passwordCorrect = false ;
	while ( not passwordCorrect ) do

		local marker = addMarkerCharacter( name, true, getString( "ml10m1" ), "hersedorinnkeeper" ) ;
		waitForTalk( "dartagnan", "hersedorinnkeeper", false ) ;
		removeMarker( name, marker ) ;
		
		lockPlayerInPlace( ) ;
		sayAndWait( "hersedorinnkeeper", getString( "ml10d8" ) ) ;
		
		local bubInd = characterSay( "dartagnan", false, -1, -1, true, getString( "ml10d2" ), getString( "ml10d9" ), getString( "ml10d3" ), getString( "ml10d10" ) ) ;
		local option = waitForBubbleOption( bubInd ) ;
		if ( option == 1 ) then
			sayAndWait( "hersedorinnkeeper", getString( "ml10d11" ) ) ;
			passwordCorrect = true ;
		else
			sayAndWait( "hersedorinnkeeper", getString( "ml10d6" ) ) ;
		end
		
		unlockPlayerInPlace( ) ;
	end
	
	removeOwnedHorse( "dartagnan" ) ;
	setOwnedHorse( "dartagnan", "posthorse2" ) ;
	placeVehicle( "posthorse2", "france", -4124, -16433 ) ;
	gRunningHorseFatigue = false ;
	local marker = addMarkerVehicle( name, true, getString( "ml10m2" ), "posthorse2" ) ;
	
	while ( not characterIsDriving( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	gHorseFatigueName = "posthorse2" ;
	activateScriptMessage( "runHorseFatigue" ) ;

	-- third Innkeeper and horse
	local passwordCorrect = false ;
	while ( not passwordCorrect ) do

		local marker = addMarkerCharacter( name, true, getString( "ml10m1" ), "ecudeinnkeeper" ) ;
		waitForTalk( "dartagnan", "ecudeinnkeeper", false ) ;
		removeMarker( name, marker ) ;
		
		lockPlayerInPlace( ) ;
		sayAndWait( "ecudeinnkeeper", getString( "ml10d12" ) ) ;
		
		local bubInd = characterSay( "dartagnan", false, -1, -1, true, getString( "ml10d2" ), getString( "ml10d13" ), getString( "ml10d4" ), getString( "ml10d3" ) ) ;
		local option = waitForBubbleOption( bubInd ) ;
		if ( option == 2 ) then
			sayAndWait( "ecudeinnkeeper", getString( "ml10d15" ) ) ;
			passwordCorrect = true ;
		else
			sayAndWait( "ecudeinnkeeper", getString( "ml10d6" ) ) ;
		end
		
		unlockPlayerInPlace( ) ;
	end
	
	removeOwnedHorse( "dartagnan" ) ;
	setOwnedHorse( "dartagnan", "posthorse3" ) ;
	placeVehicle( "posthorse3", "france", -5673, -10952 ) ;
	gRunningHorseFatigue = false ;
	local marker = addMarkerVehicle( name, true, getString( "ml10m2" ), "posthorse3" ) ;
	
	while ( not characterIsDriving( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	gHorseFatigueName = "posthorse3" ;
	activateScriptMessage( "runHorseFatigue" ) ;

	-- fourth Innkeeper and horse
	local passwordCorrect = false ;
	while ( not passwordCorrect ) do

		local marker = addMarkerCharacter( name, true, getString( "ml10m1" ), "pontoiseinnkeeper" ) ;
		waitForTalk( "dartagnan", "pontoiseinnkeeper", false ) ;
		removeMarker( name, marker ) ;
		
		lockPlayerInPlace( ) ;
		sayAndWait( "pontoiseinnkeeper", getString( "ml10d16" ) ) ;
		
		local bubInd = characterSay( "dartagnan", false, -1, -1, true, getString( "ml10d2" ), getString( "ml10d3" ), getString( "ml10d17" ), getString( "ml10d18" ) ) ;
		local option = waitForBubbleOption( bubInd ) ;
		if ( option == 0 ) then
			sayAndWait( "pontoiseinnkeeper", getString( "ml10d19" ) ) ;
			passwordCorrect = true ;
		else
			sayAndWait( "pontoiseinnkeeper", getString( "ml10d6" ) ) ;
		end
		
		unlockPlayerInPlace( ) ;
	end
	
	removeOwnedHorse( "dartagnan" ) ;
	setOwnedHorse( "dartagnan", "posthorse4" ) ;
	placeVehicle( "posthorse4", "france", -4126, -6097 ) ;
	gRunningHorseFatigue = false ;
	local marker = addMarkerVehicle( name, true, getString( "ml10m2" ), "posthorse4" ) ;
	
	while ( not characterIsDriving( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	gHorseFatigueName = "posthorse4" ;
	activateScriptMessage( "runHorseFatigue" ) ;

	local marker = addMarkerCharacter( name, true, getString( "ml10m3" ), "germain" ) ;
	waitForTalk( "dartagnan", "germain", false ) ;
	removeMarker( name, marker ) ;

	gRaceTimerOn = false ;
	gRaceTimerLabel = safeRemoveWindow( gRaceTimerLabel ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "germain", true ) ;
	setIgnoreFreeze( "constance", true ) ;
	
	setMissionFaceCharacter( name, "germain", "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "ml10d20" ) ) ;
	sayAndWait( "germain", getString( "ml10d21" ) ) ;
		
	addGoalGetToPointInLevel( "germain", 816, -283, "louvrehouse", false, true ) ;
	waitForNoGoal( "germain" ) ;
	
	placeCharacterInDoor( "constance", "louvreout2", false ) ;
	addGoalGetToPointInLevel( "constance", 661, 18, "france", true ) ;
	setMissionFaceCharacter( name, "dartagnan", "constance" ) ;
	
	wait( 1 ) ;
	placeCharacterInDoor( "germain", "louvreout2", false ) ;
	addGoalGetToPointInLevel( "constance", 661, 18, "france", true ) ;

	addGoalGetToPointInLevel( "germain", getGermainAPosX( ), getGermainAPosY( ), getGermainALevel( ), false, true ) ;
	
	waitForNoGoal( "constance" ) ;
	sayAndWait( "dartagnan", getString( "ml10d22" ) ) ;
	
	setInventoryItem( "diamond_studs", 0 ) ;
		
		
	addHeartMaker( "constance" ) ;
		
	sayAndWait( "constance", getString( "ml10d23" ) ) ;
	
	removeHeartMaker( "constance" ) ;

	addGoalGetToPointInLevel( "constance", 816, -283, "louvrehouse", false, true ) ;
	
	waitForNoGoal( "germain" ) ;
	
	while ( isCharacterOnScreen( "constance" ) ) do
		coroutine.yield( ) ;
	end
	
	-- reset horse quality
	setHorseQuality( "posthorse4", "excellent" ) ;
	
	clearGoals( "constance" ) ;
			
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "germain", false ) ;
	setIgnoreFreeze( "constance", false ) ;
	
	removeDoorLock( doorLockA ) ;
	
	deleteTempCharacter( enemy1 ) ;
	deleteTempCharacter( enemy2 ) ;
	deleteTempCharacter( enemy3 ) ;
	deleteTempCharacter( enemy4 ) ;
	deleteTempCharacter( enemy5 ) ;
	deleteTempCharacter( enemy6 ) ;

	completeMission( name ) ;
	activateMission( "missionparisb1" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function runHorseFatigue( )
	gRunningHorseFatigue = true ;
	
	local totalDistance = 0.0 ;
	local distanceBreak = 1800.0 ;
	
	local x, y = getCharacterPos( "dartagnan" ) ;
	local lastX = x ;
	local lastY = y ;
	
	while( gRunningHorseFatigue ) do
		local x, y = getCharacterPos( "dartagnan" ) ;
		
		if ( characterIsDriving( "dartagnan" ) ) then
			local distX = x - lastX ;
			local distY = y - lastY ;
			local dist = math.sqrt( distX * distX + distY * distY ) ;
			totalDistance = totalDistance + dist ;
		end
				
		if ( totalDistance < distanceBreak * 1 ) then
			setHorseQuality( gHorseFatigueName, "excellent" ) ;
		elseif ( totalDistance < distanceBreak * 2 ) then
			setHorseQuality( gHorseFatigueName, "good" ) ;
		elseif ( totalDistance < distanceBreak * 3 ) then
			setHorseQuality( gHorseFatigueName, "average" ) ;
		elseif ( totalDistance < distanceBreak * 4 ) then
			setHorseQuality( gHorseFatigueName, "poor" ) ;
		elseif ( totalDistance < distanceBreak * 5 ) then
			setHorseQuality( gHorseFatigueName, "terrible" ) ;
		end

		lastX = x ;
		lastY = y ;
		
		coroutine.yield( ) ;		
	end
end

function runRaceTimer( )
	gRaceTimerOn = true ;
	local lastDisplay = 0 ;

	while ( gRaceTimerOn ) do
		if ( not isFrozenOrLocked( ) ) then
			gRaceTimer = gRaceTimer - getDeltaT( ) ;
		end
		
		local displayTimer = math.ceil( gRaceTimer ) ;
		if ( displayTimer < 0 ) then
			displayTimer = 0 ;
		end
		
		if ( not ( displayTimer == lastDisplay ) ) then
			-- timer clicked
			local volume = 0.4 ;
			if ( displayTimer <= 10 ) then
				volume = 0.8 ;
			end
			playSound( "timer", volume ) ;
		end
		
		if ( displayTimer == 0 ) then
			setLabelText( gRaceTimerLabel, "0" ) ; -- lua puts -0 otherwise
		else 
			setLabelText( gRaceTimerLabel, displayTimer ) ;
		end
		
		if ( gRaceTimer < -0.5 ) then
			local failedTimes = getInt( "london10timedFails" ) ;
			failedTimes = failedTimes + 1 ;
			setInt( "london10timedFails", failedTimes ) ;
			
			failGame( getString( "ml10d25" ) ) ;
		end
		
		lastDisplay = displayTimer ;
		coroutine.yield( ) ;
	end
end

function execute_missionparisb1( name )
	-- Inform Treville that the mission to London is complete
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "germain", getString( "mpb1d7" ) ) ;
		
	local overrideSaveID = createOverrideSavePos( "trevillehouse2", -59, -137 ) ;
	setOverrideSaveLevel( overrideSaveID, "trevilleantechamber" ) ;
		
	placeDead( "constance" ) ;
	
	lockOutLeaveParisForMusks( name )
	
	local doorLockA = addDoorLock( name, "", true, "louvreout", "louvreout2" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "reporttreville" ), "treville" ) ;
	
	local triggerArea = addTriggerArea( name, "", false, "trevilleantechamber", { -185, -1, 82, 226 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	removeTriggerArea( triggerArea ) ;

	lockPlayerInPlace( ) ;
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", 113, 30, "trevilleantechamber", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	setMissionFaceCharacter( name, "dartagnan", "treville" ) ;
	sayAndWait( "treville", getString( "mpb1d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb1d2" ) ) ;
	sayAndWait( "treville", getString( "mpb1d3" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb1d4" ) ) ;
	sayAndWait( "treville", getString( "mpb1d5" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb1d6" ) ) ;

	unlockPlayerInPlace( ) ;
	
	unlockOutLeaveParisForMusks( )
	
	removeDoorLock( doorLockA ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb2" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb2( name )
	-- Royal ball in hotel de ville
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "treville", getString( "mpb1d8" ) ) ;
	
	setInventoryItem( "queen_ring", 0 ) ;
		
	lockOutLeaveParisForMusks( name )
	
	placeCharacter( "essart", "hoteldevillehouse", -261, -289 ) ;
	setMissionFaceDirection( name, "essart", 0, 1 ) ;
	
	-- unlock door to hotel de ville
	local doorLockC = addDoorLock( name, "", false, "hoteldevilleout" ) ;
		
	-- create a bunch of guards
	local guard1 = createTempCharacter( getString( "guardsman" ), "hoteldevillehouse", 21, -292 ) ;
	randomDressGuardsman( guard1, 0.0, 46877 ) ;
	setMeleeWeapon( guard1, "sword_1" ) ;
	setMissionFaceDirection( name, guard1, 0, 1 ) ;
	
	local guard2 = createTempCharacter( getString( "guardsman" ), "hoteldevillehouse", 310, -294 ) ;
	randomDressGuardsman( guard2, 0.0, 4467 ) ;
	setMeleeWeapon( guard2, "sword_1" ) ;
	setMissionFaceDirection( name, guard2, 0, 1 ) ;
	
	local guard3 = createTempCharacter( getString( "guardsman" ), "hoteldevillehouse", -464, -296 ) ;
	randomDressGuardsman( guard3, 0.0, 434467 ) ;
	setMeleeWeapon( guard3, "sword_1" ) ;
	setMissionFaceDirection( name, guard3, 0, 1 ) ;

	setMissionChatString( name, guard1, getString( "mpb2d22" ) ) ;
	setMissionChatString( name, guard2, getString( "mpb2d23" ) ) ;
	setMissionChatString( name, guard3, getString( "mpb2d22" ) ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb2m1" ), "essart" ) ;
	waitForTalk( "dartagnan", "essart", false ) ;
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	
	local doorLockA = addDoorLock( name, "missionparisb2LockOut1", true, "hoteldevillein" ) ;
	
	setMissionFaceCharacter( name, "essart", "dartagnan" ) ;
	sayAndWait( "essart", getString( "mpb2d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb2d2" ) ) ;
	sayAndWait( "essart", getString( "mpb2d3" ) ) ;
	setMissionFaceDirection( name, "essart", 0, 1 ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	addGoalGetToPointInLevel( "dartagnan", -179, -290, "hoteldevillehouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	-- set camera to center of room
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "hoteldevillehouse" ) ;
	panCameraTo( -72, -105, 500, true ) ;

	-- bring everyone into the ball
	ballFaceDirections( name ) ;
	
	local betweenEach = 0.7 ;
	placeCharacterInDoor( "chevsouveray", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "chevsouveray", -343, -213, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "comtecramail", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "comtecramail", -300, -213, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "madamemontbazon", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "madamemontbazon", 164, -199, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "donnaestefania", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "donnaestefania", 164, -240, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "comteroche", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "comteroche", -45, -108, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "madameguemenee", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "madameguemenee", -20, -83, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "comteharcourt", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "comteharcourt", -219, -37, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "ducelboeuf", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "ducelboeuf", -180, -37, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "madamelannoy", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "madamelannoy", 100, -10, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "duclongueville", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "duclongueville", 60, -10, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "madamesable", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "madamesable", 80, -30, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "baradas", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "baradas", 80, 10, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "liancout", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "liancout", -295, 38, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "madameguitaut", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "madameguitaut", -335, 38, "hoteldevillehouse", false, true ) ;
	wait( betweenEach ) ;
	placeCharacterInDoor( "madamesurgis", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "madamesurgis", -315, 13, "hoteldevillehouse", false, true ) ;
	
	waitForNoGoal( "chevsouveray" ) ;
	waitForNoGoal( "comtecramail" ) ;
	waitForNoGoal( "comteroche" ) ;
	waitForNoGoal( "comteharcourt" ) ;
	waitForNoGoal( "ducelboeuf" ) ;
	waitForNoGoal( "duclongueville" ) ;
	waitForNoGoal( "baradas" ) ;
	waitForNoGoal( "liancout" ) ;
	waitForNoGoal( "donnaestefania" ) ;
	waitForNoGoal( "madameguemenee" ) ;
	waitForNoGoal( "madameguitaut" ) ;
	waitForNoGoal( "madamelannoy" ) ;
	waitForNoGoal( "madamemontbazon" ) ;
	waitForNoGoal( "madamesable" ) ;
	waitForNoGoal( "madamesurgis" ) ;
	
	ballEveryoneFace( name, "louisxiii" ) ;
	
	placeCharacterInDoor( "louisxiii", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "louisxiii", -136, -180, "hoteldevillehouse", false, true ) ;
	wait( 1 ) ;
	placeCharacterInDoor( "cardinal", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "cardinal", -136, -140, "hoteldevillehouse", false, true ) ;
	wait( 4 ) ;

	setMissionFaceCharacter( name, "louisxiii", "queen" ) ;
	setMissionFaceCharacter( name, "cardinal", "queen" ) ;
	setMissionFaceCharacter( name, "queen", "louisxiii" ) ;
	placeCharacterInDoor( "queen", "hoteldevillein", false ) ;
	addGoalGetToPointInLevel( "queen", -15, -185, "hoteldevillehouse", false, true ) ;
	
	ballEveryoneFace( name, "queen" ) ;
		
	waitForNoGoal( "louisxiii" ) ;
	waitForNoGoal( "cardinal" ) ;
	waitForNoGoal( "queen" ) ;
	
	wait( 1 ) ;
	setMissionFaceCharacter( name, "cardinal", "louisxiii" ) ;
	sayAndWait( "cardinal", getString( "mpb2d4" ) ) ;
	
	addGoalGetToPointInLevel( "louisxiii", -55, -185, "hoteldevillehouse", false, true ) ;
	waitForNoGoal( "louisxiii" ) ;
	sayAndWait( "louisxiii", getString( "mpb2d5" ) ) ;
	sayAndWait( "queen", getString( "mpb2d6" ) ) ;
	sayAndWait( "louisxiii", getString( "mpb2d7" ) ) ;
	sayAndWait( "queen", getString( "mpb2d8" ) ) ;
	sayAndWait( "louisxiii", getString( "mpb2d9" ) ) ;

	addGoalGetToPointInLevel( "queen", 305, -51, "hoteldevillehouse2", false, true ) ;
	addGoalGetToPointInLevel( "louisxiii", 305, -51, "hoteldevillehouse3", false, true ) ;
	
	wait( 3 ) ;
	ballFaceDirections( name ) ;
		
	while ( isCharacterOnScreen( "louisxiii" )
		or  isCharacterOnScreen( "queen" ) ) do
		coroutine.yield( ) ;
	end
	
	wait( 2 ) ;
	clearGoals( "louisxiii" ) ;
	dress_louisxiiiB( "louisxiii" )
	placeCharacterInDoor( "louisxiii", "hoteldeville3out", false ) ;
	addGoalGetToPointInLevel( "louisxiii", -196, -258, "hoteldevillehouse", false, true ) ;
	
	setMissionFaceCharacter( name, "louisxiii", "cardinal" ) ;
	setMissionFaceCharacter( name, "cardinal", "louisxiii" ) ;
	
	waitForNoGoal( "louisxiii" ) ;
	addGoalGetToPointInLevel( "cardinal", -150, -258, "hoteldevillehouse", false, true ) ;
	waitForNoGoal( "cardinal" ) ;

	sayAndWait( "cardinal", getString( "mpb2d10" ) ) ;
	sayAndWait( "louisxiii", getString( "mpb2d11" ) ) ;
	sayAndWait( "cardinal", getString( "mpb2d12" ) ) ;

	clearGoals( "queen" ) ;
	dress_queenB( "queen" )
	placeCharacterInDoor( "queen", "hoteldeville2out", false ) ;
	addGoalGetToPointInLevel( "queen", -30, -180, "hoteldevillehouse", false, true ) ;
	
	wait( 1 ) ;
	setMissionFaceCharacter( name, "louisxiii", "queen" ) ;
	setMissionFaceCharacter( name, "cardinal", "queen" ) ;
	ballEveryoneFace( name, "queen" ) ;
	wait( 2 ) ;
	
	sayAndWait( "cardinal", getString( "mpb2d13" ) ) ;
	sayAndWait( "louisxiii", getString( "mpb2d14" ) ) ;
	
	waitForNoGoal( "queen" ) ;
	
	unlockPlayerInPlace( ) ;
	
	setMissionChatString( name, "essart", getString( "mpb2d32" ) ) ;
	setMissionChatString( name, "cardinal", getString( "mpb2d30" ) ) ;
	setMissionChatString( name, "louisxiii", getString( "mpb2d29" ) ) ;
	setMissionChatString( name, "queen", getString( "mpb2d28" ) ) ;
	setMissionChatString( name, "comteharcourt", getString( "mpb2d33" ) ) ;
	setMissionChatString( name, "liancout", getString( "mpb2d34" ) ) ;
	setMissionChatString( name, "madamemontbazon", getString( "mpb2d24" ) ) ;
	setMissionChatString( name, "madamesable", getString( "mpb2d27" ) ) ;
	setMissionChatString( name, "madamelannoy", getString( "mpb2d31" ) ) ;
	setMissionChatString( name, "duclongueville", getString( "mpb2d24" ) ) ;
	setMissionChatString( name, "baradas", getString( "hello" ) ) ;
	
	setMissionChatString( name, "chevsouveray", getString( "mpb2d24" ) ) ;
	setMissionChatString( name, "donnaestefania", getString( "mpb2d25" ) ) ;
	setMissionChatString( name, "comteroche", getString( "mpb2d26" ) ) ;
	setMissionChatString( name, "madameguitaut", getString( "mpb2d27" ) ) ;
	setMissionChatString( name, "comtecramail", getString( "mpb2d24" ) ) ;
	setMissionChatString( name, "madameguemenee", getString( "mpb2d25" ) ) ;
	setMissionChatString( name, "ducelboeuf", getString( "mpb2d34" ) ) ;
	setMissionChatString( name, "madamesurgis", getString( "mpb2d25" ) ) ;

	
	setCameraFollowCharacter( "dartagnan", true ) ;
	setMissionFaceNone( name, "dartagnan" ) ;
	
	local ballMusicID = addMusic( "ball", 15 ) ;
		
	-- dance around
	addGoalGetToPointInLevel( "cardinal", -206, -252, "hoteldevillehouse", false, true ) ;
	
	-- left side spectators
	setMissionFaceDirection( name, "comteharcourt", 1, 0 ) ;
	setMissionFaceDirection( name, "liancout", 1, 0 ) ;
	addGoalGetToPointInLevel( "comteharcourt", -340, -216, "hoteldevillehouse", false, true ) ;
	addGoalGetToPointInLevel( "liancout", -345, -109, "hoteldevillehouse", false, true ) ;

	-- right side spectators
	setMissionFaceDirection( name, "madamemontbazon", -1, 0 ) ;
	setMissionFaceDirection( name, "madamesable", -1, 0 ) ;
	setMissionFaceDirection( name, "madamelannoy", -1, 0 ) ;
	setMissionFaceDirection( name, "duclongueville", -1, 0 ) ;
	setMissionFaceDirection( name, "baradas", -1, 0 ) ;
	addGoalGetToPointInLevel( "madamemontbazon", 205, -250, "hoteldevillehouse", false, true ) ;
	addGoalGetToPointInLevel( "madamesable", 210, -220, "hoteldevillehouse", false, true ) ;
	addGoalGetToPointInLevel( "madamelannoy", 208, -190, "hoteldevillehouse", false, true ) ;
	addGoalGetToPointInLevel( "duclongueville", 215, -160, "hoteldevillehouse", false, true ) ;
	addGoalGetToPointInLevel( "baradas", 212, -130, "hoteldevillehouse", false, true ) ;

	local centerX = -80 ;
	local centerY = -20 ;
	local danceDistX = 125 ;
	local danceDistY = 80 ;
	local lastStepNum = -1 ;
	local stepNum = 0 ;
	local totalSteps = 0 ;
	while ( totalSteps < 80 ) do
		if ( not ( stepNum == lastStepNum ) ) then
			-- step has changed
			if ( stepNum == 5 ) then
				wait( 1 ) ;
			end
			startDanceStep( name, stepNum, "hoteldevillehouse", -77, -207, "louisxiii", "queen" ) ;
			startDanceStep( name, stepNum, "hoteldevillehouse", centerX - danceDistX, centerY - danceDistY, "chevsouveray", "donnaestefania" ) ;
			startDanceStep( name, stepNum, "hoteldevillehouse", centerX - danceDistX, centerY + danceDistY, "comtecramail", "madameguemenee" ) ;
			startDanceStep( name, stepNum, "hoteldevillehouse", centerX + danceDistX, centerY - danceDistY, "comteroche", "madameguitaut" ) ;
			startDanceStep( name, stepNum, "hoteldevillehouse", centerX + danceDistX, centerY + danceDistY, "ducelboeuf", "madamesurgis" ) ;
		end
		
		lastStepNum = stepNum ;
		local result1 = updateDanceStep( name, stepNum, "louisxiii", "queen" ) ;
		local result2 = updateDanceStep( name, stepNum, "chevsouveray", "donnaestefania" ) ;
		local result3 = updateDanceStep( name, stepNum, "comtecramail", "madameguemenee" ) ;
		local result4 = updateDanceStep( name, stepNum, "comteroche", "madameguitaut" ) ;
		local result5 = updateDanceStep( name, stepNum, "ducelboeuf", "madamesurgis" ) ;
		if ( result1 and result2 and result3 and result4 and result5 ) then
			stepNum = stepNum + 1 ;
			totalSteps = totalSteps + 1 ;
		end
		
		if ( stepNum > 5 ) then
			-- back to first step
			stepNum = 0 ;
		end
		
		coroutine.yield( ) ;
	end
	
	-- spectators positions
	waitForNoGoal( "cardinal" ) ;
	waitForNoGoal( "comteharcourt" ) ;
	waitForNoGoal( "liancout" ) ;
	waitForNoGoal( "madamemontbazon" ) ;
	waitForNoGoal( "madamesable" ) ;
	waitForNoGoal( "madamelannoy" ) ;
	waitForNoGoal( "duclongueville" ) ;
	waitForNoGoal( "baradas" ) ;
	
	removeMusic( ballMusicID ) ;
	
	lockPlayerInPlace( ) ;
	setStateMessageIdle( "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "queen" ) ;

	-- set camera to center of room
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "hoteldevillehouse" ) ;
	panCameraTo( -72, -105, 500, true ) ;

	ballEveryoneFace( name, "queen" ) ;
	
	setMissionFaceCharacter( name, "louisxiii", "queen" ) ;
	setMissionFaceCharacter( name, "cardinal", "queen" ) ;
	setMissionFaceCharacter( name, "queen", "louisxiii" ) ;

	sayAndWait( "louisxiii", getString( "mpb2d16" ) ) ;
	sayAndWait( "queen", getString( "mpb2d17" ) ) ;
	sayAndWait( "louisxiii", getString( "mpb2d18" ) ) ;
	
	addGoalGetToPointInLevel( "cardinal", -109, -290, "hoteldevillehouse", false, true ) ;
	waitForNoGoal( "cardinal" ) ;
	
	setMissionFaceCharacter( name, "louisxiii", "cardinal" ) ;
	setMissionFaceCharacter( name, "queen", "cardinal" ) ;
	sayAndWait( "cardinal", getString( "mpb2d19" ) ) ;
	sayAndWait( "queen", getString( "mpb2d20" ) ) ;
	
	addGoalGetToPointInLevel( "queen", 305, -51, "hoteldevillehouse2", false, true ) ;
	wait( 2 ) ;
	addGoalGetToPointInLevel( "louisxiii", 305, -51, "hoteldevillehouse3", false, true ) ;
	wait( 1 ) ;
	addGoalGetToPointInLevel( "cardinal", 2859, 469, "france", false, true ) ;
	
	while ( isCharacterOnScreen( "queen" )
		or  isCharacterOnScreen( "louisxiii" )
		or  isCharacterOnScreen( "cardinal" ) ) do
		coroutine.yield( ) ;
	end

	-- constance comes in for player to talk to
	placeCharacterInDoor( "constance", "hoteldeville2out", false ) ;
	setMissionFaceCharacter( name, "constance", "dartagnan" ) ;
	addGoalGetToPointInLevel( "constance", 151, -291, "hoteldevillehouse", false, true ) ;

	local marker = addMarkerCharacter( name, true, getString( "speakconstance" ), "constance" ) ;
	
	waitForNoGoal( "constance" ) ;
	
	setCameraFollowCharacter( "dartagnan", true ) ;
	setMissionFaceNone( name, "dartagnan" ) ;
	unlockPlayerInPlace( ) ;	
	
	setMissionChatString( name, "essart", getString( "mpb2d35" ) ) ;
	setMissionChatString( name, "madamelannoy", getString( "mpb2d36" ) ) ;
		
	-- left side spectators
	setMissionFaceDirection( name, "comteharcourt", 1, 0 ) ;
	setMissionFaceDirection( name, "liancout", 1, 0 ) ;
	-- right side spectators
	setMissionFaceDirection( name, "madamemontbazon", -1, 0 ) ;
	setMissionFaceDirection( name, "madamesable", -1, 0 ) ;
	setMissionFaceDirection( name, "madamelannoy", -1, 0 ) ;
	setMissionFaceDirection( name, "duclongueville", -1, 0 ) ;
	setMissionFaceDirection( name, "baradas", -1, 0 ) ;
	
	
	gRunningDance = true ;
	activateScriptMessage( "runNonQueenKingDance" ) ;
	
	waitForTalk( "dartagnan", "constance", false ) ;

	lockPlayerInPlace( ) ;

	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "constance", getString( "mpb2d21" ) ) ;
	removeHeartMaker( "dartagnan" ) ;

	setMissionChatString( name, "constance", getString( "followme" ) ) ;

	unlockPlayerInPlace( ) ;	
	
	-- unlock door to follow constance
	local doorLockB = addDoorLock( name, "", false, "hoteldeville2out" ) ;
	
	addGoalGetToPointInLevel( "constance", 305, -51, "hoteldevillehouse2", false, true ) ;
	
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "hoteldevillehouse2" ) ) do
		coroutine.yield( ) ;
	end

	removeDoorLock( doorLockB ) ;

	removeMarker( name, marker ) ;
	
	-- show comic
	local comic1 = createComic( "queen2" ) ;
	
	addText( comic1, getString( "queen2_d1" ), 12, 249, 146, 279 ) ;
	addText( comic1, getString( "queen2_d2" ), 121, 318, 234, 378 ) ;
	addText( comic1, getString( "queen2_d3" ), 265, 307, 369, 335 ) ;
	addText( comic1, getString( "queen2_d4" ), 389, 306, 543, 375 ) ;
	addText( comic1, getString( "queen2_d5" ), 367, 524, 542, 563 ) ;
	addText( comic1, getString( "queen2_d6" ), 589, 307, 793, 374 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 71, 34, 211, 262, 138, 33 ) ;
	addMouseOver( comic1, getString( "constance" ), 132, 83, 228, 292, 169, 86 ) ;

	addMouseOver( comic1, getString( "queen" ), 405, 60, 490, 253, 439, 63 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 252, 10, 411, 296, 313, 22 ) ;

	addMouseOver( comic1, getString( "queen" ), 710, 39, 783, 112, 748, 33 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 584, 65, 708, 271, 672, 67 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 33, 363, 159, 596, 92, 362 ) ;

	addMouseOver( comic1, getString( "constance" ), 424, 375, 535, 592, 477, 377 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 290, 355, 407, 593, 344, 357 ) ;

	addMouseOver( comic1, getString( "constance" ), 722, 398, 796, 592, 782, 396 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 574, 381, 666, 587, 606, 384 ) ;

	setInventoryItem( "queen_ring", 1 ) ;
		
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
		
		-- hack to stop flicker on return
		setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
		fadeFromColour( 0.5 ) ;
	end
	
	gRunningDance = false ;
	clearGoals( "chevsouveray" ) ;
	clearGoals( "comtecramail" ) ;
	clearGoals( "comteroche" ) ;
	clearGoals( "comteharcourt" ) ;
	clearGoals( "ducelboeuf" ) ;
	clearGoals( "duclongueville" ) ;
	clearGoals( "baradas" ) ;
	clearGoals( "liancout" ) ;
	clearGoals( "donnaestefania" ) ;
	clearGoals( "madameguemenee" ) ;
	clearGoals( "madameguitaut" ) ;
	clearGoals( "madamelannoy" ) ;
	clearGoals( "madamemontbazon" ) ;
	clearGoals( "madamesable" ) ;
	clearGoals( "madamesurgis" ) ;
	
	clearGoals( "queen" ) ;
	clearGoals( "louisxiii" ) ;
	clearGoals( "cardinal" ) ;
	clearGoals( "constance" ) ;
	
	place_queenA( "queen" ) ;
	place_louisxiiiA( "louisxiii" ) ;
	place_cardinalA( "cardinal" ) ;
	place_constanceA( "constance" ) ;
	place_essartA( "essart" ) ;

	removeDoorLock( doorLockC ) ; -- don't let player back in hotel de ville
	placeCharacter( "dartagnan", "france", 2842, 469 ) ;
	faceDirection( "dartagnan", 0, 1 ) ;

	place_chevsouverayA( "chevsouveray" ) ;
	place_comtecramailA( "comtecramail" ) ;
	place_comterocheA( "comteroche" ) ;
	place_comteharcourtA( "comteharcourt" ) ;
	place_ducelboeufA( "ducelboeuf" ) ;
	place_duclonguevilleA( "duclongueville" ) ;
	place_baradasA( "baradas" ) ;
	place_liancoutA( "liancout" ) ;
	place_donnaestefaniaA( "donnaestefania" ) ;
	place_madameguemeneeA( "madameguemenee" ) ;
	place_madameguitautA( "madameguitaut" ) ;
	place_madamelannoyA( "madamelannoy" ) ;
	place_madamemontbazonA( "madamemontbazon" ) ;
	place_madamesableA( "madamesable" ) ;
	place_madamesurgisA( "madamesurgis" ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	removeDoorLock( doorLockA ) ;
	
	unlockOutLeaveParisForMusks( )
		
	deleteTempCharacter( guard1 ) ;
	deleteTempCharacter( guard2 ) ;
	deleteTempCharacter( guard3 ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb3" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function ballFaceDirections( name )
	setMissionFaceCharacter( name, "chevsouveray", "comtecramail" ) ;
	setMissionFaceCharacter( name, "comtecramail", "chevsouveray" ) ;
	setMissionFaceCharacter( name, "madamemontbazon", "donnaestefania" ) ;
	setMissionFaceCharacter( name, "donnaestefania", "madamemontbazon" ) ;
	setMissionFaceCharacter( name, "comteroche", "madameguemenee" ) ;
	setMissionFaceCharacter( name, "madameguemenee", "comteroche" ) ;
	setMissionFaceCharacter( name, "comteharcourt", "ducelboeuf" ) ;
	setMissionFaceCharacter( name, "ducelboeuf", "comteharcourt" ) ;
	setMissionFaceCharacter( name, "madamelannoy", "duclongueville" ) ;
	setMissionFaceCharacter( name, "duclongueville", "madamelannoy" ) ;
	setMissionFaceCharacter( name, "madamesable", "baradas" ) ;
	setMissionFaceCharacter( name, "baradas", "madamesable" ) ;
	setMissionFaceCharacter( name, "liancout", "madameguitaut" ) ;
	setMissionFaceCharacter( name, "madameguitaut", "liancout" ) ;
	setMissionFaceDirection( name, "madamesurgis", 0, 1 ) ;
end

function ballEveryoneFace( name, who )
	setMissionFaceCharacter( name, "chevsouveray", who ) ;
	setMissionFaceCharacter( name, "comtecramail", who ) ;
	setMissionFaceCharacter( name, "madamemontbazon", who ) ;
	setMissionFaceCharacter( name, "donnaestefania", who ) ;
	setMissionFaceCharacter( name, "comteroche", who ) ;
	setMissionFaceCharacter( name, "madameguemenee", who ) ;
	setMissionFaceCharacter( name, "comteharcourt", who ) ;
	setMissionFaceCharacter( name, "ducelboeuf", who ) ;
	setMissionFaceCharacter( name, "madamelannoy", who ) ;
	setMissionFaceCharacter( name, "duclongueville", who ) ;
	setMissionFaceCharacter( name, "madamesable", who ) ;
	setMissionFaceCharacter( name, "baradas", who ) ;
	setMissionFaceCharacter( name, "liancout", who ) ;
	setMissionFaceCharacter( name, "madameguitaut", who ) ;
	setMissionFaceCharacter( name, "madamesurgis", who ) ;
end

function startDanceStep( mission, step, level, posX, posY, name1, name2 )
	local normDist = 15 ;
	local largeDistX = 40 ;
	local largeDistY = 40 ;
	
	if ( step == 0 ) then
		-- step together
		setMissionFaceDirection( mission, name1, 1, 0 ) ;
		setMissionFaceDirection( mission, name2, -1, 0 ) ;
		
		addGoalGetToPointInLevel( name1, posX - normDist, posY, level, false, true ) ;
		addGoalGetToPointInLevel( name2, posX + normDist, posY, level, false, true ) ;
	elseif ( step == 1 ) then
		-- box 1
		setMissionFaceDirection( mission, name1, -1, 0 ) ;
		setMissionFaceDirection( mission, name2, 1, 0 ) ;
		
		addGoalGetToPointInLevel( name1, posX - largeDistX, posY, level, false, true ) ;
		addGoalGetToPointInLevel( name2, posX + largeDistX, posY, level, false, true ) ;
	elseif ( step == 2 ) then
		-- box2
		setMissionFaceDirection( mission, name1, 0, -1 ) ;
		setMissionFaceDirection( mission, name2, 0, -1 ) ;
		
		addGoalGetToPointInLevel( name1, posX - largeDistX, posY - largeDistY, level, false, true ) ;
		addGoalGetToPointInLevel( name2, posX + largeDistX, posY - largeDistY, level, false, true ) ;
	elseif ( step == 3 ) then
		-- back together at top
		setMissionFaceDirection( mission, name1, 1, 0 ) ;
		setMissionFaceDirection( mission, name2, -1, 0 ) ;
		
		addGoalGetToPointInLevel( name1, posX - normDist, posY - largeDistY, level, false, true ) ;
		addGoalGetToPointInLevel( name2, posX + normDist, posY - largeDistY, level, false, true ) ;
	elseif ( step == 4 ) then
		-- diagonal to bottom
		setMissionFaceDirection( mission, name1, 1, 0 ) ;
		setMissionFaceDirection( mission, name2, -1, 0 ) ;
		
		addGoalGetToPointInLevel( name1, posX - largeDistX, posY, level, false, true ) ;
		addGoalGetToPointInLevel( name2, posX + largeDistX, posY, level, false, true ) ;
	elseif ( step == 5 ) then
		-- back together
		setMissionFaceDirection( mission, name1, 1, 0 ) ;
		setMissionFaceDirection( mission, name2, -1, 0 ) ;
		
		addGoalGetToPointInLevel( name1, posX - normDist, posY, level, false, true ) ;
		addGoalGetToPointInLevel( name2, posX + normDist, posY, level, false, true ) ;
	end
end

function updateDanceStep( mission, step, name1, name2 )
	if ( characterHasGoal( name1 ) or characterHasGoal( name2 ) ) then
		return false ;
	else
		return true ;
	end
end

function runNonQueenKingDance( )
	local centerX = -80 ;
	local centerY = -20 ;
	local danceDistX = 125 ;
	local danceDistY = 80 ;
	local lastStepNum = -1 ;
	local stepNum = 0 ;
	local totalSteps = 0 ;
	local missionName = "missionparisb2" ;
	while ( gRunningDance ) do
		if ( not ( stepNum == lastStepNum ) ) then
			-- step has changed
			startDanceStep( missionName, stepNum, "hoteldevillehouse", centerX - danceDistX, centerY - danceDistY, "chevsouveray", "donnaestefania" ) ;
			startDanceStep( missionName, stepNum, "hoteldevillehouse", centerX - danceDistX, centerY + danceDistY, "comtecramail", "madameguemenee" ) ;
			startDanceStep( missionName, stepNum, "hoteldevillehouse", centerX + danceDistX, centerY - danceDistY, "comteroche", "madameguitaut" ) ;
			startDanceStep( missionName, stepNum, "hoteldevillehouse", centerX + danceDistX, centerY + danceDistY, "ducelboeuf", "madamesurgis" ) ;
		end
		
		lastStepNum = stepNum ;
		local result2 = updateDanceStep( missionName, stepNum, "chevsouveray", "donnaestefania" ) ;
		local result3 = updateDanceStep( missionName, stepNum, "comtecramail", "madameguemenee" ) ;
		local result4 = updateDanceStep( missionName, stepNum, "comteroche", "madameguitaut" ) ;
		local result5 = updateDanceStep( missionName, stepNum, "ducelboeuf", "madamesurgis" ) ;
		if ( result2 and result3 and result4 and result5 ) then
			stepNum = stepNum + 1 ;
			totalSteps = totalSteps + 1 ;
		end
		
		if ( stepNum > 5 ) then
			-- back to first step
			stepNum = 0 ;
		end
		
		coroutine.yield( ) ;
	end
end

function missionparisb2LockOut1( )
	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mpb2d15" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb2d15" ) ) ;
	waitForBubbleClosed( bubInd ) ;
end

function execute_missionparisb3( name )
	-- Go home to Planchet - a note has been left for him - on leaving Monsieur Bonacieux is downstairs
	DEBUG_OUTPUT( name .. " started" ) ;
	
	lockOutLeaveParisForMusks( name )

	local marker = addMarkerCharacter( name, true, getString( "mpb3m1" ), "planchet" ) ;

	waitForTalk( "dartagnan", "planchet", false ) ;
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;

	sayAndWait( "dartagnan", getString( "mpb3d1" ) ) ;
	sayAndWait( "planchet", getString( "mpb3d2" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	addHeartMaker( "dartagnan" ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb3d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	sayAndWait( "planchet", getString( "mpb3d4" ) ) ;
	
	sayAndWait( "dartagnan", getString( "mpb3d5" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
		
	unlockPlayerInPlace( ) ;

	local marker = addMarkerPosition( name, true, getString( "mpb4m1" ), "stcloudhousea2", 109, 209 ) ;
	
	placeCharacter( "bonacieux", "bonacieuxhouse", -48, 79 ) ;
	
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "bonacieuxhouse" ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionFaceCharacter( name, "dartagnan", "bonacieux" ) ;
	setMissionFaceCharacter( name, "bonacieux", "dartagnan" ) ;
	
	lockPlayerInPlace( ) ;
	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", -62, 16, "bonacieuxhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	sayAndWait( "bonacieux", getString( "mpb3d6" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb3d7" ) ) ;
	sayAndWait( "bonacieux", getString( "mpb3d8" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb3d9" ) ) ;
	sayAndWait( "bonacieux", getString( "mpb3d10" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb3d11" ) ) ;
	sayAndWait( "bonacieux", getString( "mpb3d12" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb3d13" ) ) ;
	sayAndWait( "bonacieux", getString( "mpb3d14" ) ) ;

	addGoalGetToPointInLevel( "bonacieux", 1758, 2772, "france", false, true ) ;

	while ( isCharacterOnScreen( "bonacieux" ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "bonacieux" ) ;
	place_bonacieuxB( "bonacieux" ) ;

	unlockPlayerInPlace( ) ;

	removeMarker( name, marker ) ;

	unlockOutLeaveParisForMusks( )
	
	completeMission( name ) ;
	activateMission( "missionparisb4" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function lockOutLeaveParisForMusks( missionName )
	gLockOutLeaveParis = addTriggerArea( missionName, "lockOutLeaveParisFunc", true, "france", 
		{ 3935, -918, 4249, -310 } ) ;
end

function unlockOutLeaveParisForMusks( )
	removeTriggerArea( gLockOutLeaveParis ) ;
end

function lockOutLeaveParisFunc( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "cantleaveparismusk" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "cantleaveparismusk" ) ) ;
	
	local x = 3837 ;
	local y = -545 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end

function showPart1EndComic( )
	local comic1 = createComic( "part1end1" ) ;
	
	addText( comic1, getString( "part1end1_d1" ), 5, 6, 243, 97 ) ;
	addText( comic1, getString( "part1end1_d2" ), 302, 15, 542, 75 ) ;
	addText( comic1, getString( "part1end1_d3" ), 260, 532, 541, 572 ) ;
	addText( comic1, getString( "part1end1_d4" ), 564, 446, 786, 550 ) ;
	
	addMouseOver( comic1, getString( "queen" ), 13, 144, 239, 590, 127, 134 ) ;
	addMouseOver( comic1, getString( "constance" ), 295, 116, 404, 332, 353, 106 ) ;
	addMouseOver( comic1, getString( "rochefortunknown" ), 562, 23, 790, 454, 644, 35 ) ;
		
	local comic2 = createComic( "part1end2" ) ;
	
	addText( comic2, getString( "part1end2_d1" ), 22, 13, 215, 65 ) ;
	addText( comic2, getString( "part1end2_d2" ), 106, 105, 221, 139 ) ;
	addText( comic2, getString( "part1end2_d3" ), 110, 343, 239, 380 ) ;
	addText( comic2, getString( "part1end2_d4" ), 14, 551, 232, 590 ) ;
	addText( comic2, getString( "part1end2_d5" ), 258, 73, 541, 148 ) ;
	
	if ( getUpsellSecondGame( ) ) then
		addText( comic2, getString( "part1end2_d6" ), 559, 153, 790, 237 ) ;
	else
		addText( comic2, getString( "part1end2_d6noupsell" ), 559, 153, 790, 237 ) ;
	end
	
	addMouseOver( comic2, getString( "athos" ), 13, 84, 107, 205, 56, 80 ) ;
	addMouseOver( comic2, getString( "porthos" ), 16, 257, 127, 385, 73, 253 ) ;
	addMouseOver( comic2, getString( "aramis" ), 54, 399, 160, 543, 110, 406 ) ;
	addMouseOver( comic2, getString( "milady" ), 307, 167, 509, 474, 404, 168 ) ;
	addMouseOver( comic2, getString( "milady" ), 567, 287, 739, 587, 658, 294 ) ;
end

function execute_missionparisb4( name )
	-- Go to St. Cloud to try and meet with Constance
	DEBUG_OUTPUT( name .. " started" ) ;
	
	local overrideSaveID = createOverrideSavePos( "france", -4021, 2566 ) ;
	setOverrideSaveLevel( overrideSaveID, "stcloudhousea2" ) ;
	setOverrideSaveLevel( overrideSaveID, "stcloudhousea" ) ;
	setOverrideSaveLevel( overrideSaveID, "stcloudhouseb" ) ;
		
	lockOutLeaveParisForMusks( name )

	-- unlock door to villa
	local doorLockA = addDoorLock( name, "", false, "stcloudhouseaout" ) ;

	local markerX = 109 ;
	local markerY = 209 ;
	local marker = addMarkerPosition( name, true, getString( "mpb4m1" ), "stcloudhousea2", markerX, markerY ) ;
	
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "stcloudhousea2" ) ) do
		coroutine.yield( ) ;
	end

	removeMarker( name, marker ) ;

	local tenseMusicID = addMusic( "extratense", 15 ) ;

	lockPlayerInPlace( ) ;
	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", markerX, markerY, "stcloudhousea2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	local waitTime = 0.3 ;
	faceDirection( "dartagnan", -1, 1 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", -1, 0 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", -1, -1 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", 0, -1 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", 1, -1 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", 1, 0 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", 1, 1 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", 0, 1 ) ;

	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb4d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb4d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	removeMusic( tenseMusicID ) ;
		
	if ( gameIsSplit( ) ) then
	
		local titleMusicID = addMusic( "title", 15 ) ;
		
		-- show end game comic
		-- fade to black
		local fadeTime = 0.5 ;
		setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
		fadeToColour( fadeTime ) ;
		while ( isFading( ) ) do
			coroutine.yield( ) ;
		end
			
		-- show comic
		showPart1EndComic( ) ;
		
		setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
		setComicFadeTo( 0.0, 0.0, 0.0 ) ;
				
		while ( isComicShowing( ) ) do
			coroutine.yield( ) ;
		end
	
		-- put characters back to their normal places
		--placeCharacter( "dartagnan", "france", 1766, 2794 ) ;
		
		stopCameraFollowCharacter( ) ;
		setActiveLevelMessage( "blacklevel", 400, 300 ) ;
		
		setPauseButtonVisible( false ) ;
		setWeaponToggleOverrideNotVisible( true ) ;
		setHealthBarVisible( false ) ;
		setOintmentButtonVisible( false ) ;
		setMapButtonVisible( false ) ;
		setInventoryButtonVisible( false ) ;
		
		-- fade from black
		local fadeTime = 0.5 ;
		setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
		fadeFromColour( fadeTime ) ;
		while ( isFading( ) ) do
			coroutine.yield( ) ;
		end
		
		--removeMusic( muskMusicID ) ;
		--local titleMusicID = addMusic( "title", 15 ) ;
		
		
		-- show credits
		
		-- play title music
		--local titleMusicID = addMusic( "title", 15 ) ;
		showCredits( ) ;
		
		-- fade to black
		local fadeTime = 0.5 ;
		setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
		fadeToColour( fadeTime ) ;
		while ( isFading( ) ) do
			coroutine.yield( ) ;
		end
		
		removeMusic( titleMusicID ) ;
					
		setPauseButtonVisible( true ) ;
		setWeaponToggleOverrideNotVisible( false ) ;
		setHealthBarVisible( true ) ;
		setOintmentButtonVisible( true ) ;
		setMapButtonVisible( true ) ;
		setInventoryButtonVisible( true ) ;	
		
		setCameraFollowCharacter( "dartagnan", true ) ;
	
		if ( gameIsSplit( ) and ( getGameSplitPart( ) == 1 ) ) then
			setCompletedPart1( ) ; 
		end
	
		goToMainMenu( ) ;
		-- fade from black
		--local fadeTime = 0.5 ;
		--setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
		--fadeFromColour( fadeTime ) ;
		--while ( isFading( ) ) do
		--	coroutine.yield( ) ;
		--end

		unlockPlayerInPlace( ) ;

		unlockOutLeaveParisForMusks( )

		removeDoorLock( doorLockA ) ;
	
		removeOverrideSavePos( overrideSaveID ) ;
	else
		--bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb4d2" ) ) ;
		--waitForBubbleClosed( bubInd ) ;

		unlockPlayerInPlace( ) ;

		unlockOutLeaveParisForMusks( )

		removeDoorLock( doorLockA ) ;
	
		removeOverrideSavePos( overrideSaveID ) ;
	end

	completeMission( name ) ;
	
	if ( gameIsSplit( ) ) then
		activateMission( "missionparisb4_2" ) ;
	else
		activateMission( "missionparisb4_5" ) ;
	end
	
	DEBUG_OUTPUT( name .. " done" ) ;
end

function showPart2BeginComic( )
	local comic1 = createComic( "part2begin1" ) ;
	
	addText( comic1, getString( "part2begin1_d1" ), 15, 12, 193, 31 ) ;
	addText( comic1, getString( "part2begin1_d2" ), 84, 252, 390, 292 ) ;
	addText( comic1, getString( "part2begin1_d3" ), 417, 14, 793, 63 ) ;
	addText( comic1, getString( "part2begin1_d4" ), 7, 546, 383, 592 ) ;
	addText( comic1, getString( "part2begin1_d5" ), 405, 308, 755, 352 ) ;
	addText( comic1, getString( "part2begin1_d6" ), 412, 538, 631, 592 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 152, 47, 254, 244, 194, 44 ) ;
	addMouseOver( comic1, getString( "porthos" ), 539, 78, 690, 288, 608, 76 ) ;
	addMouseOver( comic1, getString( "athos" ), 475, 132, 564, 264, 520, 133 ) ;
	addMouseOver( comic1, getString( "aramis" ), 656, 130, 780, 284, 701, 128 ) ;

	addMouseOver( comic1, getString( "athos" ), 146, 379, 172, 492, 158, 382 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 174, 383, 197, 485, 186, 385 ) ;
	addMouseOver( comic1, getString( "porthos" ), 198, 370, 235, 488, 214, 370 ) ;
	addMouseOver( comic1, getString( "aramis" ), 239, 379, 277, 486, 248, 379 ) ;
	
	addMouseOver( comic1, getString( "queen" ), 500, 394, 652, 533, 548, 394 ) ;
	addMouseOver( comic1, getString( "cardinal" ), 682, 376, 794, 580, 730, 373 ) ;

	local comic2 = createComic( "part2begin2" ) ;
	
	addText( comic2, getString( "part2begin2_d1" ), 10, 7, 390, 52 ) ;
	addText( comic2, getString( "part2begin2_d2" ), 9, 250, 390, 292 ) ;
	addText( comic2, getString( "part2begin2_d3" ), 410, 10, 791, 70 ) ;
	addText( comic2, getString( "part2begin2_d4" ), 8, 312, 305, 332 ) ;
	addText( comic2, getString( "part2begin2_d5" ), 9, 552, 390, 592 ) ;
	addText( comic2, getString( "part2begin2_d6" ), 412, 310, 792, 360 ) ;
	
	addMouseOver( comic2, getString( "athos" ), 97, 112, 160, 167, 116, 112 ) ;
	addMouseOver( comic2, getString( "dartagnan" ), 185, 64, 380, 234, 319, 66 ) ;
	addMouseOver( comic2, getString( "queen" ), 437, 88, 572, 290, 484, 88 ) ;
	addMouseOver( comic2, getString( "constance" ), 624, 102, 745, 291, 666, 106 ) ;
	addMouseOver( comic2, getString( "dartagnan" ), 760, 94, 797, 231, 781, 104 ) ;
	
	addMouseOver( comic2, getString( "dartagnan" ), 48, 411, 162, 540, 121, 412 ) ;
	addMouseOver( comic2, getString( "porthos" ), 205, 346, 315, 463, 265, 351 ) ;
	addMouseOver( comic2, getString( "athos" ), 299, 416, 392, 511, 342, 418 ) ;
	addMouseOver( comic2, getString( "aramis" ), 329, 314, 397, 401, 364, 313 ) ;

	addMouseOver( comic2, getString( "dartagnan" ), 655, 387, 700, 451, 672, 388 ) ;
end

function execute_missionparisb4_2( name )
	-- Do tutorial
	DEBUG_OUTPUT( name .. " started" ) ;
	
	local titleMusicID = addMusic( "title", 15 ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", -4021, 2566 ) ;
	setOverrideSaveLevel( overrideSaveID, "stcloudhousea2" ) ;
	setOverrideSaveLevel( overrideSaveID, "stcloudhousea" ) ;
	setOverrideSaveLevel( overrideSaveID, "stcloudhouseb" ) ;

	lockOutLeaveParisForMusks( name )

	-- unlock door to villa
	local doorLockA = addDoorLock( name, "", false, "stcloudhouseaout" ) ;

	local playTutorial = false ;	
	
	if ( gameIsSplit( ) and getGameSplitPart( ) == 1 ) then
		-- going back to main menu, don't do anything else
		wait( 10000000 ) ;
		wait( 10000000 ) ;
		wait( 10000000 ) ;
		wait( 10000000 ) ;
	end
	
	-- show summary comic, tutorial and play scene with d'art going into room without Constance
	
	setPauseButtonVisible( false ) ;
	setWeaponToggleOverrideNotVisible( true ) ;
	setHealthBarVisible( false ) ;
	setOintmentButtonVisible( false ) ;
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	
	
	stopCameraFollowCharacter( ) ;
	setActiveLevelMessage( "blacklevel", 400, 300 ) ;
				
	-- show begin game comic
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	-- show comic
	showPart2BeginComic( ) ;
	
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end

	-- put characters back to their normal places
	--placeCharacter( "dartagnan", "france", 1766, 2794 ) ;
	
	if ( not getBooleanExists( "playedfrombeginning" ) ) then
		setBoolean( "playedfrombeginning", false ) ;
	end
	
	if ( not getBoolean( "playedfrombeginning" ) ) then
		-- show tutorial?
		gChoosePart2TutYes = false ;
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "choosepart2tut", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
		
		if ( gChoosePart2TutYes ) then
			playTutorial = true ;
		end
	end
	
	
	setPauseButtonVisible( true ) ;
	setWeaponToggleOverrideNotVisible( true ) ;
	setHealthBarVisible( false ) ;
	setOintmentButtonVisible( false ) ;
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	
	placeCharacter( "dartagnan", "stcloudhousea2", 163, 47 ) ;
			
	setCameraFollowCharacter( "dartagnan", true ) ;
	
	local markerX = 109 ;
	local markerY = 209 ;
	
	lockPlayerInPlace( ) ;
	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", markerX, markerY, "stcloudhousea2", false, true ) ;
	
	removeMusic( titleMusicID ) ;
	local tenseMusicID = addMusic( "extratense", 15 ) ;
		
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	waitForNoGoal( "dartagnan" ) ;

	local waitTime = 0.3 ;
	faceDirection( "dartagnan", -1, 1 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", -1, 0 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", -1, -1 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", 0, -1 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", 1, -1 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", 1, 0 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", 1, 1 ) ;
	wait( waitTime ) ;
	faceDirection( "dartagnan", 0, 1 ) ;

	if ( playTutorial ) then
		if ( hasOwnedHorse( "dartagnan" ) ) then
			removeOwnedHorse( "dartagnan" ) ;
			placeVehicle( "posthorse4", "france", -30000, 0 ) ;
		end
		
		-- set variables so tutorial stuff will still happen
		setBoolean( "stillneedselltutorial", true ) ;
		setBoolean( "stillneedsellskeytut", true ) ;
		setBoolean( "stillneedbuytutorial", true ) ;
		setBoolean( "stillneednohealthointtutorial", true ) ;
		setBoolean( "stillneedleveluptutorial", true ) ;
		setBoolean( "shownmultimarkertut", false ) ;
		setBoolean( "gunsAvailable", false ) ;
		
		-- Show Bubble tutorials
		setNumClickTutBubbles( 0 ) ;
	else
		if ( not hasOwnedHorse( "dartagnan" ) ) then
			setOwnedHorse( "dartagnan", "posthorse4" ) ;
			placeVehicle( "posthorse4", "france", -4134, 2271 ) ;
		end

		-- set variables so tutorial stuff won't still happen
		setBoolean( "stillneedselltutorial", false ) ;
		setBoolean( "stillneedsellskeytut", false ) ;
		setBoolean( "stillneedbuytutorial", false ) ;
		setBoolean( "stillneednohealthointtutorial", false ) ;
		setBoolean( "stillneedleveluptutorial", false ) ;
		setBoolean( "shownmultimarkertut", true ) ;
		setBoolean( "gunsAvailable", true ) ;
	end

	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb4d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb4d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	removeMusic( tenseMusicID ) ;
	
	unlockPlayerInPlace( ) ;
	
	unlockOutLeaveParisForMusks( )

	removeDoorLock( doorLockA ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;

	if ( playTutorial ) then
		completeMission( name ) ;
		activateMission( "missionparisb4_tut1" ) ;
	else
		completeMission( name ) ;
		activateMission( "missionparisb4_5" ) ;
	end

	DEBUG_OUTPUT( name .. " done" ) ;
end

function setClickObjectOpen( clickObjectName )
	local crate1ID = getClickObjectID( clickObjectName ) ;
	setClickObjectTileState( crate1ID, 2 ) ;
	setClickObjectHighlightable( crate1ID, false ) ;
	setNoResetClickObject( crate1ID ) ;
end

function setClickObjectClosedSoon( clickObjectName )
	local crate1ID = getClickObjectID( clickObjectName ) ;
	
	local minResetTime = 5 * 60 ; -- 10 minutes
	local maxResetTime = 15 * 60 ; -- 30 minutes
	local timeToReset = randomInt( minResetTime, maxResetTime ) ;
	setTimeToReset( crate1ID, timeToReset ) ;
end

function lockOutHelper( levelName, x, y, text )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 200.0, true, getString( "mpb29d14" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, text ) ;

	addGoalGetToPointInLevel( "dartagnan", x, y, levelName, false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function missionparisb4_tut1_lockoutA( )
	lockOutHelper( "france", -4288, 2282, getString( "tut1_talkman" ) ) ;
end

function missionparisb4_tut1_lockoutB( )
	lockOutHelper( "france", -4190, 2578, getString( "tut1_talkman" ) ) ;
end

function missionparisb4_tut1_lockoutC( )
	lockOutHelper( "france", -3915, 2751, getString( "tut1_talkman" ) ) ;
end

function missionparisb4_tut1_lockoutD( )
	lockOutHelper( "france", -3920, 2553, getString( "tut1_talkman" ) ) ;
end

function missionparisb4_tut1_lockoutE( )
	lockOutHelper( "france", -4800, 2580, getString( "tut1_talklady" ) ) ;
end

function missionparisb4_tut1_lockoutF( )
	lockOutHelper( "france", -3937, 2583, getString( "tut1_talklady" ) ) ;
end

function missionparisb4_tut1_lockoutG( )
	lockOutHelper( "france", -4800, 2580, getString( "tut1_talkmanhouse" ) ) ;
end

function missionparisb4_tut1_lockoutH( )
	lockOutHelper( "france", -3937, 2583, getString( "tut1_talkmanhouse" ) ) ;
end

function execute_missionparisb4_tut1( name )
	-- Part 2 tut 1
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setForceShowFootprintGuide( true ) ;
	
	local doorLockA = addDoorLock( name, "", false, "stcloudhouseaout" ) ;
	local doorLockB = addDoorLock( name, "", true, "stcloudhousecout" ) ;
	local doorLockC = addDoorLock( name, "", true, "stcloudhousebout" ) ;

	local triggerAreaA = addTriggerArea( name, "missionparisb4_tut1_lockoutA", true, "france", 
		{ -4692, 1734, -4361, 2437 } ) ;

	local triggerAreaB = addTriggerArea( name, "missionparisb4_tut1_lockoutB", true, "france", 
		{ -4316, 2454, -4156, 2818, -4308, 3085, -4776, 2486 } ) ;

	local triggerAreaC = addTriggerArea( name, "missionparisb4_tut1_lockoutC", true, "france", 
		{ -4052, 2834, -3682, 3029 } ) ;

	local triggerAreaD = addTriggerArea( name, "missionparisb4_tut1_lockoutD", true, "france", 
		{ -3860, 2276, -3539, 2867 } ) ;

	setPauseButtonVisible( true ) ;
	setWeaponToggleOverrideNotVisible( true ) ;
	setHealthBarVisible( false ) ;
	setOintmentButtonVisible( false ) ;
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	
	setClickObjectOpen( "stcloudcrate1" ) ;
	setClickObjectOpen( "stcloudcrate2" ) ;
	setClickObjectOpen( "stcloudcrate3" ) ;
	setClickObjectOpen( "stcloudcrate4" ) ;
	setClickObjectOpen( "stcloudcrate5" ) ;
	setClickObjectOpen( "stcloudcrate6" ) ;
	setClickObjectOpen( "stcloudcrate7" ) ;
	setClickObjectOpen( "stcloudbarrel1" ) ;
	setClickObjectOpen( "stcloudbarrel2" ) ;
	setClickObjectOpen( "stcloudbarrel3" ) ;
	setClickObjectOpen( "stcloudbarrel4" ) ;
	setClickObjectOpen( "stcloudbarrel5" ) ;

	setMissionChatString( name, "stcloudman2", getString( "mpb4d4" ) ) ;
	setMissionChatString( name, "stcloudlady1", getString( "mpb4d6" ) ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb4m2" ), "stcloudman2" ) ;
	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "followpathpart2", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	

	
	-- show tutorial on how to go downstairs
	local closeToStairsLast = false ;
	local timeCloseToStairs = 0.0 ;
	local showTutorialTime = 6.0 ;
	local showedTutorial = false ;
	while ( ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "stcloudhousea" ) ) and ( not showedTutorial ) ) do
		if ( distanceToPoint( "dartagnan", "stcloudhousea2", 162, 19 ) < 200 ) then
			timeCloseToStairs = timeCloseToStairs + getDeltaT( ) ;
			if ( timeCloseToStairs > showTutorialTime ) then
				if ( isCharacterIdle( "dartagnan" ) ) then
					waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
					setDialogueScript( "stcloudgodownstairs", 0 ) ;
					waitForNoActiveTutorialDialogue( ) ;
					showedTutorial = true ;
				end
			end
			closeToStairsLast = true ;
		else
			closeToStairsLast = false ;
			timeCloseToStairs = 0.0 ;
		end
		coroutine.yield( ) ;
	end
	
	
	
	-- show tutorial on how to go outside
	local closeToDoorLast = false ;
	local timeCloseToDoor = 0.0 ;
	local showTutorialTime = 4.0 ;
	local showedTutorial = false ;
	while ( ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "france" ) ) and ( not showedTutorial ) ) do
		if ( distanceToPoint( "dartagnan", "stcloudhousea", 139, 262 ) < 180 ) then
			timeCloseToDoor = timeCloseToDoor + getDeltaT( ) ;
			if ( timeCloseToDoor > showTutorialTime ) then
				if ( isCharacterIdle( "dartagnan" ) ) then
					waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
					setDialogueScript( "stcloudgooutside", 0 ) ;
					waitForNoActiveTutorialDialogue( ) ;
					showedTutorial = true ;
				end
			end
			closeToDoorLast = true ;
		else
			closeToDoorLast = false ;
			timeCloseToDoor = 0.0 ;
		end
		coroutine.yield( ) ;
	end
	
	-- lock into area to speak to the first man
	
	-- show tutorial for speaking to character
	local closeToCharacterLast = false ;
	local timeCloseToCharacter = 0.0 ;
	local showTutorialTime = 4.0 ;
	local showedTutorial = false ;
	local waitingTalkNum = setWaitingForTalk( "dartagnan", "stcloudman2", false ) ;
	while ( not hasWaitingTalkOccured( waitingTalkNum ) ) do
		if ( not showedTutorial ) then
			if ( distanceBetweenCharacters( "dartagnan", "stcloudman2" ) < 140 ) then
				timeCloseToCharacter = timeCloseToCharacter + getDeltaT( ) ;
				if ( timeCloseToCharacter > showTutorialTime ) then
					
					if ( isCharacterIdle( "dartagnan" ) ) then
					
						waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
						setDialogueScript( "talktostcloudcharacter", 0 ) ;
						waitForNoActiveTutorialDialogue( ) ;
						showedTutorial = true ;
					end
				end
				closeToCharacterLast = true ;
			else
				closeToCharacterLast = false ;
				timeCloseToCharacter = 0.0 ;
			end
		end
	
		coroutine.yield( ) ;
	end
	setDoneWaitingTalk( waitingTalkNum ) ;
	
	removeMarker( name, marker ) ;



	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "stcloudman2", true ) ;
	
	setMissionFaceCharacter( name, "stcloudman2", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mpb4d3" ) ) ;
	sayAndWait( "stcloudman2", getString( "mpb4d4" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "stcloudman2", false ) ;


	removeTriggerArea( triggerAreaA ) ;
	removeTriggerArea( triggerAreaB ) ;
	removeTriggerArea( triggerAreaC ) ;
	removeTriggerArea( triggerAreaD ) ;
	

	local triggerAreaE = addTriggerArea( name, "missionparisb4_tut1_lockoutE", true, "france", 
		{ -5193, 2238, -4876, 2865 } ) ;

	local triggerAreaF = addTriggerArea( name, "missionparisb4_tut1_lockoutF", true, "france", 
		{ -3859, 2294, -3569, 2865 } ) ;


	
	local marker = addMarkerCharacter( name, true, getString( "mpb4m2" ), "stcloudlady1" ) ;
	waitForTalk( "dartagnan", "stcloudlady1", false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "stcloudlady1", true ) ;
	
	setMissionFaceCharacter( name, "stcloudlady1", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mpb4d5" ) ) ;
	sayAndWait( "stcloudlady1", getString( "mpb4d6" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "stcloudlady1", false ) ;
	
	
	removeTriggerArea( triggerAreaE ) ;
	removeTriggerArea( triggerAreaF ) ;
	removeDoorLock( doorLockC ) ;
	
	local triggerAreaG = addTriggerArea( name, "missionparisb4_tut1_lockoutG", true, "france", 
		{ -5193, 2238, -4876, 2865 } ) ;

	local triggerAreaH = addTriggerArea( name, "missionparisb4_tut1_lockoutH", true, "france", 
		{ -3859, 2294, -3569, 2865 } ) ;
	
	
	-- talked to man1
	local marker = addMarkerCharacter( name, true, getString( "mpb4m2" ), "stcloudman1" ) ;
	waitForTalk( "dartagnan", "stcloudman1", false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "stcloudman1", true ) ;
	
	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	setMissionFaceCharacter( name, "stcloudman1", "dartagnan" ) ;
	sayAndWait( "stcloudman1", getString( "mpb4d7" ) ) ;
	
	local bribed = false ;
	local showedTutOnce = false ;
	while ( not bribed ) do
		bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb4d8" ), getString( "mpb4d9" ) ) ;
		
		local waitedTime = 0.0 ;
		local tutAfterTime = 5.0 ;
		while ( isBubbleOpen( bubInd ) ) do
			waitedTime = waitedTime + getDeltaT( ) ;
			if ( waitedTime > tutAfterTime ) then
				-- do tut for chosing option
				waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
				if ( showedTutOnce ) then
					setDialogueScript( "stcloudclickbubbleoption2", bubInd ) ;
				else
					setDialogueScript( "stcloudclickbubbleoption1", bubInd ) ;
				end
				waitForNoActiveTutorialDialogue( ) ;
				showedTutOnce = true ;
				while ( isBubbleOpen( bubInd ) ) do
					-- wait until bubble is closed to continue normal execution path
					coroutine.yield( ) ;
				end
			else
				coroutine.yield( ) ;
			end
		end
		local optionPressed = bubbleOptionPressed( bubInd ) ;
		deleteBubble( bubInd ) ;
		local option = optionPressed ;
		
		if ( option == 0 ) then
			sayAndWait( "stcloudman1", getString( "mpb4d10" ) ) ;
		else
			bribed = true ;
		end
	end
	
	playSound( "dropmoney", 0.5 ) ;
		
	sayAndWait( "stcloudman1", getString( "mpb4d11" ) ) ;
	sayAndWait( "stcloudman1", getString( "mpb4d12" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb4d13" ) ) ;
	sayAndWait( "stcloudman1", getString( "mpb4d14" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb4d15" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	sayAndWait( "stcloudman1", getString( "mpb4d16" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb4d17" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb4d18" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "stcloudman1", false ) ;
	
	removeMusic( tenseMusicID ) ;
		
	removeMoney( 10 ) ; -- bribe the man

	setForceShowFootprintGuide( false ) ;

	removeTriggerArea( triggerAreaG ) ;
	removeTriggerArea( triggerAreaH ) ;
	
	removeDoorLock( doorLockA ) ;
	removeDoorLock( doorLockB ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb4_tut2" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionparisb4_tut2_lockoutA( )
	lockOutHelper( "france", -4801, 2583, getString( "tut1_gettoparis" ) ) ;
end

function missionparisb4_tut2_lockoutB( )
	lockOutHelper( "france", -3452, 2232, getString( "tut1_maninsulted" ) ) ;
end

function execute_missionparisb4_tut2( name )
	-- fight tutorial
	DEBUG_OUTPUT( name .. " started" ) ;

	setInventoryItem( "ointment", 7 ) ;
	
	local doorLockA = addDoorLock( name, "", false, "stcloudhouseaout" ) ;
	local doorLockB = addDoorLock( name, "", true, "stcloudhousecout" ) ;

	local triggerAreaA = addTriggerArea( name, "missionparisb4_tut2_lockoutA", true, "france", 
		{ -5180, 2311, -4876, 2877 } ) ;

	local markerX = -976 ;
	local markerY = 2506 ;
	local marker = addMarkerPosition( name, true, getString( "tut1_markertreville" ), "france", markerX, markerY ) ;
	
	setOverrideNoHealthOintmentTutorial( true ) ;
	

	setPauseButtonVisible( true ) ;
	setWeaponToggleOverrideNotVisible( false ) ;
	setHealthBarVisible( false ) ;
	setOintmentButtonVisible( false ) ;
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	

	-- create enemy
	local enemyStartX = -3607 ;
	local enemyStartY = 2374 ;
	local tempChar1 = createTempCharacter( getString( "highwayman" ), "france", enemyStartX, enemyStartY ) ;
	setStatsCalculatorStatic( tempChar1, 14, 14, 14, 14 ) ; -- 6, 6, 6, 6
	--setStatsCalculatorDynamic( tempChar1, -10, -10, 2, 1000, 0.5 ) ;
	randomDressEnemy( tempChar1, 0.0, 45768 ) ;
	setHasLootDrop( tempChar1, false ) ;
	setMeleeWeapon( tempChar1, "sword_1" ) ;
	setMissionFaceCharacter( name, tempChar1, "dartagnan" ) ;
	

	-- wait until we get close to enemy
	local triggerAreaB = addTriggerArea( name, "", false, "france", 
		{ -3861, 2251, -3384, 2783, -3757, 2862, -3859, 2445 } ) ;
	
	while ( not triggerAreaTriggered( triggerAreaB ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	removeTriggerArea( triggerAreaB ) ;
	

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( tempChar1, true ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", enemyStartX - 75, enemyStartY + 75, "france", false ) ;
	waitForNoGoal( "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", tempChar1 ) ;

	local bubInd = characterSay( tempChar1, true, -1, -1, true, getString( "mt4d2_5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mt4d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( tempChar1, true, -1, -1, true, getString( "mt4d4" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mt4d5" ), getString( "mt4d6" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	
	if ( option == 1 ) then
		bubInd = characterSay( tempChar1, true, -1, -1, true, getString( "mt4d7" ) ) ;
		waitForBubbleClosed( bubInd ) ;
		bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mt4d8" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	end
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( tempChar1, false ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;

	
	local triggerAreaC = addTriggerArea( name, "missionparisb4_tut2_lockoutB", true, "france", 
		{ -3389, 1808, -3084, 2519 } ) ;
	

	makeEnemies( "dartagnan", tempChar1 ) ;
	addWatchCharacterUnlimited( tempChar1 ) ;
	setIgnoreAll( tempChar1, true ) ; -- enemy won't come at us
	
	removeMarker( name, marker ) ;
	local marker = addMarkerCharacter( name, true, getString( "mt4m1" ), tempChar1 ) ;

	gTutAttackEnemyName = tempChar1 ;	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "attackenemy", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	setIgnoreAll( tempChar1, false ) ;
	setHealthBarVisible( true ) ;
	
	-- make sure dartagnan doesn't die
	setCharacterSlowDamage( "dartagnan", true ) ;
	
	wait( 2 ) ;
		
	while ( not isCharacterFighting( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end
	
	-- character is fighting now - freeze game and show tutorial for player health bar + enemy health bar
	setMissionFreezeGame( name, true ) ;
		
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "playerhealthbar", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;

	setMissionFreezeGame( name, false ) ;

	wait( 2 ) ;

	--while ( isCharacterAlive( tempChar1 ) and ( not isCharacterFighting( "dartagnan" ) ) ) do
	--	coroutine.yield( ) ;
	--end
	
	local clickEnemyTutNum = 3 ;
	
	while ( isCharacterAlive( tempChar1 ) and ( getFightClickedOnCharacter( tempChar1 ) <= clickEnemyTutNum ) ) do
		coroutine.yield( ) ;
	end
	
	if ( isCharacterAlive( tempChar1 ) and ( getFightClickedOnCharacter( tempChar1 ) >= clickEnemyTutNum ) ) then
		-- show "don't click" tutorial if player has clicked opponent a lot
		setMissionFreezeGame( name, true ) ;
			
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "fight1repeatclick", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
	
		setMissionFreezeGame( name, false ) ;		
	end

	-- if player keeps clicking, tell them again
	local clickEnemyTutNum = getFightClickedOnCharacter( tempChar1 ) + 4 ;
	
	while ( isCharacterAlive( tempChar1 ) and ( getFightClickedOnCharacter( tempChar1 ) <= clickEnemyTutNum ) ) do
		coroutine.yield( ) ;
	end
	
	if ( isCharacterAlive( tempChar1 ) and ( getFightClickedOnCharacter( tempChar1 ) >= clickEnemyTutNum ) ) then
		-- show "don't click" tutorial if player has clicked opponent a lot
		setMissionFreezeGame( name, true ) ;
			
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "fight1repeatclick", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
	
		setMissionFreezeGame( name, false ) ;		
	end

	while ( isCharacterAlive( tempChar1 ) ) do
		coroutine.yield( ) ;
	end	
	
	setCharacterSlowDamage( "dartagnan", false ) ;
		
	-- make sure dartagnan was injured at least a bit
	if ( getRatioHealth( "dartagnan" ) > 0.9 ) then
		setRatioHealth( "dartagnan", 0.9 ) ;
	end	
	
	setOintmentButtonVisible( true ) ;
	--coroutine.yield( ) ; -- let ointment position itself
		
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "useointment", 2 ) ;
	waitForNoActiveTutorialDialogue( ) ;

	removeMarker( name, marker ) ;
	
	removeTriggerArea( triggerAreaA ) ;
	removeTriggerArea( triggerAreaC ) ;
	
	setOverrideNoHealthOintmentTutorial( false ) ;
	
	removeDoorLock( doorLockA ) ;
	removeDoorLock( doorLockB ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb4_tut3" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function missionparisb4_tut3_lockoutA( )
	lockOutHelper( "france", -4801, 2583, getString( "tut1_gettoparis" ) ) ;
end

function missionparisb4_tut3_lockoutB( )
	lockOutHelper( "france", -3136, 2145, getString( "tut1_opencrate" ) ) ;
end

function execute_missionparisb4_tut3( name )
	-- Open crate
	DEBUG_OUTPUT( name .. " started" ) ;

	local crate1ID = getClickObjectID( "stcloudcrate8" ) ;
	resetClickObject( crate1ID ) ;
	
	local barrel1ID = getClickObjectID( "stcloudbarrel6" ) ;
	resetClickObject( barrel1ID ) ;

	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;

	local doorLockA = addDoorLock( name, "", false, "stcloudhouseaout" ) ;
	local doorLockB = addDoorLock( name, "", true, "stcloudhousecout" ) ;

	local triggerAreaA = addTriggerArea( name, "missionparisb4_tut3_lockoutA", true, "france", 
		{ -5173, 2235, -4872, 2811 } ) ;
	local triggerAreaB = addTriggerArea( name, "missionparisb4_tut3_lockoutB", true, "france", 
		{ -3070, 1749, -2804, 2614 } ) ;

	local markerX = -976 ;
	local markerY = 2506 ;
	local marker = addMarkerPosition( name, true, getString( "tut1_markertreville" ), "france", markerX, markerY ) ;
	
	local crateID = getClickObjectID( "stcloudcrate8" ) ;
	local crateX = 0 ;
	local crateY = 0 ;
	crateX, crateY = getClickObjectPos( crateID ) ;
	
	-- make sure crate is closed and clickable
	setClickObjectTileState( crateID, 1 ) ;
	setClickObjectHighlightable( crateID, true ) ;

	local triggerAreaC = addTriggerArea( name, "", false, "france", 
		{ -3466, 2058, -3115, 2021, -3048, 2415, -3420, 2372 } ) ;
	
	while ( not triggerAreaTriggered( triggerAreaC ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	removeTriggerArea( triggerAreaC ) ;

	lockPlayerInPlace( ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", -3362, 2176, "france", false ) ;
	waitForNoGoal( "dartagnan" ) ;

	unlockPlayerInPlace( ) ;
	
	local marker = addMarkerClickObject( name, true, getString( "mt5m1" ), crateID ) ;

	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "searchcrate", crateID ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	-- wait for item to exist
	while( not pickUpElementExists( "tut_crate_ointment_1" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	addMarkerPickUp( name, true, getString( "mt5m2" ), "tut_crate_ointment_1" ) ;
	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "cratepickupointment", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
				
	removeMarker( name, marker ) ;
	
	removeTriggerArea( triggerAreaA ) ;
	removeTriggerArea( triggerAreaB ) ;
	
	removeDoorLock( doorLockA ) ;
	removeDoorLock( doorLockB ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb4_tut4" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end	

function missionparisb4_tut4_lockoutA( )
	lockOutHelper( "france", -3827, 2575, getString( "tut1_gettoparis" ) ) ;
end

function missionparisb4_tut4_lockoutB( )
	lockOutHelper( "france", -2776, 2143, getString( "tut1_openbarrel" ) ) ;
end

function execute_missionparisb4_tut4( name )
	-- Open barrel
	DEBUG_OUTPUT( name .. " started" ) ;
		
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;

	local barrelID = getClickObjectID( "stcloudbarrel6" ) ;
	resetClickObject( barrelID ) ;
	local barrelX, barrelY = getClickObjectPos( barrelID ) ;

	setClickObjectOpen( "stcloudcrate8" ) ;
	
	local triggerAreaA = addTriggerArea( name, "missionparisb4_tut4_lockoutA", true, "france", 
		{ -4199, 2280, -3878, 2843 } ) ;
	local triggerAreaB = addTriggerArea( name, "missionparisb4_tut4_lockoutB", true, "france", 
		{ -2722, 1878, -2262, 2709 } ) ;

	
	local markerX = -976 ;
	local markerY = 2506 ;
	local marker = addMarkerPosition( name, true, getString( "tut1_markertreville" ), "france", markerX, markerY ) ;
	

	
	-- make sure barrel is closed and clickable
	setClickObjectTileState( barrelID, 1 ) ;
	setClickObjectHighlightable( barrelID, true ) ;
	
	-- make sure we don't have any gloves from picking them up previously
	unequipItem( "gloves_poor_1" ) ;
	setInventoryItem( "gloves_poor_1", 0 ) ;
	
	
	local triggerAreaC = addTriggerArea( name, "", false, "france", 
		{ -3074, 1977, -2725, 2477 } ) ;
	
	while ( not triggerAreaTriggered( triggerAreaC ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	removeTriggerArea( triggerAreaC ) ;
	

	lockPlayerInPlace( ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", -2990, 2142, "france", false ) ;
	waitForNoGoal( "dartagnan" ) ;

	unlockPlayerInPlace( ) ;
	
	local marker = addMarkerClickObject( name, true, getString( "mt6m1" ), barrelID ) ;

	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "searchbarrel_tut1", barrelID ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	-- wait for item to exist
	while( not pickUpElementExists( "tut_barrel_gloves_1" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	addMarkerPickUp( name, true, getString( "mt6m2" ), "tut_barrel_gloves_1" ) ;

	-- wait until gloves are in players inventory	
	while( numOfItemType( "gloves_poor_1" ) < 1 ) do
		coroutine.yield( ) ;
	end
				
	removeMarker( name, marker ) ;
	
	setInventoryButtonVisible( true ) ;
	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "inventory", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	removeTriggerArea( triggerAreaA ) ;
	removeTriggerArea( triggerAreaB ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb4_tut5" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end	

function missionparisb4_tut5_lockoutA( )
	lockOutHelper( "france", -2998, 2194, getString( "tut1_gettoparis" ) ) ;
end

function missionparisb4_tut5_lockoutB( )
	lockOutHelper( "france", -1960, 2307, getString( "tut1_protectmonk" ) ) ;
end

function missionparisb4_tut5_lockoutC( )
	lockOutHelper( "france", -1960, 2307, getString( "tut1_monkreward1" ) ) ;
end

function missionparisb4_tut5_lockoutD( )
	lockOutHelper( "france", -1960, 2307, getString( "tut1_pickuppistol" ) ) ;
end

function missionparisb4_tut5_lockoutE( )
	lockOutHelper( "france", -1960, 2307, getString( "tut1_protectmonk" ) ) ;
end

function missionparisb4_tut5_lockoutF( )
	lockOutHelper( "france", -1960, 2307, getString( "tut1_monkreward1" ) ) ;
end
	
function execute_missionparisb4_tut5( name )
	-- fight two enemies and get map
	DEBUG_OUTPUT( name .. " started" ) ;
		
	setMapButtonVisible( false ) ;

	setBoolean( "gunsAvailable", false ) ;
	
	if ( hasOwnedHorse( "dartagnan" ) ) then
		removeOwnedHorse( "dartagnan" ) ;
		placeVehicle( "posthorse4", "france", -30000, 0 ) ;
	end
	
	-- make sure we don't have gun from getting previously
	unequipItem( "pistol_wheellock_1" ) ;
	setInventoryItem( "pistol_wheellock_1", 0 ) ;
	

	setClickObjectOpen( "stcloudbarrel6" ) ;
	setClickObjectOpen( "stcloudcrate8" ) ;

	local triggerAreaA = addTriggerArea( name, "missionparisb4_tut5_lockoutA", true, "france", 
		{ -3357, 1776, -3082, 2551 } ) ;
	local triggerAreaB = addTriggerArea( name, "missionparisb4_tut5_lockoutB", true, "france", 
		{ -1870, 1887, -1390, 2940 } ) ;

	
	local marker = addMarkerCharacter( name, true, getString( "tut1_markertreville" ), "treville" ) ;
	


	-- two enemies attacking monk
	local monkPosX = -2417 ;
	local monkPosY = 2217 ;	
	local monk = createTempCharacter( getString( "monk" ), "france", monkPosX, monkPosY ) ;
	dress_roadhousebman( monk ) ;
	
	setBaseChatString( monk, getString( "tut1_monkside_d1" ) ) ;
		
	local enemy1PosX = -2359 ;
	local enemy1PosY = 2215 ;
	local enemy1 = createTempCharacter( getString( "highwayman" ), "france", enemy1PosX, enemy1PosY ) ;
	setStatsCalculatorStatic( enemy1, 19, 19, 19, 19 ) ; -- 4, 4, 4, 4
	randomDressEnemy( enemy1, 0.0, 7127 ) ;
	setMeleeWeapon( enemy1, "sword_1" ) ;
	setHasLootDrop( enemy1, false ) ;
	setMissionFaceCharacter( name, enemy1, monk ) ;
	
	local enemy2PosX = -2391 ;
	local enemy2PosY = 2265 ;
	local enemy2 = createTempCharacter( getString( "highwayman" ), "france", enemy2PosX, enemy2PosY ) ;
	setStatsCalculatorStatic( enemy2, 19, 19, 19, 19 ) ; -- 4, 4, 4, 4
	randomDressEnemy( enemy2, 0.0, 7128 ) ;
	setMeleeWeapon( enemy2, "sword_1" ) ;
	setHasLootDrop( enemy2, false ) ;
	setMissionFaceCharacter( name, enemy2, monk ) ;
	
	setMissionFaceDirection( name, monk, 1, 1 ) ;
	--setMissionFaceCharacter( name, "roadhousebman", enemy2 ) ;
	
	
	local triggerAreaC = addTriggerArea( name, "", false, "france", 
		{ -2616, 2012, -2221, 2648 } ) ;
	
	while ( not triggerAreaTriggered( triggerAreaC ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	removeTriggerArea( triggerAreaC ) ;
	

	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	-- dartagnan is close enough - walk d'artagnan over and play script
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( monk, true ) ;
	setIgnoreFreeze( enemy1, true ) ;
	setIgnoreFreeze( enemy2, true ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", -2488, 2264, "france", false ) ;
	waitForNoGoal( "dartagnan" ) ;

	setMissionFaceCharacter( name, "dartagnan", monk ) ;
	local bubInd = characterSay( monk, true, -1, -1, true, getString( "mt7d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "dartagnan", enemy1 ) ;
	bubInd = characterSay( enemy1, true, -1, -1, true, getString( "tut1_mt7d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFaceCharacter( name, "dartagnan", monk ) ;
	setMissionFaceCharacter( name, monk, "dartagnan" ) ;
	bubInd = characterSay( monk, true, -1, -1, true, getString( "mt7d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	local option = -1 ;
	repeat
		bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mt7d4" ), getString( "mt7d5" ) ) ;
		option = waitForBubbleOption( bubInd ) ;
		if ( option == 1 ) then
			bubInd = characterSay( monk, true, -1, -1, true, getString( "mt7d6" ) ) ;
			waitForBubbleClosed( bubInd ) ;
		end
	until option == 0 ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( monk, false ) ;
	setIgnoreFreeze( enemy1, false ) ;
	setIgnoreFreeze( enemy2, false ) ;
	
	removeMarker( name, marker ) ;
	
	local markerEnemy1 = addMarkerCharacter( name, true, getString( "fightmarker" ), enemy1 ) ;
	local markerEnemy2 = addMarkerCharacter( name, true, getString( "fightmarker" ), enemy2 ) ;
	
	removeMusic( tenseMusicID ) ;
		
	makeEnemies( "dartagnan", enemy1, enemy2 ) ;

	addGoalGetToPointInLevel( monk, -2472, 2168, "france", false ) ;

	-- fighting two enemies
	setCharacterSlowDamage( "dartagnan", true ) ;	
	setCharacterSlowDamage( enemy1, true ) ;	
	setCharacterSlowDamage( enemy2, true ) ;
	
	local timerPlayerNotFight = 0.0 ; -- if player doesn't fight both for some reason, just skip the tutorial
	local skipTutorialTime = 20.0 ;
	while ( ( not ( isCharacterFighting( "dartagnan" ) and isCharacterFighting( enemy1 ) and isCharacterFighting( enemy2 ) ) ) 
		and ( timerPlayerNotFight < skipTutorialTime ) ) do
		timerPlayerNotFight = timerPlayerNotFight + getDeltaT( ) ;
		coroutine.yield( ) ;
	end
	
	if ( timerPlayerNotFight < skipTutorialTime ) then
		-- every one is in combat
		
		-- show player fighting both opponents for a few seconds
		setTimeUntilConcentrationLapse( 10.0 ) ;
		lockPlayerInPlace( ) ;
		wait( 2 ) ;
		unlockPlayerInPlace( ) ;
		
		
		setMissionFreezeGame( name, true ) ;
			
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "monksuperlunge1", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
		
		setMissionFreezeGame( name, false ) ;
		
		lockPlayerInPlace( ) ;
		setTimeUntilConcentrationLapse( 10.0 ) ;
		wait( 2 ) ;
		unlockPlayerInPlace( ) ;
	
		-- put perspiration on character that player isn't fencing
		local targetCharacter = getCharacterFightTarget( "dartagnan" ) ;
		local perspCharacter = enemy1 ;
		if ( targetCharacter ~= "" ) then
			if ( targetCharacter == enemy1 ) then
				perspCharacter = enemy2 ;
			end 
		end
		
		gTutAttackEnemyName = perspCharacter ;
		setOverrideLapseEnemy( perspCharacter ) ;
		setOverrideTimeUntilConcentrationLapse( true, 1000000.0 ) ;
		--setOverrideGenerateTimeUntilConcentrationLapse( 10000000 ) ;
		
		forceIndefiniteTimeLapse( ) ;
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "monksuperlunge2", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;
	
		setLapseDamageMultiplier( 30.0 ) ;
	
		-- make sure characters have health
		if ( getRatioHealth( "dartagnan" ) < 0.3 ) then
			setRatioHealth( "dartagnan", 0.3 ) ;
		end
		if ( getRatioHealth( enemy1 ) < 0.1 ) then
			setRatioHealth( enemy1, 0.1 ) ;
		end
		if ( getRatioHealth( enemy2 ) < 0.1 ) then
			setRatioHealth( enemy2, 0.1 ) ;
		end
	
		setCharacterSlowDamage( "dartagnan", false ) ;
		setCharacterSlowDamage( enemy1, false ) ;	
		setCharacterSlowDamage( enemy2, false ) ;
		
		wait( 2 ) ;

		setOverrideTimeUntilConcentrationLapse( false, 1000000.0 ) ;
		setTimeUntilConcentrationLapse( 2.5 ) ;
		
		setDefaultLapseDamageMultiplier( ) ;
	
		resetIndefiniteTimeLapse( ) ;
	
		setOverrideLapseEnemy( "" ) ;
		
		setPlayerAllowClickTime( 2.2 ) ;
		
		setMissionFreezeGame( name, true ) ;
		
		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "monksuperlunge3", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;	
		
		setMissionFreezeGame( name, false ) ;
	else
		-- skipped tutorial
		DEBUG_OUTPUT( "skipped tutorial" ) ;
		setCharacterSlowDamage( "dartagnan", false ) ;	
		setCharacterSlowDamage( enemy1, false ) ;	
		setCharacterSlowDamage( enemy2, false ) ;
	end



	while ( isCharacterAlive( enemy1 ) or isCharacterAlive( enemy2 ) ) do
		coroutine.yield( ) ;
	end	
	
	setDefaultPlayerAllowClickTime( ) ;
	
	removeMarker( name, markerEnemy1 ) ;
	removeMarker( name, markerEnemy2 ) ;
	
	setBaseChatString( monk, getString( "tut1_monkside_d2" ) ) ;
		
	removeTriggerArea( triggerAreaB ) ;
	local triggerAreaC = addTriggerArea( name, "missionparisb4_tut5_lockoutC", true, "france", 
		{ -1870, 1887, -1390, 2940 } ) ;
		
	local marker = addMarkerCharacter( name, true, getString( "rewardmarker" ), monk ) ;

	waitForTalk( "dartagnan", monk, false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	sayAndWait( monk, getString( "tut1_monkhelp1" ) ) ;
	setMissionFreezeGame( name, false ) ;

	-- want marker to be shown while looking at tutorial map
	local marker = addMarkerCharacter( name, true, getString( "tut1_markertreville" ), "treville" ) ;
	
	-- tutorial for map
	setMapButtonVisible( true ) ;
				
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "worldmap", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;

	removeMarker( name, marker ) ;
	
	-- monk give d'Artagnan a gun
	lockPlayerInPlace( ) ;
	sayAndWait( monk, getString( "tut1_monkhelp2" ) ) ;

	unlockPlayerInPlace( ) ;
	
	removeTriggerArea( triggerAreaC ) ;
	local triggerAreaD = addTriggerArea( name, "missionparisb4_tut5_lockoutD", true, "france", 
		{ -1870, 1887, -1390, 2940 } ) ;
	
	setBoolean( "gunsAvailable", true ) ;
	
	createItem( "monkpistol", "pistol_wheellock_1", "france", -2437, 2183, true ) ;
	
	addMarkerPickUp( name, true, getString( "tut1_pistolmarker1" ), "monkpistol" ) ;

	-- wait until pistol is in players inventory	
	while( numOfItemType( "pistol_wheellock_1" ) < 1 ) do
		coroutine.yield( ) ;
	end
	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "inventorypistol", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	forceKeepRangedWeapon( true ) ;
	ensureRangedIsEquipped( ) ;
	
	lockPlayerInPlace( ) ;
	
	local enemy3PosX = -1970 ;
	local enemy3PosY = 2268 ;
	local enemy3 = createTempCharacter( getString( "highwayman" ), "france", enemy3PosX, enemy3PosY ) ;
	setStatsCalculatorStatic( enemy3, 15, 15, 15, 15 ) ; -- 4, 4, 4, 4
	randomDressEnemy( enemy3, 0.0, 7137 ) ;
	setMeleeWeapon( enemy3, "sword_1" ) ;
	setHasLootDrop( enemy3, false ) ;
	setMissionFaceCharacter( name, enemy3, "dartagnan" ) ;
	
	addGoalGetToPointInLevel( enemy3, -2223, 2263, "france", false ) ;
	wait( 2 ) ;

	setMissionFaceCharacter( name, monk, enemy3 ) ;
	wait( 0.5 ) ;
	setMissionFaceCharacter( name, "dartagnan", enemy3 ) ;
	
	waitForNoGoal( enemy3 ) ;
	
	sayAndWait( enemy3, getString( "tut1_enemy3_d1" ) ) ;
	
	unlockPlayerInPlace( ) ;
	
	setBaseChatString( monk, getString( "tut1_monkside_d1" ) ) ;
		
	removeTriggerArea( triggerAreaD ) ;
	local triggerAreaE = addTriggerArea( name, "missionparisb4_tut5_lockoutE", true, "france", 
		{ -1870, 1887, -1390, 2940 } ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	setMissionFaceCharacter( name, monk, "dartagnan" ) ;
	
	makeEnemies( "dartagnan", enemy3 ) ;
	addWatchCharacterUnlimited( enemy3 ) ;
	setIgnoreAll( enemy3, true ) ; -- enemy won't come at us
	
	local marker = addMarkerCharacter( name, true, getString( "fight" ), enemy3 ) ;

	gTutAttackEnemyName = enemy3 ;	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "firearm", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	lockPlayerInPlace( ) ;
	while ( isRangedLoaded( ) ) do
		coroutine.yield( ) ;
	end
	unlockPlayerInPlace( ) ;
	
	waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
	setDialogueScript( "reloadfirearm", 0 ) ;
	waitForNoActiveTutorialDialogue( ) ;
	
	DEBUG_OUTPUT( "setIgnoreAll" ) ;
	setIgnoreAll( enemy3, false ) ;
	
	while ( isCharacterAlive( enemy3 ) ) do
		coroutine.yield( ) ;
	end	

	removeMarker( name, marker ) ;
	
	setBaseChatString( monk, getString( "tut1_monkside_d2" ) ) ;
	
	removeTriggerArea( triggerAreaE ) ;
	local triggerAreaF = addTriggerArea( name, "missionparisb4_tut5_lockoutF", true, "france", 
		{ -1870, 1887, -1390, 2940 } ) ;

	local marker = addMarkerCharacter( name, true, getString( "tut1_talktomonk3" ), monk ) ;

	waitForTalk( "dartagnan", monk, false ) ;
	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;

	local dartX = 0 ;
	local dartY = 0 ;
	dartX, dartY = getCharacterPos( "dartagnan" ) ;
	
	local horseStartX = dartX + ( SCREEN_WIDTH / 2 ) + 80 ;

	setOwnedHorse( "dartagnan", "posthorse4" ) ;
	placeVehicle( "posthorse4", "france", horseStartX, 2321 ) ;
	
	vehicleGoToPoint( "posthorse4", -2410, 2322 ) ;
	
	setMissionFaceDirection( name, monk, 1, 1 ) ;

		
	sayAndWait( monk, getString( "tut1_monkhelp5" ) ) ;
	
	local horseX, horseY = getVehiclePos( "posthorse4" ) ;
	local faceX = horseX - dartX ;
	local faceY = horseY - dartY ;
	faceDirection( "dartagnan", faceX, faceY ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "tut1_monkhelp6" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
	
	setBaseChatString( monk, getString( "tut1_monkside_d3" ) ) ;
	setBaseFaceCharacter( monk, "dartagnan" ) ;
		
	removeTriggerArea( triggerAreaA ) ;
	removeTriggerArea( triggerAreaF ) ;
	
	autoDeleteCharacterOffScreen( monk ) ;	
	forceKeepRangedWeapon( false ) ;
	
	setClickObjectClosedSoon( "stcloudcrate1" ) ;
	setClickObjectClosedSoon( "stcloudcrate2" ) ;
	setClickObjectClosedSoon( "stcloudcrate3" ) ;
	setClickObjectClosedSoon( "stcloudcrate4" ) ;
	setClickObjectClosedSoon( "stcloudcrate5" ) ;
	setClickObjectClosedSoon( "stcloudcrate6" ) ;
	setClickObjectClosedSoon( "stcloudcrate7" ) ;
	setClickObjectClosedSoon( "stcloudcrate8" ) ;
	setClickObjectClosedSoon( "stcloudbarrel1" ) ;
	setClickObjectClosedSoon( "stcloudbarrel2" ) ;
	setClickObjectClosedSoon( "stcloudbarrel3" ) ;
	setClickObjectClosedSoon( "stcloudbarrel4" ) ;
	setClickObjectClosedSoon( "stcloudbarrel5" ) ;
	setClickObjectClosedSoon( "stcloudbarrel6" ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb5" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end	
	

function execute_missionparisb4_5( name )
	-- Investigate where Constance went
	DEBUG_OUTPUT( name .. " started" ) ;

	setPauseButtonVisible( true ) ;
	setWeaponToggleOverrideNotVisible( false ) ;
	setHealthBarVisible( true ) ;
	setOintmentButtonVisible( true ) ;
	setMapButtonVisible( true ) ;
	setInventoryButtonVisible( true ) ;

	local overrideSaveID = createOverrideSavePos( "france", -4021, 2566 ) ;
	setOverrideSaveLevel( overrideSaveID, "stcloudhousea2" ) ;
	setOverrideSaveLevel( overrideSaveID, "stcloudhousea" ) ;
	setOverrideSaveLevel( overrideSaveID, "stcloudhouseb" ) ;
		
	lockOutLeaveParisForMusks( name )

	-- unlock door to villa
	local doorLockA = addDoorLock( name, "", false, "stcloudhouseaout" ) ;

	-- talk to a few people to see who saw something (stcloudman1 is guy from book)
	local markerMan1 = addMarkerCharacter( name, true, getString( "mpb4m2" ), "stcloudman1" ) ;
	local markerMan2 = addMarkerCharacter( name, true, getString( "mpb4m2" ), "stcloudman2" ) ;
	local markerLady1 = addMarkerCharacter( name, true, getString( "mpb4m2" ), "stcloudlady1" ) ;
	
	local waitingTalkMan1 = setWaitingForTalk( "dartagnan", "stcloudman1", false ) ;
	local waitingTalkMan2 = setWaitingForTalk( "dartagnan", "stcloudman2", false ) ;
	local waitingTalkLady1 = setWaitingForTalk( "dartagnan", "stcloudlady1", false ) ;

	setMissionChatString( name, "stcloudman2", getString( "mpb4d4" ) ) ;
	setMissionChatString( name, "stcloudlady1", getString( "mpb4d6" ) ) ;

	local man2Talked = false ;
	local lady1Talked = false ;

	while ( not hasWaitingTalkOccured( waitingTalkMan1 ) ) do
		if ( not man2Talked ) then
			if ( hasWaitingTalkOccured( waitingTalkMan2 ) ) then
				setDoneWaitingTalk( waitingTalkMan2 ) ;
				man2Talked = true ;
				
				setMissionFreezeGame( name, true ) ;
				setIgnoreFreeze( "stcloudman2", true ) ;
				
				setMissionFaceCharacter( name, "stcloudman2", "dartagnan" ) ;
				sayAndWait( "dartagnan", getString( "mpb4d3" ) ) ;
				sayAndWait( "stcloudman2", getString( "mpb4d4" ) ) ;
				
				setMissionFreezeGame( name, false ) ;
				setIgnoreFreeze( "stcloudman2", false ) ;
				
				removeMarker( name, markerMan2 ) ;
			end
		end
		
		if ( not lady1Talked ) then
			if ( hasWaitingTalkOccured( waitingTalkLady1 ) ) then
				setDoneWaitingTalk( waitingTalkLady1 ) ;
				lady1Talked = true ;
				
				setMissionFreezeGame( name, true ) ;
				setIgnoreFreeze( "stcloudlady1", true ) ;
				
				setMissionFaceCharacter( name, "stcloudlady1", "dartagnan" ) ;
				sayAndWait( "dartagnan", getString( "mpb4d5" ) ) ;
				sayAndWait( "stcloudlady1", getString( "mpb4d6" ) ) ;
				
				setMissionFreezeGame( name, false ) ;
				setIgnoreFreeze( "stcloudlady1", false ) ;
				
				removeMarker( name, markerLady1 ) ;
			end
		end
		
		coroutine.yield( ) ;
	end
	
	if ( not man2Talked ) then
		removeMarker( name, markerMan2 ) ;
		setDoneWaitingTalk( waitingTalkMan2 ) ;
	end
	if ( not lady1Talked ) then
		removeMarker( name, markerLady1 ) ;
		setDoneWaitingTalk( waitingTalkLady1 ) ;
	end
	
	-- talked to man1
	setDoneWaitingTalk( waitingTalkMan1 ) ;
		
	removeMarker( name, markerMan1 ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "stcloudman1", true ) ;
	
	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	setMissionFaceCharacter( name, "stcloudman1", "dartagnan" ) ;
	sayAndWait( "stcloudman1", getString( "mpb4d7" ) ) ;
	
	local bribed = false ;
	while ( not bribed ) do
		local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb4d8" ), getString( "mpb4d9" ) ) ;
		local option = waitForBubbleOption( bubInd ) ;
		if ( option == 0 ) then
			sayAndWait( "stcloudman1", getString( "mpb4d10" ) ) ;
		else
			bribed = true ;
		end
	end
	
	playSound( "dropmoney", 0.5 ) ;
		
	sayAndWait( "stcloudman1", getString( "mpb4d11" ) ) ;
	sayAndWait( "stcloudman1", getString( "mpb4d12" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb4d13" ) ) ;
	sayAndWait( "stcloudman1", getString( "mpb4d14" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb4d15" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	sayAndWait( "stcloudman1", getString( "mpb4d16" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb4d17" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb4d18" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "stcloudman1", false ) ;
	
	removeMusic( tenseMusicID ) ;
		
	removeMoney( 10 ) ; -- bribe the man	
	
	unlockOutLeaveParisForMusks( )

	removeDoorLock( doorLockA ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb5" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb5( name )
	-- Tell Treville what happened - he says to leave Paris
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setPauseButtonVisible( true ) ;
	setWeaponToggleOverrideNotVisible( false ) ;
	setHealthBarVisible( true ) ;
	setOintmentButtonVisible( true ) ;
	setMapButtonVisible( true ) ;
	setInventoryButtonVisible( true ) ;
		
	local overrideSaveID = createOverrideSavePos( "trevillehouse2", -53, -128 ) ;
	setOverrideSaveLevel( overrideSaveID, "trevilleantechamber" ) ;
		
	lockOutLeaveParisForMusks( name )
	
	local marker = addMarkerCharacter( name, true, getString( "reporttreville" ), "treville" ) ;
	
	local triggerArea = addTriggerArea( name, "", false, "trevilleantechamber", { -185, -1, 82, 226 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	removeTriggerArea( triggerArea ) ;

	lockPlayerInPlace( ) ;
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", 113, 30, "trevilleantechamber", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	setMissionFaceCharacter( name, "dartagnan", "treville" ) ;
	sayAndWait( "dartagnan", getString( "mpb5d1" ) ) ;
	sayAndWait( "treville", getString( "mpb5d2" ) ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	wait( 1 ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	sayAndWait( "treville", getString( "mpb5d3" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb5d4" ) ) ;
	sayAndWait( "treville", getString( "mpb5d5" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb5d6" ) ) ;
	sayAndWait( "treville", getString( "mpb5d7" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb5d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;
		
	unlockPlayerInPlace( ) ;
	
	unlockOutLeaveParisForMusks( )

	removeOverrideSavePos( overrideSaveID ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb5_5" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb5_5( name )
	-- check musketeers appartments before leaving to make sure they haven't come back - find letter for Aramis
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "treville", getString( "mpb5_5d4" ) ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", 905, 2873 ) ;
	setOverrideSaveLevel( overrideSaveID, "athoshouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "athoshouse2" ) ;
	setOverrideSaveLevel( overrideSaveID, "aramishouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "aramishouse2" ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -268, 1657, 840, 2507} ) ;
		
	lockOutLeaveParisForMusks( name )
	
	setInventoryItem( "letter_aramischevreuse", 0 ) ;

	local porthosMarkerX = 203 ;
	local porthosMarkerY = 2090 ;
	local markerPorthos = addMarkerPosition( name, true, getString( "mpb5_5m1" ), "france", porthosMarkerX, porthosMarkerY ) ;

	local athosMarkerX = 3 ;
	local athosMarkerY = -66 ;
	local markerAthos = addMarkerPosition( name, true, getString( "mpb5_5m2" ), "athoshouse2", athosMarkerX, athosMarkerY ) ;

	-- put letter drop handkerchief
	createItem( "letter_archev", "letter_aramischevreuse", "aramishouse", 164, 54, false ) ;
	local markerAramis = addMarkerPickUp( name, true, getString( "mpb5_5m3" ), "letter_archev" ) ;

	local donePorthos = false ;
	local doneAthos = false ;
	local doneAramis = false ;

	while ( not ( donePorthos and doneAthos and doneAramis ) ) do
		if ( ( not donePorthos ) and ( distanceToPoint( "dartagnan", "france", porthosMarkerX, porthosMarkerY ) < 300.0 ) ) then
			donePorthos = true ;
			removeMarker( name, markerPorthos ) ;

			setMissionFreezeGame( name, true ) ;
			
			setStateMessageIdle( "dartagnan" ) ;
			addGoalGetToPointInLevel( "dartagnan", porthosMarkerX, porthosMarkerY, "france", false, true ) ;
			waitForNoGoal( "dartagnan" ) ;
			
			local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb5_5d1" ) ) ;
			waitForBubbleClosed( bubInd ) ;
			
			setMissionFreezeGame( name, false ) ;			
		end
		
		if ( ( not doneAthos ) and ( getCharacterFunctionalLevel( "dartagnan" ) == "athoshouse2" ) ) then
			doneAthos = true ;
			removeMarker( name, markerAthos ) ;
			
			setMissionFreezeGame( name, true ) ;
			
			setStateMessageIdle( "dartagnan" ) ;
			addGoalGetToPointInLevel( "dartagnan", athosMarkerX, athosMarkerY, "athoshouse2", false, true ) ;
			waitForNoGoal( "dartagnan" ) ;
			
			local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb5_5d2" ) ) ;
			waitForBubbleClosed( bubInd ) ;
			
			setMissionFreezeGame( name, false ) ;			
		end
		
		if ( ( not doneAramis ) and ( numOfItemType( "letter_aramischevreuse" ) >= 1 ) ) then
			doneAramis = true ;
			removeMarker( name, markerAramis ) ;
			
			setStateMessageIdle( "dartagnan" ) ;
	
			setMissionFreezeGame( name, true ) ;
			
			local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb5_5d3" ) ) ;
			waitForBubbleClosed( bubInd ) ;

			setMissionFreezeGame( name, false ) ;			
		end
		
		coroutine.yield( ) ;
	end
	
	unlockOutLeaveParisForMusks( )
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb6" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb6( name )
	-- Go to Planchet, talk to Bonacieux on the way (mud on boots). 
	-- Planchet says that Cardinal's Guard was there, horses have arrived, bonacieux is evil
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "treville", getString( "mpb5_5d4" ) ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", 1764, 2829 ) ;
	setOverrideSaveLevel( overrideSaveID, "bonacieuxhouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "bonacieuxhouse2" ) ;
		
	lockOutLeaveParisForMusks( name )

	local markerPosX = -60 ;
	local markerPosY = -115 ;
	local marker = addMarkerPosition( name, true, getString( "mpb6m1" ), "bonacieuxhouse", markerPosX, markerPosY ) ;

	-- talk to bonacieux
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "bonacieuxhouse" ) ) do
		coroutine.yield( ) ;
	end

	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "bonacieux" ) ;
	setMissionFaceCharacter( name, "bonacieux", "dartagnan" ) ;
	
	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", -26, -66, "bonacieuxhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	sayAndWait( "bonacieux", getString( "mpb6d1" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb6d1_5" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb6d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	sayAndWait( "dartagnan", getString( "mpb6d3" ) ) ;
	sayAndWait( "bonacieux", getString( "mpb6d4" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb6d5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	sayAndWait( "dartagnan", getString( "mpb6d6" ) ) ;
		
	unlockPlayerInPlace( ) ;
	
	setMissionChatString( name, "bonacieux", getString( "mpb6d13" ) ) ;
		
	setMissionFaceNone( name, "dartagnan" ) ;
	
	-- talk to Planchet
	local marker = addMarkerCharacter( name, true, getString( "mpb6m1" ), "planchet" ) ;
	waitForTalk( "dartagnan", "planchet", false ) ;
	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	
	sayAndWait( "dartagnan", getString( "mpb6d7" ) ) ;
	sayAndWait( "planchet", getString( "mpb6d8" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb6d9" ) ) ;
	sayAndWait( "planchet", getString( "mpb6d10" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb6d11" ) ) ;
	sayAndWait( "planchet", getString( "mpb6d12" ) ) ;
	
	unlockPlayerInPlace( ) ;
	
	unlockOutLeaveParisForMusks( )

	removeOverrideSavePos( overrideSaveID ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb7" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb7( name )
	-- find Porthos
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "treville", getString( "mpb5_5d4" ) ) ;
	setMissionChatString( name, "bonacieux", getString( "mpb6d13" ) ) ;
	setMissionChatString( name, "planchet", getString( "mpb6d14" ) ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", 6837, -3104 ) ;
	setOverrideSaveLevel( overrideSaveID, "stmartinhouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "stmartinhouse2" ) ;
		
	local doorLockA = addDoorLock( name, "", true, "crevecoeurhouseaout" ) ;
	local doorLockB = addDoorLock( name, "", true, "lirdorout" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb7m1" ), "stmartinkeeper" ) ;
	
	local triggerArea = addTriggerArea( name, "", false, "stmartinhouse", { -411, -291, 0, -115 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;
	
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	
	setMissionFaceCharacter( name, "stmartinkeeper", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "stmartinkeeper" ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -109, -143, "stmartinhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mpb7d1" ) ) ;
	sayAndWait( "stmartinkeeper", getString( "mpb7d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb7d3" ) ) ;
	sayAndWait( "stmartinkeeper", getString( "mpb7d4" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb7d5" ) ) ;
	sayAndWait( "stmartinkeeper", getString( "mpb7d6" ) ) ;
	sayAndWait( "stmartinkeeper", getString( "mpb7d7" ) ) ;
	sayAndWait( "stmartinkeeper", getString( "mpb7d8" ) ) ;
	sayAndWait( "stmartinkeeper", getString( "mpb7d9" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb7d10" ) ) ;
	sayAndWait( "stmartinkeeper", getString( "mpb7d11" ) ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;	
	
	unlockPlayerInPlace( ) ;
	
	setMissionChatString( name, "stmartinkeeper", getString( "mpb7d25" ) ) ;
		
	local marker = addMarkerCharacter( name, true, getString( "mpb7m1" ), "porthos" ) ;
	waitForTalk( "dartagnan", "porthos", false ) ;
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	
	local bubInd = characterSay( "porthos", true, -1, -1, false, getString( "mpb7d12" ) ) ;
	waitForBubbleDone( bubInd ) ;
	setBubbleToBackgroundOpacity( bubInd ) ;
	
	local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, "", getString( "yes" ), getString( "no" ) ) ;
	local option = waitForBubbleOption( bubInd2 ) ;
	deleteBubble( bubInd ) ;
	if ( option == 0 ) then
		sayAndWait( "porthos", getString( "mpb7d15" ) ) ;
	else
		sayAndWait( "porthos", getString( "mpb7d13" ) ) ;
		sayAndWait( "dartagnan", getString( "mpb7d14" ) ) ;
	end			

	sayAndWait( "porthos", getString( "mpb7d16" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb7d17" ) ) ;
	sayAndWait( "porthos", getString( "mpb7d18" ) ) ;
	sayAndWait( "porthos", getString( "mpb7d19" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb7d20" ) ) ;
	sayAndWait( "porthos", getString( "mpb7d21" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb7d22" ) ) ;
	sayAndWait( "porthos", getString( "mpb7d23" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb7d24" ) ) ;
		
	unlockPlayerInPlace( ) ;
		
	removeDoorLock( doorLockA ) ;
	removeDoorLock( doorLockB ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
			
	completeMission( name ) ;
	activateMission( "missionparisb8" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb8( name )
	-- find Aramis
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "porthos", getString( "mpb7d26" ) ) ;
	setMissionChatString( name, "planchet", getString( "mpb7d27" ) ) ;
		
	setInventoryItem( "letter_aramischevreuse", 1 ) ;
	
	local overrideSaveID = createOverrideSavePos( "france", 4398, -8738 ) ;
	setOverrideSaveLevel( overrideSaveID, "crevecoeurhousea" ) ;
	setOverrideSaveLevel( overrideSaveID, "crevecoeurhousea2" ) ;
		
	local doorLockB = addDoorLock( name, "", true, "lirdorout" ) ;
	
	placeCharacter( "planchet", "france", 6485, -3181 ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	placeVehicle( "posthorse1", "france", 6752, -3068 ) ;
	placeVehicle( "posthorse2", "france", 6379, -3104 ) ;
	placeVehicle( "posthorse3", "france", 6543, -3094 ) ;
	
	lockHorseMovement( "posthorse1", true ) ;
	lockHorseMovement( "posthorse2", true ) ;
	lockHorseMovement( "posthorse3", true ) ;
	
	vehicleFaceDirection( "posthorse1", -1, 0 ) ;
	vehicleFaceDirection( "posthorse2", 0, -1 ) ;
	vehicleFaceDirection( "posthorse3", 0, -1 ) ;
	
	placeCharacter( "curatemont", "crevecoeurhousea2", 2, 7 ) ;
	placeCharacter( "principalamiens", "crevecoeurhousea2", -40, 7 ) ;	
	
	local marker = addMarkerCharacter( name, true, getString( "mpb8m1" ), "crevecoeurkeeper" ) ;
	
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "crevecoeurhousea" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -137, -17, "crevecoeurhousea", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	faceDirection( "dartagnan", 0, -1 ) ;
	
	sayAndWait( "dartagnan", getString( "mpb8d1" ) ) ;
	sayAndWait( "crevecoeurkeeper", getString( "mpb8d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb8d3" ) ) ;
	sayAndWait( "crevecoeurkeeper", getString( "mpb8d4" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb8d5" ) ) ;
	sayAndWait( "crevecoeurkeeper", getString( "mpb8d6" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb8d7" ) ) ;
	sayAndWait( "crevecoeurkeeper", getString( "mpb8d8" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb8d9" ) ) ;
	sayAndWait( "crevecoeurkeeper", getString( "mpb8d10" ) ) ;
	
	unlockPlayerInPlace( ) ;

	setMissionChatString( name, "crevecoeurkeeper", getString( "mpb8d38" ) ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb8m1" ), "aramis" ) ;

	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "crevecoeurhousea2" ) ) do
		coroutine.yield( ) ;
	end

	lockPlayerInPlace( ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "bazin" ) ;
	setMissionFaceCharacter( name, "bazin", "dartagnan" ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -171, -257, "crevecoeurhousea2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	addGoalGetToPointInLevel( "bazin", -162, -208, "crevecoeurhousea2", false, true ) ;
	waitForNoGoal( "bazin" ) ;
	
	sayAndWait( "bazin", getString( "mpb8d11" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb8d12" ) ) ;
	sayAndWait( "bazin", getString( "mpb8d13" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb8d14" ) ) ;

	addGoalGetToPointInLevel( "bazin", -122, -242, "crevecoeurhousea2", false, true ) ;

	setMissionFaceNone( name, "dartagnan" ) ;
	
	unlockPlayerInPlace( ) ;

	setMissionChatString( name, "bazin", getString( "mpb8d39" ) ) ;

	-- trigger in front of Aramis' place
	local triggerArea = addTriggerArea( name, "", false, "crevecoeurhousea2", { -235, -86, 97, 205 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeMarker( name, marker ) ;
	
	removeTriggerArea( triggerArea ) ;
	
	lockPlayerInPlace( ) ;	
	setStateMessageIdle( "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;

	sayAndWait( "aramis", getString( "mpb8d15" ) ) ;
	sayAndWait( "principalamiens", getString( "mpb8d16" ) ) ;
	
	addGoalGetToPointInLevel( "dartagnan", -72, 54, "crevecoeurhousea2", false, true ) ;
	wait( 1 ) ;
	setMissionFaceCharacter( name, "curatemont", "dartagnan" ) ;
	setMissionFaceCharacter( name, "principalamiens", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	waitForNoGoal( "dartagnan" ) ;

	setMissionFaceCharacter( name, "curatemont", "aramis" ) ;
	setMissionFaceCharacter( name, "principalamiens", "aramis" ) ;
	sayAndWait( "aramis", getString( "mpb8d17" ) ) ;
	
	setMissionFaceCharacter( name, "curatemont", "dartagnan" ) ;
	setMissionFaceCharacter( name, "principalamiens", "dartagnan" ) ;
	local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb8d18" ), getString( "mpb8d19" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	
	setMissionFaceCharacter( name, "curatemont", "aramis" ) ;
	setMissionFaceCharacter( name, "principalamiens", "aramis" ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
	sayAndWait( "aramis", getString( "mpb8d20" ) ) ;

	addGoalGetToPointInLevel( "curatemont", -52, -283, "crevecoeurhousea", false, true ) ;
	addGoalGetToPointInLevel( "principalamiens", -52, -283, "crevecoeurhousea", false, true ) ;
	
	wait( 2 ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	sayAndWait( "aramis", getString( "mpb8d21" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb8d22" ) ) ;
	sayAndWait( "aramis", getString( "mpb8d23" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb8d24" ) ) ;
	sayAndWait( "aramis", getString( "mpb8d25" ) ) ;
	sayAndWait( "aramis", getString( "mpb8d26" ) ) ;
	sayAndWait( "aramis", getString( "mpb8d27" ) ) ;
	sayAndWait( "aramis", getString( "mpb8d28" ) ) ;
	sayAndWait( "aramis", getString( "mpb8d29" ) ) ;
	sayAndWait( "aramis", getString( "mpb8d30" ) ) ;
	sayAndWait( "aramis", getString( "mpb8d31" ) ) ;
	sayAndWait( "aramis", getString( "mpb8d32" ) ) ;
	sayAndWait( "aramis", getString( "mpb8d33" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb8d34" ) ) ;
	sayAndWait( "aramis", getString( "mpb8d35" ) ) ;
	
	setInventoryItem( "letter_aramischevreuse", 0 ) ;
	playSound( "paper", 1.0 ) ;
	addHeartMaker( "aramis" ) ;
	sayAndWait( "aramis", getString( "mpb8d35_5" ) ) ;
	removeHeartMaker( "aramis" ) ;
	
	sayAndWait( "aramis", getString( "mpb8d36" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb8d37" ) ) ;

	waitForNoGoal( "curatemont" ) ;
	waitForNoGoal( "principalamiens" ) ;
	
	place_curatemontA( "curatemont" ) ;
	place_principalamiensA( "principalamiens" ) ;

	unlockPlayerInPlace( ) ;
	
	lockHorseMovement( "posthorse1", false ) ;
	lockHorseMovement( "posthorse2", false ) ;
	lockHorseMovement( "posthorse3", false ) ;
	
	removeDoorLock( doorLockB ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb9" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb9( name )
	-- find Athos
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "porthos", getString( "mpb7d26" ) ) ;
	setMissionChatString( name, "planchet", getString( "mpb7d28" ) ) ;
	setMissionChatString( name, "aramis", getString( "mpb8d40" ) ) ;
	setMissionChatString( name, "bazin", getString( "mpb8d41" ) ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", 7578, -12433 ) ;
	setOverrideSaveLevel( overrideSaveID, "lirdorhouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "lirdorhouse2" ) ;
	setOverrideSaveLevel( overrideSaveID, "lirdorhouse3" ) ;
		
	placeCharacter( "planchet", "france", 4751, -8895 ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	placeVehicle( "posthorse2", "france", 4444, -8725 ) ;
	placeVehicle( "posthorse3", "france", 4756, -8821 ) ;
	
	lockHorseMovement( "posthorse2", true ) ;
	lockHorseMovement( "posthorse3", true ) ;
	
	vehicleFaceDirection( "posthorse2", -1, 0 ) ;
	vehicleFaceDirection( "posthorse3", 0, -1 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb9m1" ), "lirdorkeeper" ) ;
	
	waitForTalk( "dartagnan", "lirdorkeeper", false ) ;
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	
	setMissionFaceCharacter( name, "lirdorkeeper", "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mpb9d1" ) ) ;
	sayAndWait( "lirdorkeeper", getString( "mpb9d2" ) ) ;
	sayAndWait( "lirdorkeeper", getString( "mpb9d3" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d4" ) ) ;
	sayAndWait( "lirdorkeeper", getString( "mpb9d5" ) ) ;
	sayAndWait( "lirdorkeeper", getString( "mpb9d6" ) ) ;
	sayAndWait( "lirdorkeeper", getString( "mpb9d7" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d8" ) ) ;

	unlockPlayerInPlace( ) ;
	
	setMissionChatString( name, "lirdorkeeper", getString( "mpb8d42" ) ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb9m1" ), "athos" ) ;

	local triggerArea = addTriggerArea( name, "", false, "lirdorhouse2", { -210, -48, 4, 135 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;
	
	lockPlayerInPlace( ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -158, 4, "lirdorhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	faceDirection( "dartagnan", 1, -1 ) ;
	
	sayAndWait( "dartagnan", getString( "mpb9d9" ) ) ;
	
	local bubInd = spritePosSay( getString( "athos" ), -126, -77, true, -1, -1, true, getString( "mpb9d10" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;

	local doorLock = addDoorLock( name, "", false, "lirdorcellarout" ) ;

	waitForTalk( "dartagnan", "athos", false ) ;
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mpb9d11" ) ) ;
	sayAndWait( "athos", getString( "mpb9d12" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d13" ) ) ;
	sayAndWait( "athos", getString( "mpb9d14" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d15" ) ) ;
	sayAndWait( "athos", getString( "mpb9d16" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d17" ) ) ;
	
	local tenseMusicID = addMusic( "tense", 15 ) ;
	sayAndWait( "athos", getString( "mpb9d18" ) ) ;
	sayAndWait( "athos", getString( "mpb9d19" ) ) ;
	sayAndWait( "athos", getString( "mpb9d20" ) ) ;
	sayAndWait( "athos", getString( "mpb9d21" ) ) ;
	sayAndWait( "athos", getString( "mpb9d22" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d23" ) ) ;
	sayAndWait( "athos", getString( "mpb9d24" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d25" ) ) ;
	sayAndWait( "athos", getString( "mpb9d26" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d27" ) ) ;
	sayAndWait( "athos", getString( "mpb9d28" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d29" ) ) ;
	sayAndWait( "athos", getString( "mpb9d30" ) ) ;
	sayAndWait( "athos", getString( "mpb9d31" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d32" ) ) ;
	
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	wait( 2 ) ;
	
	playSound( "snoring", 1.0 ) ;
	wait( 2.1 ) ;
	playSound( "snoring", 1.0 ) ;
	wait( 2 ) ;
		
	removeMusic( tenseMusicID ) ;

	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;

	placeCharacter( "dartagnan", "lirdorhouse", 203, 203 ) ;
	placeCharacter( "athos", "lirdorhouse", 149, 89 ) ;
	placeCharacter( "grimaud", "lirdorhouse", 151, -47 ) ;
	setMissionFaceDirection( name, "grimaud", 0, 1 ) ;
	
	placeCharacter( "lordwinter", "lirdorhouse", -6, 32 ) ;
	setMissionFaceDirection( name, "lordwinter", 0, -1 ) ;
	
	addGoalGetToPointInLevel( "athos", 229, 192, "lirdorhouse", false, true ) ;
	
	-- fade from black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	waitForNoGoal( "athos" ) ;
	
	sayAndWait( "athos", getString( "mpb9d33" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d34" ) ) ;
	sayAndWait( "athos", getString( "mpb9d35" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d36" ) ) ;
	sayAndWait( "athos", getString( "mpb9d37" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d38" ) ) ;
	sayAndWait( "athos", getString( "mpb9d39" ) ) ;
	sayAndWait( "athos", getString( "mpb9d40" ) ) ;
	sayAndWait( "athos", getString( "mpb9d41" ) ) ;
	
	local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb9d42" ), getString( "mpb9d43" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 0 ) then
		sayAndWait( "athos", getString( "mpb9d44" ) ) ;
	else
		sayAndWait( "athos", getString( "mpb9d45" ) ) ;
	end

	sayAndWait( "athos", getString( "mpb9d46" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d47" ) ) ;
	sayAndWait( "athos", getString( "mpb9d48" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d49" ) ) ;
	sayAndWait( "athos", getString( "mpb9d50" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d51" ) ) ;
	sayAndWait( "athos", getString( "mpb9d52" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d53" ) ) ;
	sayAndWait( "athos", getString( "mpb9d54" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d55" ) ) ;
	sayAndWait( "athos", getString( "mpb9d56" ) ) ;
	
	local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb9d57" ), getString( "mpb9d58" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;

	sayAndWait( "athos", getString( "mpb9d59" ) ) ;
	sayAndWait( "athos", getString( "mpb9d60" ) ) ;
	sayAndWait( "athos", getString( "mpb9d61" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb9d62" ) ) ;
	sayAndWait( "athos", getString( "mpb9d63" ) ) ;
	sayAndWait( "athos", getString( "mpb9d64" ) ) ;
	sayAndWait( "athos", getString( "mpb9d65" ) ) ;
	sayAndWait( "athos", getString( "mpb9d66" ) ) ;
	
	setMissionFaceDirection( name, "athos", 1, -1 ) ;
	addGoalGetToPointInLevel( "athos", -53, 39, "lirdorhouse", false, true ) ;
	
	unlockPlayerInPlace( ) ;
	
	setMissionChatString( name, "lirdorkeeper", getString( "mpb8d43" ) ) ;
	setMissionChatString( name, "athos", getString( "mpb8d44" ) ) ;
		
	setMissionFaceCharacter( name, "lordwinter", "dartagnan" ) ;
	setMissionFaceNone( name, "dartagnan" ) ;
		
	local markerOutside = addMarkerPosition( name, true, getString( "mpb9m3" ), "france", 7338, -12327 ) ;
	local markerWinter = addMarkerCharacter( name, true, getString( "mpb9m2" ), "lordwinter" ) ;
	
	-- if player goes outside, go to net mission	
	local waitingTalkNum = setWaitingForTalk( "dartagnan", "lordwinter", false ) ;
	
	local doneLoop = false ;
	local wonHorse = false ;
	local wonMoney = false ;
	
	while ( not doneLoop ) do
		if ( hasWaitingTalkOccured( waitingTalkNum ) ) then
			setDoneWaitingTalk( waitingTalkNum ) ;
		
			lockPlayerInPlace( ) ;
		
			local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb9d67" ), getString( "mpb9d68" ) ) ;
			local option = waitForBubbleOption( bubInd ) ;
			if ( option == 0 ) then
				-- gamble
				sayAndWait( "lordwinter", getString( "mpb9d69" ) ) ;

				local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb9d70" ), getString( "mpb9d71" ) ) ;
				local option2 = waitForBubbleOption( bubInd2 ) ;
				
				sayAndWait( "lordwinter", getString( "mpb9d72" ) ) ;
				waitForNoGoal( "athos" ) ; -- make sure Athos is in place
				
				-- gamble here
				gBetAmount = -1 ;
				gGameTempMusicID = addMusic( getHighestPriorityMusic( ), 15 ) ;
				gOldLevel = getActiveLevel( ) ;
				stopCameraFollowCharacter( ) ;
				setActiveLevelMessage( "dicegame", 400, 300 ) ;
				activateScriptMessage( "runDiceGame" ) ;
				coroutine.yield( ) ;

				while ( gPlayingDice ) do
					coroutine.yield( ) ;
				end
				
				setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
				sayAndWait( "athos", getString( "mpb9d73" ) ) ;
				sayAndWait( "lordwinter", getString( "mpb9d74" ) ) ;

				local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb9d75" ), getString( "mpb9d76" ) ) ;
				local option2 = waitForBubbleOption( bubInd2 ) ;
				if ( option2 == 0 ) then
					-- takes horse
					wonHorse = true ;
				else
					-- takes money
					wonMoney = true ;
				end
				
				doneLoop = true ;
			else
				-- don't gamble
				waitingTalkNum = setWaitingForTalk( "dartagnan", "lordwinter", false ) ;
			end
			
			unlockPlayerInPlace( ) ;
		end
		
		if ( getCharacterFunctionalLevel( "dartagnan" ) == "france" ) then
			doneLoop = true ;
			setDoneWaitingTalk( waitingTalkNum ) ;
		end
		
		coroutine.yield( ) ;
	end
	
	removeMarker( name, markerWinter ) ;
	removeMarker( name, markerOutside ) ;
	
	removeDoorLock( doorLock ) ;
	
	lockHorseMovement( "posthorse2", false ) ;
	lockHorseMovement( "posthorse3", false ) ;
	
	local dartOldHorse = getCharacterOwnedHorseName( "dartagnan" ) ;
	removeOwnedHorse( "dartagnan" ) ;
	placeVehicle( dartOldHorse, "france", -30000, 0 ) ;

	setInt( "winterbest", 0 ) ; -- didn't bet

	if ( wonMoney ) then
		addMoney( 1000 ) ;	
		setInt( "winterbest", 1 ) ; -- won money
	end
	
	if ( wonHorse ) then
		setOwnedHorse( "dartagnan", "posthorse4b" ) ;
		placeCharactersHorseClose( "dartagnan" ) ;
		setInt( "winterbest", 2 ) ; -- won horse
	end
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb10" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb10( name )
	-- go back and retrieve Aramis
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "porthos", getString( "mpb7d26" ) ) ;
	setMissionChatString( name, "athos", getString( "mpb9d78" ) ) ;
	setMissionChatString( name, "bazin", getString( "mpb9d79" ) ) ;
		
	if ( getInt( "winterbest" ) == 0 ) then
		-- didn't bet
		setMissionChatString( name, "lordwinter", getString( "mpb8d45" ) ) ;
	elseif ( getInt( "winterbest" ) == 1 ) then
		-- won money
		setMissionChatString( name, "lordwinter", getString( "mpb8d46" ) ) ;
	else
		-- won horse
		setMissionChatString( name, "lordwinter", getString( "mpb8d47" ) ) ;
	end
		
	placeCharacter( "planchet", "france", 7371, -12458 ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	placeVehicle( "posthorse3", "france", 7473, -12379 ) ;
	
	placeCharactersHorseClose( "athos" ) ;
	placeCharactersHorseClose( "aramis" ) ;
	placeCharactersHorseClose( "porthos" ) ;
	
	vehicleFaceDirection( "posthorse3", 1, 0 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb10m1" ), "aramis" ) ;

	addGoalGetToPointInLevel( "athos", 4560, -8759, "france", true, true ) ;
	addGoalGetToPointInLevel( "grimaud", 4630, -8759, "france", true, true ) ;
	addGoalGetToPointInLevel( "planchet", 4631, -8855, "france", true, true ) ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "grimaud", "dartagnan" ) ;
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;

	waitForTalk( "dartagnan", "aramis", false ) ;

	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	
	clearGoals( "athos" ) ;
	
	placeCharacterInDoor( "athos", "crevecoeurstairsupa", false ) ;
	addGoalGetToPointInLevel( "athos", 5, -2, "crevecoeurhousea2", false, true ) ;
	addGoalGetToPointInLevel( "dartagnan", -40, -2, "crevecoeurhousea2", false, true ) ;

	setMissionFaceCharacter( name, "athos", "aramis" ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;

	waitForNoGoal( "dartagnan" ) ;
	wait( 4 ) ;
	
	sayAndWait( "dartagnan", getString( "mpb10d1" ) ) ;
	sayAndWait( "aramis", getString( "mpb10d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb10d3" ) ) ;
	sayAndWait( "aramis", getString( "mpb10d4" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb10d5" ) ) ;
	
	clearGoals( "athos" ) ;
	
	unlockPlayerInPlace( ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb11" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb11( name )
	-- go back and retrieve Porthos
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "athos", getString( "mpb9d80" ) ) ;
	setMissionChatString( name, "aramis", getString( "mpb9d80" ) ) ;
	
	-- lord de winter shouldn't stay in that inn
	place_lordwinterA( "lordwinter" ) ;
	
	ensureCharacterAroundPoint( "athos", "crevecoeurhousea2", 5, -2, 300 ) ;
	placeCharacter( "grimaud", "france", 4630, -8759 ) ;
	
	placeCharacter( "planchet", "france", 4631, -8855 ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	placeCharactersHorseClose( "athos" ) ;
	placeCharactersHorseClose( "aramis" ) ;
	placeCharactersHorseClose( "porthos" ) ;
	
	clearGoals( "athos" ) ;
	clearGoals( "grimaud" ) ;
	clearGoals( "planchet" ) ;
	
	addGoalGetToPointInLevel( "athos", 6700, -3060, "france", true, true ) ;
	addGoalGetToPointInLevel( "grimaud", 6650, -3060, "france", true, true ) ;
	addGoalGetToPointInLevel( "planchet", 6391, -3126, "france", true, true ) ;
	addGoalGetToPointInLevel( "aramis", 6600, -3380, "france", true, true ) ;
	addGoalGetToPointInLevel( "bazin", 6550, -3380, "france", true, true ) ;
	
	setMissionFaceDirection( name, "bazin", 0, 1 ) ;
	setMissionFaceDirection( name, "aramis", 0, 1 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb11m1" ), "porthos" ) ;
	
	waitForTalk( "dartagnan", "porthos", false ) ;

	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	
	clearGoals( "athos" ) ;
	clearGoals( "aramis" ) ;

	setMissionFaceDirection( name, "porthos", 1, 0 ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	setMissionFaceCharacter( name, "aramis", "porthos" ) ;

	addGoalGetToPointInLevel( "dartagnan", -244, 101, "stmartinhouse2", false, true ) ;
	
	placeCharacterInDoor( "athos", "stmartinstairsup", false ) ;
	addGoalGetToPointInLevel( "athos", -237, 60, "stmartinhouse2", false, true ) ;
	wait( 1 ) ;

	placeCharacterInDoor( "aramis", "stmartinstairsup", false ) ;
	addGoalGetToPointInLevel( "aramis", -236, 15, "stmartinhouse2", false, true ) ;

	waitForNoGoal( "dartagnan" ) ;
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "aramis" ) ;
	
	sayAndWait( "dartagnan", getString( "mpb11d1" ) ) ;
	sayAndWait( "porthos", getString( "mpb11d2" ) ) ;
	sayAndWait( "porthos", getString( "mpb11d3" ) ) ;
	sayAndWait( "athos", getString( "mpb11d4" ) ) ;
	sayAndWait( "aramis", getString( "mpb11d5" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb11d6" ) ) ;
			
	unlockPlayerInPlace( ) ;

	completeMission( name ) ;
	activateMission( "missionparisb12" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb12( name )
	-- Back to Paris - talk to d'Essart
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "athos", getString( "mpb11d7" ) ) ;
	setMissionChatString( name, "porthos", getString( "mpb11d8" ) ) ;
	setMissionChatString( name, "aramis", getString( "mpb11d9" ) ) ;
		
	ensureCharacterAroundPoint( "athos", "stmartinhouse2", -237, 60, 300 ) ;
	ensureCharacterAroundPoint( "aramis", "stmartinhouse2", -236, 15, 300 ) ;
	
	placeCharacter( "grimaud", "france", 6650, -3060 ) ;
	placeCharacter( "bazin", "france", 6550, -3380 ) ;
		
	placeCharacter( "planchet", "france", 6391, -3126 ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	placeCharactersHorseClose( "athos" ) ;
	placeCharactersHorseClose( "aramis" ) ;
	placeCharactersHorseClose( "porthos" ) ;
	
	clearGoals( "athos" ) ;
	clearGoals( "grimaud" ) ;
	clearGoals( "aramis" ) ;
	clearGoals( "bazin" ) ;
	clearGoals( "planchet" ) ;
	
	addGoalGetToPointInLevel( "athos", getAthosAPosX( ), getAthosAPosY( ), getAthosALevel( ), true, true ) ;
	addGoalGetToPointInLevel( "porthos", getPorthosAPosX( ), getPorthosAPosY( ), getPorthosALevel( ), true, true ) ;
	addGoalGetToPointInLevel( "aramis", getAramisAPosX( ), getAramisAPosY( ), getAramisALevel( ), true, true ) ;
	addGoalGetToPointInLevel( "grimaud", getGrimaudAPosX( ), getGrimaudAPosY( ), getGrimaudALevel( ), true, true ) ;
	addGoalGetToPointInLevel( "mousqueton", getMousquetonAPosX( ), getMousquetonAPosY( ), getMousquetonALevel( ), true, true ) ;
	addGoalGetToPointInLevel( "bazin", getBazinAPosX( ), getBazinAPosY( ), getBazinALevel( ), true, true ) ;
	addGoalGetToPointInLevel( "planchet", getPlanchetAPosX( ), getPlanchetAPosY( ), getPlanchetALevel( ), true, true ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb12m1" ), "essart" ) ;
	
	waitForTalk( "dartagnan", "essart", false ) ;

	removeMarker( name, marker ) ;
	
	setMissionFaceCharacter( name, "essart", "dartagnan" ) ;
	
	lockPlayerInPlace( ) ;
	
	sayAndWait( "essart", getString( "mpb12d1" ) ) ;
	sayAndWait( "essart", getString( "mpb12d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb12d3" ) ) ;
	sayAndWait( "essart", getString( "mpb12d4" ) ) ;
	sayAndWait( "essart", getString( "mpb12d5" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb12d6" ) ) ;
		
	unlockPlayerInPlace( ) ;
	
	clearGoals( "athos" ) ;
	clearGoals( "porthos" ) ;
	clearGoals( "aramis" ) ;
	clearGoals( "grimaud" ) ;
	clearGoals( "mousqueton" ) ;
	clearGoals( "bazin" ) ;
	clearGoals( "planchet" ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb13" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb13( name )
	-- guard duty on Pont Neuf - save some lady from thieves
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "essart", getString( "mpb12d7" ) ) ;
	
	local overrideSaveID = createOverrideSavePos( "france", 943, 1626 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 172, 309, 1802, 2036 } ) ;

	local ladyStartX = 950 ;
	local ladyStartY = 1161 ;
	local lady1 = createTempCharacter( getString( "distressedwoman" ), "france", ladyStartX, ladyStartY ) ;
	dress_randdistressedwoman( lady1 ) ;

	local enemy1 = createTempCharacter( getString( "thief" ), "france", ladyStartX + 50, ladyStartY ) ;
	setStatsCalculatorStatic( enemy1, 21, 21, 21, 21 ) ;
	randomDressEnemy( enemy1, 0.5, 1366776 ) ;
	setMeleeWeapon( enemy1, "sword_1" ) ;
	setMissionFaceDirection( name, enemy1, -1, 0 ) ;
	
	local enemy2 = createTempCharacter( getString( "thief" ), "france", ladyStartX - 50, ladyStartY ) ;
	setStatsCalculatorStatic( enemy2, 21, 21, 21, 21 ) ;
	randomDressEnemy( enemy2, 0.5, 6613577 ) ;
	setMeleeWeapon( enemy2, "sword_1" ) ;
	setMissionFaceDirection( name, enemy2, 1, 0 ) ;

	local enemy3 = createTempCharacter( getString( "thief" ), "france", ladyStartX, ladyStartY + 50 ) ;
	setStatsCalculatorStatic( enemy3, 21, 21, 21, 21 ) ;
	randomDressEnemy( enemy3, 0.5, 666477 ) ;
	setMeleeWeapon( enemy3, "sword_1" ) ;
	setMissionFaceDirection( name, enemy3, 0, -1 ) ;

	local enemy4 = createTempCharacter( getString( "thief" ), "france", ladyStartX, ladyStartY - 50 ) ;
	setStatsCalculatorStatic( enemy4, 21, 21, 21, 21 ) ;
	randomDressEnemy( enemy4, 0.5, 661111 ) ;
	setMeleeWeapon( enemy4, "sword_1" ) ;
	setMissionFaceDirection( name, enemy4, 0, 1 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "guardpontneuf" ), lady1 ) ;
		
	local dist = 200.0
	while ( distanceToPoint( "dartagnan", "france", ladyStartX, ladyStartY ) > dist ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	
	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	faceCharacter( "dartagnan", lady1 ) ;
	sayAndWait( lady1, getString( "mpb13d1" ) ) ;
	
	setMissionFreezeGame( name, false ) ;	
	
	makeEnemies( "dartagnan", enemy1, enemy2, enemy3, enemy4 ) ;
	
	addGoalGetToPointInLevel( lady1, 2736, 1361, "france", false, true ) ;
	
	local marker1 = addMarkerCharacter( name, true, getString( "fightmarker" ), enemy1 ) ;
	local marker2 = addMarkerCharacter( name, true, getString( "fightmarker" ), enemy2 ) ;
	local marker3 = addMarkerCharacter( name, true, getString( "fightmarker" ), enemy3 ) ;
	local marker4 = addMarkerCharacter( name, true, getString( "fightmarker" ), enemy4 ) ;
	
	while ( isCharacterAlive( enemy1 ) or isCharacterAlive( enemy2 )
		or isCharacterAlive( enemy3 ) or isCharacterAlive( enemy4 ) ) do
		coroutine.yield( ) ;
	end	
	
	removeMarker( name, marker1 ) ;
	removeMarker( name, marker2 ) ;
	removeMarker( name, marker3 ) ;
	removeMarker( name, marker4 ) ;
	
	deleteTempCharacter( lady1 ) ;

	removeOverrideSavePos( overrideSaveID ) ;

	completeMission( name ) ;
	activateMission( "missionparisb14" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb14( name )
	-- meet Musketeers in tavern, they need money for equipment
	DEBUG_OUTPUT( name .. " started" ) ;

	sitCharacter( "athos", "pommechair1" ) ;
	sitCharacter( "aramis", "pommechair2" ) ;
	sitCharacter( "porthos", "pommechair4" ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb14m1" ), "athos" ) ;
	waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
		
	removeMarker( name, marker ) ;	

	setMissionFreezeGame( name, true ) ;
	
	sayAndWait( "porthos", getString( "mpb14d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb14d2" ) ) ;
	sayAndWait( "athos", getString( "mpb14d3" ) ) ;
	sayAndWait( "aramis", getString( "mpb14d4" ) ) ;
	sayAndWait( "athos", getString( "mpb14d5" ) ) ;
	sayAndWait( "porthos", getString( "mpb14d6" ) ) ;
	sayAndWait( "athos", getString( "mpb14d7" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb14d8" ) ) ;
	sayAndWait( "porthos", getString( "mpb14d9" ) ) ;
	sayAndWait( "athos", getString( "mpb14d10" ) ) ;
	sayAndWait( "porthos", getString( "mpb14d11" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb14d12" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb15" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb15( name )
	-- follow Porthos into Church, see milady
	DEBUG_OUTPUT( name .. " started" ) ;

	local overrideSaveID = createOverrideSavePos( "france", 1430, -290 ) ;
	setOverrideSaveLevel( overrideSaveID, "stleuhouse" ) ;

	ensureCharacterInLevel( "athos", "pommedepinhouse", 50, 161 ) ;
	ensureCharacterInLevel( "porthos", "pommedepinhouse", 80, 200 ) ;
	ensureCharacterInLevel( "aramis", "pommedepinhouse", 110, 200 ) ;
	
	addGoalGetToPointInLevel( "athos", getAthosAPosX( ), getAthosAPosY( ), getAthosALevel( ), false, true ) ;
	addGoalGetToPointInLevel( "aramis", getAramisAPosX( ), getAramisAPosY( ), getAramisALevel( ), false, true ) ;
	addGoalGetToPointInLevel( "porthos", -256, 295, "stleuhouse", false, true ) ;
	
	placeCharacter( "madamecoquenard", "stleuhouse", -161, 145 ) ;
	setMissionFaceCharacter( name, "madamecoquenard", "porthos" ) ;
	
	sitCharacter( "milady", "stleupew1" ) ;
	placeCharacter( "kitty", "stleuhouse", 141, 63 ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb15m1" ), "porthos" ) ;
	
	waitForNoGoal( "porthos" ) ;
		
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "stleuhouse" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;

	-- Porthos and dart are both in the building

	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;

	lockPlayerInPlace( ) ;
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "stleuhouse" ) ;
	panCameraTo( -76, 161, 200, true ) ;

	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -167, 265, "stleuhouse", false, true ) ;
	addGoalGetToPointInLevel( "porthos", -160, 172, "stleuhouse", false, true ) ;
	
	setMissionFaceCharacter( name, "porthos", "madamecoquenard" ) ;
	waitForNoGoal( "porthos" ) ;
	wait( 0.5 ) ;
	setMissionFaceDirection( name, "porthos", -1, 0 ) ;
	
	addGoalGetToPointInLevel( "porthos", 153, 97, "stleuhouse", false, true ) ;
	
	waitForNoGoal( "dartagnan" ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb15d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	waitForNoGoal( "porthos" ) ;
	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb15d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	-- coquenard walk back and forth impatiently
	setMissionFaceCharacter( name, "dartagnan", "madamecoquenard" ) ;
	addGoalGetToPointInLevel( "madamecoquenard", -167, 86, "stleuhouse", false, true ) ;
	waitForNoGoal( "madamecoquenard" ) ;
	wait( 0.5 ) ;
	addGoalGetToPointInLevel( "madamecoquenard", -168, 149, "stleuhouse", false, true ) ;
	waitForNoGoal( "madamecoquenard" ) ;
	
	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb15d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	addGoalGetToPointInLevel( "madamecoquenard", 148, 144, "stleuhouse", false, true ) ;
	waitForNoGoal( "madamecoquenard" ) ;
	
	setMissionFaceCharacter( name, "porthos", "madamecoquenard" ) ;
	
	sayAndWait( "madamecoquenard", getString( "mpb15d4" ) ) ;
	sayAndWait( "porthos", getString( "mpb15d5" ) ) ;
	sayAndWait( "madamecoquenard", getString( "mpb15d6" ) ) ;
	sayAndWait( "porthos", getString( "mpb15d7" ) ) ;

	addGoalGetToPointInLevel( "madamecoquenard", 1447, -329, "france", false, true ) ;
	addGoalGetToPointInLevel( "porthos", 1480, -329, "france", false, true ) ;
	
	wait( 2 ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb15d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "milady" ) ;
	
	addGoalGetToPointInLevel( "milady", 1447, -329, "france", false, true ) ;
	addGoalGetToPointInLevel( "kitty", 1480, -329, "france", false, true ) ;
	
	wait( 2 ) ;
	
	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb15d9" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb15d10" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setCameraFollowCharacter( "dartagnan", true ) ;
	
	while ( isCharacterOnScreen( "porthos" )
		or  isCharacterOnScreen( "madamecoquenard" )
		or  isCharacterOnScreen( "milady" )
		or  isCharacterOnScreen( "kitty" ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "porthos" ) ;
	clearGoals( "madamecoquenard" ) ;
	clearGoals( "milady" ) ;
	clearGoals( "kitty" ) ;
	
	place_porthosA( "porthos" ) ;
	place_madamecoquenardA( "madamecoquenard" ) ;
	
	-- milady, kitty, and planchet
	setMissionFaceDirection( name, "milady", -1, 0 ) ;
	placeCharacter( "milady", "france", 1290, -313 ) ;
	putCharacterInPlaceOnHorse( "milady" ) ;

	setMissionFaceDirection( name, "kitty", -1, 0 ) ;
	placeCharacter( "kitty", "france", 1300, -263 ) ;
	putCharacterInPlaceOnHorse( "kitty" ) ;
	
	placeCharacter( "planchet", "france", 1571, -322 ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	unlockPlayerInPlace( ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	
	local markerPosX = 1466 ;
	local markerPosY = -336 ;
	local marker = addMarkerPosition( name, true, getString( "followmilady" ), "france", markerPosX, markerPosY ) ;
		
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "france" ) ) do
		coroutine.yield( ) ;
	end

	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "milady", true ) ;
	setIgnoreFreeze( "kitty", true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", 1447, -319, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "milady" ) ;
	sayAndWait( "milady", getString( "mpb15d11" ) ) ;
	
	addGoalGetToPointInLevel( "milady", 946, 607, "france", false, true ) ;
	addGoalGetToPointInLevel( "kitty", 946, 607, "france", false, true ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;
	sayAndWait( "dartagnan", getString( "mpb15d12" ) ) ;
	
	while ( isCharacterOnScreen( "milady" )
		or  isCharacterOnScreen( "kitty" ) ) do
		coroutine.yield( ) ;
	end
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "milady", false ) ;
	setIgnoreFreeze( "kitty", false ) ;
	setIgnoreFreeze( "planchet", false ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
			
	completeMission( name ) ;
	activateMission( "missionparisb16" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb16( name )
	-- go to saint germain, find Lubin, see Milady, Kitty, get letter for de Wardes
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "athos", getString( "mpb14d13" ) ) ;
	setMissionChatString( name, "aramis", getString( "mpb14d13" ) ) ;
	setMissionChatString( name, "porthos", getString( "mpb14d14" ) ) ;

	local overrideSaveID = createOverrideSavePos( "france", -6777, 942 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -7917, -212, -5724, 1046 } ) ;
		
	clearGoals( "milady" ) ;
	clearGoals( "kitty" ) ;
	placeDead( "milady" ) ;
	placeDead( "kitty" ) ;
	
	ensureCharacterAroundPoint( "planchet", "france", 1571, -322, 600 ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;

	placeCharacter( "lubin", "france", -7154, 392 ) ;
	setMissionFaceDirection( name, "lubin", 0, 1 ) ;

	local markerPosX = -7076 ;
	local markerPosY = 451 ;
	local marker = addMarkerPosition( name, true, getString( "followmilady" ), "france", markerPosX, markerPosY ) ;
	
	local dartFinalPosX = -6826 ;
	local dartFinalPosY = 438 ;
	
	local planchetDestPosX = dartFinalPosX ;
	local planchetDestPosY = dartFinalPosY + 50 ;

	local startDist = 200 ;
	local stopDist = 150 ;
	local planchetStartDist = startDist ;
	local planchetStopDist = stopDist ;
	
	local dist = 300.0
	while ( distanceToPoint( "dartagnan", "france", markerPosX, markerPosY ) > dist ) do
		local playerDestDist = distanceToPoint( "dartagnan", "france", markerPosX, markerPosY ) ;
		local aheadOfPlanchet = distanceToPoint( "planchet", "france", markerPosX, markerPosY ) - playerDestDist ;
		
		-- Planchet
		if ( aheadOfPlanchet > planchetStartDist ) then
			-- start going
			if ( not characterHasGoal( "planchet" ) ) then
				addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfPlanchet < planchetStopDist ) then
			-- stop going
			clearGoals( "planchet" ) ;
			setStateMessageIdle( "planchet" ) ;
		end
		
		coroutine.yield( ) ;
	end

	setMissionFaceDirection( name, "planchet", -1, 0 ) ;
	setMissionFaceDirection( name, "dartagnan", -1, 0 ) ;
	removeMarker( name, marker ) ;
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "france" ) ;
	panCameraTo( -7074, 439, 200, true ) ;
	
	-- make sure planchet isn't super far away
	if ( distanceToPoint( "planchet", "france", planchetDestPosX, planchetDestPosY ) > 1500.0 ) then
		setStateMessageIdle( "planchet" ) ;
		placeCharacter( "planchet", "france", -6819, 987 ) ;
	end

	if ( not characterHasGoal( "planchet" ) ) then
		addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
	end

	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", dartFinalPosX, dartFinalPosY, "france", false, true ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	setIgnoreFreeze( "lubin", true ) ;
	setIgnoreFreeze( "milady", true ) ;
	setIgnoreFreeze( "kitty", true ) ;

	waitForNoGoal( "planchet" ) ;
	waitForNoGoal( "dartagnan" ) ;	
	
	sayAndWait( "planchet", getString( "mpb16d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb16d2" ) ) ;
	sayAndWait( "planchet", getString( "mpb16d3" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb16d4" ) ) ;
	sayAndWait( "planchet", getString( "mpb16d5" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb16d6" ) ) ;
		
	setMissionFaceCharacter( name, "lubin", "planchet" ) ;
	setMissionFaceCharacter( name, "planchet", "lubin" ) ;
	
	removeDriver( getCharacterOwnedHorseName( "planchet" ), "planchet" ) ;
	addGoalGetToPointInLevel( "planchet", -7129, 417, "france", false, true ) ;
	waitForNoGoal( "planchet" ) ;
	
	sayAndWait( "planchet", getString( "mpb16d7" ) ) ;
	sayAndWait( "lubin", getString( "mpb16d8" ) ) ;
	sayAndWait( "planchet", getString( "mpb16d9" ) ) ;
	sayAndWait( "lubin", getString( "mpb16d10" ) ) ;
	
	local bubInd = spritePosSay( "", -7079, 328, true, -1, -1, true, getString( "mpb16d11" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	addGoalGetToPointInLevel( "lubin", -76, 85, "comtedewardeshouse", false, true ) ;
	
	wait( 1 ) ;
	setMissionFaceNone( name, "planchet" ) ;
	
	-- now milady and kitty ride up
	placeCharacter( "milady", "france", -7368, 830 ) ;
	placeCharacter( "kitty", "france", -7310, 858 ) ;
	
	putCharacterInPlaceOnHorse( "milady" ) ;
	putCharacterInPlaceOnHorse( "kitty" ) ;
	
	setMissionFaceDirection( name, "milady", 1, 0 ) ;
	setMissionFaceDirection( name, "kitty", 1, 0 ) ;
	addGoalGetToPointInLevel( "milady", -7352, 433, "france", false, true ) ;
	addGoalGetToPointInLevel( "kitty", -7348, 483, "france", false, true ) ;
	
	wait( 0.5 ) ;
	setMissionFaceCharacter( name, "planchet", "kitty" ) ;
	
	waitForNoGoal( "milady" ) ;
	waitForNoGoal( "kitty" ) ;
	
	wait( 1 ) ;
	
	removeDriver( getCharacterOwnedHorseName( "kitty" ), "kitty" ) ;
	setMissionFaceCharacter( name, "kitty", "planchet" ) ;
	addGoalGetToPointInLevel( "kitty", -7158, 448, "france", false, true ) ;
	waitForNoGoal( "kitty" ) ;
	
	sayAndWait( "kitty", getString( "mpb16d12" ) ) ;
	sayAndWait( "planchet", getString( "mpb16d13" ) ) ;
	sayAndWait( "kitty", getString( "mpb16d14" ) ) ;
	
	setMissionFaceDirection( name, "kitty", 1, 0 ) ;
	addGoalDriveVehicle( "kitty", getCharacterOwnedHorseName( "kitty" ), true ) ;
	waitForNoGoal( "kitty" ) ;
	
	addGoalGetToPointInLevel( "milady", -7367, 900, "france", true, true ) ;
	addGoalGetToPointInLevel( "kitty", -7320, 900, "france", true, true ) ;
	
	wait( 1 ) ;
	
	setMissionFaceDirection( name, "planchet", -1, 0 ) ;
	
	addGoalDriveVehicle( "planchet", getCharacterOwnedHorseName( "planchet" ), true ) ;
	waitForNoGoal( "planchet" ) ;
	
	-- planchet talk to d'Artagnan
	sayAndWait( "planchet", getString( "mpb16d15" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb16d16" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	sayAndWait( "dartagnan", getString( "mpb16d17" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb16d18" ) ) ;
	
	waitForNoGoal( "milady" ) ;
	waitForNoGoal( "kitty" ) ;
	
	placeDead( "milady" ) ;
	placeDead( "kitty" ) ;
	
	clearGoals( "lubin" ) ;
	place_lubinA( "lubin" ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	setIgnoreFreeze( "lubin", false ) ;
	setIgnoreFreeze( "milady", false ) ;
	setIgnoreFreeze( "kitty", false ) ;
	
	setCameraFollowCharacter( "dartagnan", true ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb17" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb17( name )
	-- meet Milady and Lord de Winter on the road
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "athos", getString( "mpb14d13" ) ) ;
	setMissionChatString( name, "aramis", getString( "mpb14d13" ) ) ;
	setMissionChatString( name, "porthos", getString( "mpb14d14" ) ) ;

	local overrideSaveID = createOverrideSavePos( "france", -6421, 1836 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -7029, 1038, -4746, 2857 } ) ;
	
	ensureCharacterAroundPoint( "planchet", "france", -6815, 493, 300 ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;

	setMissionFaceDirection( name, "lordwinter", -1, 0 ) ;
	setMissionFaceDirection( name, "milady", 1, 0 ) ;
	setMissionFaceDirection( name, "kitty", 1, 0 ) ;
	placeCharacter( "lordwinter", "france", -5551, 2223 ) ;
	placeCharacter( "milady", "france", -5800, 2220 ) ;
	placeCharacter( "kitty", "france", -5860, 2250 ) ;

	putCharacterInPlaceOnHorse( "lordwinter" ) ;
	putCharacterInPlaceOnHorse( "milady" ) ;
	putCharacterInPlaceOnHorse( "kitty" ) ;
	
	local triggerArea = addTriggerArea( name, "", false, "france", { -6135, 1645, -5341, 2814 } ) ;
	
	local markerPosX = -5860 ;
	local markerPosY = 2215 ;
	local marker = addMarkerPosition( name, true, getString( "followmilady" ), "france", markerPosX, markerPosY ) ;
		
	local planchetDestPosX = -6218 ;
	local planchetDestPosY = 2054 ;

	local startDist = 200 ;
	local stopDist = 150 ;
	local planchetStartDist = startDist ;
	local planchetStopDist = stopDist ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		local playerDestDist = distanceToPoint( "dartagnan", "france", markerPosX, markerPosY ) ;
		local aheadOfPlanchet = distanceToPoint( "planchet", "france", markerPosX, markerPosY ) - playerDestDist ;
		
		-- Planchet
		if ( aheadOfPlanchet > planchetStartDist ) then
			-- start going
			if ( not characterHasGoal( "planchet" ) ) then
				addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfPlanchet < planchetStopDist ) then
			-- stop going
			clearGoals( "planchet" ) ;
			setStateMessageIdle( "planchet" ) ;
		end
		
		coroutine.yield( ) ;
	end

	removeMarker( name, marker ) ;
	
	if ( not characterHasGoal( "planchet" ) ) then
		addGoalGetToPointInLevel( "planchet", planchetDestPosX, planchetDestPosY, "france", true, true ) ;
	end

	local tenseMusicID = addMusic( "tense", 15 ) ;

	removeTriggerArea( triggerArea ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "milady", true ) ;
	setIgnoreFreeze( "kitty", true ) ;
	setIgnoreFreeze( "lordwinter", true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "france" ) ;
	panCameraTo( -5863, 2150, 200, true ) ;
		
	setMissionFaceCharacter( name, "dartagnan", "milady" ) ;
			
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -6113, 2045, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	waitForNoGoal( "planchet" ) ;

	sayAndWait( "milady", getString( "mpb17d1" ) ) ;
	sayAndWait( "lordwinter", getString( "mpb17d2" ) ) ;
	
	addTimedHeartMaker( "dartagnan", 0.5 ) ;
	sayAndWait( "dartagnan", getString( "mpb17d3" ) ) ;

	-- dartagnan walk up to milady
	addGoalGetToPointInLevel( "dartagnan", -5906, 2128, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	setMissionFaceCharacter( name, "milady", "dartagnan" ) ;
	wait( 0.2 ) ;
	setMissionFaceCharacter( name, "kitty", "dartagnan" ) ;
	
	addTimedHeartMaker( "dartagnan", 0.5 ) ;
	sayAndWait( "dartagnan", getString( "mpb17d4" ) ) ;
	addTimedHeartMaker( "dartagnan", 0.5 ) ;
	sayAndWait( "dartagnan", getString( "mpb17d5" ) ) ;
	sayAndWait( "milady", getString( "mpb17d6" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb17d7" ) ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "lordwinter" ) ;
	setMissionFaceCharacter( name, "lordwinter", "dartagnan" ) ;

	addGoalGetToPointInLevel( "lordwinter", -5725, 2172, "france", true, true ) ;
	waitForNoGoal( "lordwinter" ) ;
	
	setMissionFaceCharacter( name, "milady", "lordwinter" ) ;

	sayAndWait( "lordwinter", getString( "mpb17d8" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb17d9" ) ) ;
	
	-- Milady rides off first, then lordwinter
	addGoalGetToPointInLevel( "milady", -5274, 2470, "france", true, true ) ;
	wait( 0.5 ) ;
	addGoalGetToPointInLevel( "kitty", -5274, 2500, "france", true, true ) ;
	wait( 2 ) ;

	addGoalGetToPointInLevel( "lordwinter", -5597, 2224, "france", true, true ) ;
	wait( 0.3 ) ;
	sayAndWait( "dartagnan", getString( "mpb17d10" ) ) ;
	waitForNoGoal( "lordwinter" ) ;
	
	sayAndWait( "lordwinter", getString( "mpb17d11" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb17d12" ) ) ;
	sayAndWait( "lordwinter", getString( "mpb17d13" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb17d14" ) ) ;
	sayAndWait( "lordwinter", getString( "mpb17d15" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb17d16" ) ) ;
	sayAndWait( "lordwinter", getString( "mpb17d17" ) ) ;

	setCameraFollowCharacter( "dartagnan", true ) ;

	addGoalGetToPointInLevel( "lordwinter", -5364, 2379, "france", true, true ) ;

	removeMusic( tenseMusicID ) ;

	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;
	addGoalGetToPointInLevel( "planchet", -6030, 2119, "france", true, true ) ;
	waitForNoGoal( "planchet" ) ;

	sayAndWait( "dartagnan", getString( "mpb17d18" ) ) ;

	addGoalGetToPointInLevel( "planchet", getPlanchetAPosX( ), getPlanchetAPosY( ), getPlanchetALevel( ), true, true ) ;

	waitForNoGoal( "lordwinter" ) ;	

	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "milady", false ) ;
	setIgnoreFreeze( "kitty", false ) ;
	setIgnoreFreeze( "lordwinter", false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	
	
	clearGoals( "lordwinter" ) ;
	clearGoals( "milady" ) ;
	clearGoals( "kitty" ) ;
	
	place_lordwinterA( "lordwinter" ) ;
	place_miladyA( "milady" ) ;
	place_kittyA( "kitty" ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb18" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb18( name )
	-- Inform athos about the duel
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "aramis", getString( "mpb14d13" ) ) ;
	setMissionChatString( name, "porthos", getString( "mpb14d14" ) ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb18m1" ), "athos" ) ;

	waitForTalk( "dartagnan", "athos", false ) ;
	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mpb18d1" ) ) ;
	sayAndWait( "athos", getString( "mpb18d2" ) ) ;
	sayAndWait( "athos", getString( "mpb18d3" ) ) ;
	sayAndWait( "athos", getString( "mpb18d4" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb18d5" ) ) ;
	sayAndWait( "athos", getString( "mpb18d6" ) ) ;
	
	-- Grimaud leaves
	addGoalGetToPointInLevel( "grimaud", -278, -153, "athoshouse", false, true ) ;
		
	sayAndWait( "athos", getString( "mpb18d7" ) ) ;
	
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mpb18d8" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
	
	sayAndWait( "athos", getString( "mpb18d9" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb18d10" ) ) ;
	sayAndWait( "athos", getString( "mpb18d11" ) ) ;
	
	addTimedHeartMaker( "dartagnan", 0.5 ) ;
	sayAndWait( "dartagnan", getString( "mpb18d12" ) ) ;
	sayAndWait( "athos", getString( "mpb18d13" ) ) ;

	while ( isCharacterOnScreen( "grimaud" ) ) do
		coroutine.yield( ) ;
	end
	
	unlockPlayerInPlace( ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb19" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb19( name )
	-- Duel with Englishmen
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "athos", getString( "mpb18d14" ) ) ;
	setMissionChatString( name, "porthos", getString( "mpb18d16" ) ) ;
	setMissionChatString( name, "aramis", getString( "mpb18d15" ) ) ;

	clearGoals( "grimaud" ) ;
	placeDead( "grimaud" ) ;
	
	local enemyPosX = 1987 ;
	local enemyPosY = 4580 ;
	
	local friendsPosX = 1832 ;
	local friendsPosY = 4580 ;

	placeCharacter( "lordwinter", "france", enemyPosX, enemyPosY ) ;
	setMissionFaceCharacter( name, "lordwinter", "dartagnan" ) ;

	-- create lord winter's friends
	local enemy1 = createTempCharacter( getString( "englishman" ), "france", enemyPosX, enemyPosY - 80 ) ;
	setStatsCalculatorStatic( enemy1, 23, 23, 23, 23 ) ;
	randomDressEnemy( enemy1, 1.0, 6134421 ) ;
	setMeleeWeapon( enemy1, "sword_1" ) ;
	setMissionFaceDirection( name, enemy1, -1, 0 ) ;
	
	local enemy2 = createTempCharacter( getString( "englishman" ), "france", enemyPosX, enemyPosY + 60 ) ;
	setStatsCalculatorStatic( enemy2, 23, 23, 23, 23 ) ;
	randomDressEnemy( enemy2, 1.0, 613421 ) ;
	setMeleeWeapon( enemy2, "sword_1" ) ;
	setMissionFaceDirection( name, enemy2, -1, 0 ) ;
	
	local enemy3 = createTempCharacter( getString( "englishman" ), "france", enemyPosX, enemyPosY - 130 ) ;
	setStatsCalculatorStatic( enemy3, 23, 23, 23, 23 ) ;
	randomDressEnemy( enemy3, 1.0, 6139921 ) ;
	setMeleeWeapon( enemy3, "sword_1" ) ;
	setMissionFaceDirection( name, enemy3, -1, 0 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb19m1" ), "lordwinter" ) ;
	waitForTalkFour( "dartagnan", "lordwinter", enemy1, enemy2, enemy3, false ) ;
	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "lordwinter", true ) ;
	setIgnoreFreeze( enemy1, true ) ;
	setIgnoreFreeze( enemy2, true ) ;
	setIgnoreFreeze( enemy3, true ) ;
	
	clearGoals( "athos" ) ;
	clearGoals( "porthos" ) ;
	clearGoals( "aramis" ) ;
	placeCharacter( "athos", "france", 1560, 4106 ) ;
	placeCharacter( "porthos", "france", 1520, 4106 ) ;
	placeCharacter( "aramis", "france", 1480, 4106 ) ;
	
	setMissionFaceDirection( name, "dartagnan", 1, 0 ) ;
	setMissionFaceDirection( name, "athos", 1, 0 ) ;
	setMissionFaceDirection( name, "porthos", 1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 1, 0 ) ;
	
	addGoalGetToPointInLevel( "dartagnan", friendsPosX, friendsPosY, "france", false, true ) ;
	addGoalGetToPointInLevel( "athos", friendsPosX, friendsPosY - 80, "france", false, true ) ;
	addGoalGetToPointInLevel( "porthos", friendsPosX, friendsPosY + 60, "france", false, true ) ;
	addGoalGetToPointInLevel( "aramis", friendsPosX, friendsPosY - 130, "france", false, true ) ;
	
	waitForNoGoal( "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mpb19d1" ) ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;

	sayAndWait( "dartagnan", getString( "mpb19d2" ) ) ;
	sayAndWait( "lordwinter", getString( "mpb19d3" ) ) ;
	sayAndWait( "athos", getString( "mpb19d4" ) ) ;
	sayAndWait( "lordwinter", getString( "mpb19d5" ) ) ;

	addGoalGetToPointInLevel( "athos", enemyPosX - 40, friendsPosY - 80, "france", false, true ) ;
	addGoalGetToPointInLevel( "porthos", enemyPosX - 40, friendsPosY + 60, "france", false, true ) ;
	addGoalGetToPointInLevel( "aramis", enemyPosX - 40, friendsPosY - 130, "france", false, true ) ;

	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;	
	
	sayAndWait( "aramis", getString( "mpb19d6" ) ) ;
	addGoalGetToPointInLevel( "aramis", friendsPosX, friendsPosY - 130, "france", false, true ) ;
	
	sayAndWait( "porthos", getString( "mpb19d6" ) ) ;
	addGoalGetToPointInLevel( "porthos", friendsPosX, friendsPosY + 60, "france", false, true ) ;
	
	sayAndWait( "athos", getString( "mpb19d6" ) ) ;
	addGoalGetToPointInLevel( "athos", friendsPosX, friendsPosY - 80, "france", false, true ) ;

	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "athos" ) ;
	
	sayAndWait( "athos", getString( "mpb19d7" ) ) ;
	sayAndWait( enemy1, getString( "mpb19d8" ) ) ;
	sayAndWait( "athos", getString( "mpb19d9" ) ) ;
	
	sayAndWait( "dartagnan", getString( "mpb19d10" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "lordwinter", false ) ;
	setIgnoreFreeze( enemy1, false ) ;
	setIgnoreFreeze( enemy2, false ) ;
	setIgnoreFreeze( enemy3, false ) ;
	
	makeEnemies( "dartagnan", "lordwinter", enemy1, enemy2, enemy3 ) ;
	makeEnemies( "athos", "lordwinter", enemy1, enemy2, enemy3 ) ;
	makeEnemies( "porthos", "lordwinter", enemy1, enemy2, enemy3 ) ;
	makeEnemies( "aramis", "lordwinter", enemy1, enemy2, enemy3 ) ;

	setMissionChatFunction( name, "aramis", "chat_fight" ) ;
	setMissionChatFunction( name, "porthos", "chat_fight" ) ;
	setMissionChatFunction( name, "athos", "chat_fight" ) ;

	setMissionFaceNone( name, "dartagnan" ) ;

	local markerWinter = addMarkerCharacter( name, true, getString( "fight" ), "lordwinter" ) ;
	local marker1 = addMarkerCharacter( name, true, getString( "fight" ), enemy1 ) ;
	local marker2 = addMarkerCharacter( name, true, getString( "fight" ), enemy2 ) ;
	local marker3 = addMarkerCharacter( name, true, getString( "fight" ), enemy3 ) ;

	while ( isCharacterAlive( "lordwinter" ) or isCharacterAlive( enemy1 ) 
		or isCharacterAlive( enemy2 ) or isCharacterAlive( enemy3 ) ) do
		coroutine.yield( ) ;
	end	
	
	makeNotEnemies( "dartagnan", "lordwinter", enemy1, enemy2, enemy3 ) ;
	makeNotEnemies( "athos", "lordwinter", enemy1, enemy2, enemy3 ) ;
	makeNotEnemies( "porthos", "lordwinter", enemy1, enemy2, enemy3 ) ;
	makeNotEnemies( "aramis", "lordwinter", enemy1, enemy2, enemy3 ) ;
	
	removeMarker( name, markerWinter ) ;
	removeMarker( name, marker1 ) ;
	removeMarker( name, marker2 ) ;
	removeMarker( name, marker3 ) ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	
	local winterPosX, winterPosY = getCharacterPos( "lordwinter" ) ;
	local marker = addMarkerPosition( name, true, getString( "mpb19m2" ), "france", winterPosX, winterPosY ) ;
	
	local dist = 100.0
	while ( distanceToPoint( "dartagnan", "france", winterPosX, winterPosY ) > dist ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "lordwinter", true ) ;
	if ( characterExists( enemy1 ) ) then
		setIgnoreFreeze( enemy1, true ) ;
	end
	if ( characterExists( enemy2 ) ) then
		setIgnoreFreeze( enemy2, true ) ;
	end
	if ( characterExists( enemy3 ) ) then
		setIgnoreFreeze( enemy3, true ) ;
	end
	
		
	setStateMessageIdle( "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "lordwinter" ) ;
	
	sayAndWait( "dartagnan", getString( "mpb19d11" ) ) ;
	
	reviveCharacter( "lordwinter" ) ;
	giveHealth( "lordwinter", 1000 ) ;	

	sayAndWait( "lordwinter", getString( "mpb19d12" ) ) ;
	
	-- lord de winter walks away
	addGoalGetToPointInLevel( "lordwinter", 0, 140, "miladyhouse", false, true ) ;
	
	-- thank friends, if they are close enough
	if ( distanceBetweenCharacters( "dartagnan", "athos" ) < 300 ) then
		-- revive any dead musketeers
		reviveHelper3( "athos", "porthos", "aramis", true ) ;
	
		setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
		sayAndWait( "dartagnan", getString( "mpb19d13" ) ) ;
		sayAndWait( "athos", getString( "mpb19d14" ) ) ;
	end
	
	-- friends walk back home
	addGoalGetToPointInLevel( "athos", getAthosAPosX( ), getAthosAPosY( ), getAthosALevel( ), false, true ) ;
	addGoalGetToPointInLevel( "porthos", getPorthosAPosX( ), getPorthosAPosY( ), getPorthosALevel( ), false, true ) ;
	addGoalGetToPointInLevel( "aramis", getAramisAPosX( ), getAramisAPosY( ), getAramisALevel( ), false, true ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "lordwinter", false ) ;
	if ( characterExists( enemy1 ) ) then
		setIgnoreFreeze( enemy1, false ) ;
	end
	if ( characterExists( enemy2 ) ) then
		setIgnoreFreeze( enemy2, false ) ;
	end
	if ( characterExists( enemy3 ) ) then
		setIgnoreFreeze( enemy3, false ) ;
	end

	-- revive any dead musketeers - if dart was too far away, might not have already been revived
	reviveHelper3( "athos", "porthos", "aramis", true ) ;
	
	-- grimaud could still be in "dead" spot after being sent away by Athos
	place_grimaudA( "grimaud" ) ;

	giveHealth( "athos", 200 ) ;
	giveHealth( "porthos", 200 ) ;
	giveHealth( "aramis", 200 ) ;

	completeMission( name ) ;
	activateMission( "missionparisb20" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb20( name )
	-- Get introduced to Milady by Lord de Winter
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "lordwinter", getString( "mpb19d15" ) ) ;

	local overrideSaveID = createOverrideSavePos( "france", 2974, -540 ) ;
	setOverrideSaveLevel( overrideSaveID, "miladyhouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "miladyhouse2" ) ;

	setMissionFaceCharacter( name, "milady", "dartagnan" ) ;
	setMissionFaceCharacter( name, "lordwinter", "dartagnan" ) ;
	setMissionFaceDirection( name, "kitty", 0, 1 ) ;

	placeCharacter( "milady", "miladyhouse", -40, 140 ) ;
	placeCharacter( "kitty", "miladyhouse", 75, 109 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb20m1" ), "milady" ) ;
	
	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "miladyhouse" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;

	if ( not ( getCharacterFunctionalLevel( "lordwinter" ) == "miladyhouse" ) ) then
		-- don't put lord de winter here if he has already walked this far
		clearGoals( "lordwinter" ) ;
		placeCharacterInDoor( "lordwinter", "miladyin", false ) ;
		addGoalGetToPointInLevel( "lordwinter", 0, 140, "miladyhouse", false, true ) ;
	end
	
	setMissionFaceCharacter( name, "dartagnan", "lordwinter" ) ;
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", 11, 246, "miladyhouse", false, true ) ;
	waitForNoGoal( "lordwinter" ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, -1 ) ;
	addGoalGetToPointInLevel( "dartagnan", -20, 200, "miladyhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	sayAndWait( "lordwinter", getString( "mpb20d1" ) ) ;
	sayAndWait( "milady", getString( "mpb20d2" ) ) ;
	sayAndWait( "lordwinter", getString( "mpb20d3" ) ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "milady" ) ;

	addGoalGetToPointInLevel( "lordwinter", 2981, -607, "france", false, true ) ;
	wait( 2 ) ;
	
	addGoalGetToPointInLevel( "dartagnan", -40, 200, "miladyhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	wait( 1 ) ;
	
	sayAndWait( "dartagnan", getString( "mpb20d4" ) ) ;
	sayAndWait( "milady", getString( "mpb20d5" ) ) ;
	sayAndWait( "milady", getString( "mpb20d6" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb20d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mpb20d8" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
	
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	wait( 1 ) ;

	setMissionFaceCharacter( name, "milady", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "milady" ) ;
	placeCharacter( "milady", "miladyhouse", 100, 10 ) ;
	placeCharacter( "dartagnan", "miladyhouse", 140, 10 ) ;
	
	clearGoals( "lordwinter" ) ;
	place_lordwinterA( "lordwinter" ) ;
	
	moveCameraToDest( ) ;
		
	-- fade from black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end	

	sayAndWait( "milady", getString( "mpb20d9" ) ) ;
	
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mpb20d10" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
		
	setMissionFaceNone( name, "dartagnan" ) ;

	setMissionFaceDirection( name, "milady", 0, -1 ) ;
	addGoalGetToPointInLevel( "milady", 91, -109, "miladyhouse", false, true ) ;
	
	addGoalGetToPointInLevel( "dartagnan", 122, 56, "miladyhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	setMissionFaceCharacter( name, "dartagnan", "kitty" ) ;
	setMissionFaceCharacter( name, "kitty", "dartagnan" ) ;

	addGoalGetToPointInLevel( "dartagnan", 123, 131, "miladyhouse", false, true ) ;
	addGoalGetToPointInLevel( "kitty", 162, 134, "miladyhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	waitForNoGoal( "kitty" ) ;

	addHeartMaker( "kitty" ) ;
	sayAndWait( "kitty", getString( "mpb20d11" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb20d12" ) ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", 69, 180, "miladyhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb20d13" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	waitForNoGoal( "lordwinter" ) ;	
	place_lordwinterA( "lordwinter" ) ;
	
	unlockPlayerInPlace( ) ;
	
	removeHeartMaker( "kitty" ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb21" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb21( name )
	-- Go see Porthos - he has orange horse
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "milady", getString( "mpb20d14" ) ) ;
	
	setMissionChatFunction( name, "kitty", "chat_hearts_mpb20d15" ) ;


	setMissionFaceDirection( name, "milady", 0, -1 ) ;
	ensureCharacterAroundPoint( "milady", "miladyhouse", 91, -109, 600 ) ;

	setMissionFaceCharacter( name, "kitty", "dartagnan" ) ;
	ensureCharacterAroundPoint( "kitty", "miladyhouse", 162, 134, 600 ) ;
	
	removeHorseDealer( "horse1" ) ;
	placeVehicle( "horse1", "france", 230, 2091 ) ;
	vehicleFaceDirection( "horse1", 1, 0 ) ;
	lockHorseMovement( "horse1", true ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb21m1" ), "porthos" ) ;
		
	waitForTalk( "dartagnan", "porthos", false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mpb21d1" ) ) ;
	sayAndWait( "porthos", getString( "mpb21d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb21d3" ) ) ;
	sayAndWait( "porthos", getString( "mpb21d4" ) ) ;
	
	addTimedHeartMaker( "dartagnan", 0.5 ) ;
	sayAndWait( "dartagnan", getString( "mpb21d5" ) ) ;
	sayAndWait( "porthos", getString( "mpb21d6" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb21d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "porthos", false ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb22" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb22( name )
	-- Go see Aramis
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "milady", getString( "mpb20d14" ) ) ;
	setMissionChatString( name, "porthos", getString( "mpb21d8" ) ) ;

	setMissionChatFunction( name, "kitty", "chat_hearts_mpb20d15" ) ;

	setMissionFaceDirection( name, "milady", 0, -1 ) ;
	ensureCharacterAroundPoint( "milady", "miladyhouse", 91, -109, 600 ) ;

	setMissionFaceCharacter( name, "kitty", "dartagnan" ) ;
	ensureCharacterAroundPoint( "kitty", "miladyhouse", 162, 134, 600 ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb22m1" ), "aramis" ) ;

	waitForTalk( "dartagnan", "aramis", false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mpb22d1" ) ) ;
	sayAndWait( "aramis", getString( "mpb22d2" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb22d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	sayAndWait( "dartagnan", getString( "mpb22d4" ) ) ;
	sayAndWait( "aramis", getString( "mpb22d5" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb22d6" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	
	placeVehicle( "horse1", "france", -30000, 0 ) ;
	lockHorseMovement( "horse1", false ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb23" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb23( name )
	-- Go and see Milady again (kitty tells you she doesn't love you)
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "athos", getString( "mpb14d13" ) ) ;

	local overrideSaveID = createOverrideSavePos( "france", 2974, -540 ) ;
	setOverrideSaveLevel( overrideSaveID, "miladyhouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "miladyhouse2" ) ;

	placeDead( "milady" ) ;

	setMissionFaceCharacter( name, "kitty", "dartagnan" ) ;
	placeCharacter( "kitty", "miladyhouse", -43, 163 )
	ensureCharacterAroundPoint( "kitty", "miladyhouse", -43, 163, 600 ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb23m1" ), "kitty" ) ;

	while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "miladyhouse" ) ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;

	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -38, 215, "miladyhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	faceCharacter( "dartagnan", "kitty" ) ;
	
	addHeartMaker( "kitty" ) ;
	sayAndWait( "kitty", getString( "mpb23d1" ) ) ;
	removeHeartMaker( "kitty" ) ;

	unlockPlayerInPlace( ) ;
	
	setMissionChatString( name, "kitty", getString( "followme" ) ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb23m2" ), "kitty" ) ;

	addGoalGetToPointInLevel( "kitty", -150, -25, "miladyhouse2", false, true ) ;
	waitForNoGoal( "kitty" ) ;
	
	local closeDist = 150.0 ;
	while ( distanceBetweenCharacters( "dartagnan", "kitty" ) > closeDist ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -110, -25, "miladyhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	faceCharacter( "dartagnan", "kitty" ) ;
	
	sayAndWait( "kitty", getString( "mpb23d2" ) ) ;
	
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mpb23d3" ) ) ;
	removeHeartMaker( "dartagnan" ) ;
	
	sayAndWait( "kitty", getString( "mpb23d4" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb23d5" ) ) ;

	addTimedHeartMaker( "kitty", 1.5 ) ;
	sayAndWait( "kitty", getString( "mpb23d6" ) ) ;
	sayAndWait( "kitty", getString( "mpb23d7" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	sayAndWait( "dartagnan", getString( "mpb23d8" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb23d9" ) ) ;
	sayAndWait( "kitty", getString( "mpb23d10" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb23d11" ) ) ;
	sayAndWait( "kitty", getString( "mpb23d12" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb23d13" ) ) ;

	addHeartMaker( "kitty" ) ;
	sayAndWait( "kitty", getString( "mpb23d14" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb23d15" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	removeHeartMaker( "kitty" ) ;
	
	sayAndWait( "kitty", getString( "mpb23d16" ) ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, -1 ) ;
	addGoalGetToPointInLevel( "dartagnan", -69, 27, "miladyhouse2", false, true ) ;
	
	setMissionFaceDirection( name, "milady", -1, -1 ) ;
	placeCharacterInDoor( "milady", "miladystairsup", false ) ;
	addGoalGetToPointInLevel( "milady", 128, 69, "miladyhouse2", false, true ) ;
	
	waitForNoGoal( "dartagnan" ) ;
	waitForNoGoal( "milady" ) ;
		
	sayAndWait( "milady", getString( "mpb23d17" ) ) ;
	
	setMissionFaceCharacter( name, "kitty", "milady" ) ;
	setMissionFaceCharacter( name, "milady", "kitty" ) ;
	addGoalGetToPointInLevel( "kitty", 90, 69, "miladyhouse2", false, true ) ;
	waitForNoGoal( "kitty" ) ;
	
	
	sayAndWait( "kitty", getString( "mpb23d18" ) ) ;
	sayAndWait( "milady", getString( "mpb23d19" ) ) ;
	sayAndWait( "kitty", getString( "mpb23d20" ) ) ;
	sayAndWait( "milady", getString( "mpb23d21" ) ) ;
	sayAndWait( "milady", getString( "mpb23d22" ) ) ;
	sayAndWait( "kitty", getString( "mpb23d23" ) ) ;
	sayAndWait( "milady", getString( "mpb23d24" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb23d25" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	sayAndWait( "milady", getString( "mpb23d26" ) ) ;
	sayAndWait( "kitty", getString( "mpb23d27" ) ) ;
	sayAndWait( "milady", getString( "mpb23d28" ) ) ;
	
	setMissionFaceCharacter( name, "kitty", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "kitty" ) ;
	setMissionFaceDirection( name, "milady", 0, 1 ) ;
	
	addGoalGetToPointInLevel( "milady", 78, 146, "miladyhouse2", false, true ) ;
	addGoalGetToPointInLevel( "kitty", -218, -31, "miladyhouse2", false, true ) ;
	waitForNoGoal( "milady" ) ;
	waitForNoGoal( "kitty" ) ;
	
	addGoalGetToPointInLevel( "dartagnan", -168, -31, "miladyhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	addHeartMaker( "kitty" ) ;
		
	sayAndWait( "dartagnan", getString( "mpb23d29" ) ) ;
	sayAndWait( "kitty", getString( "mpb23d30" ) ) ;

	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb23d31" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	sayAndWait( "dartagnan", getString( "mpb23d32" ) ) ;

	addGoalGetToPointInLevel( "dartagnan", -188, -31, "miladyhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	local noMusicID = addMusic( "none", 15 ) ;
		
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	playSound( "intimate", 1.0 ) ;
	
	wait( 4 ) ;
	
	removeMusic( noMusicID ) ;
		
	placeDead( "milady" ) ;
		
	-- fade from black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end	
	
	sayAndWait( "dartagnan", getString( "mpb23d33" ) ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, -1 ) ;
	addGoalGetToPointInLevel( "dartagnan", -76, -98, "miladyhouse2", false, true ) ;
	addGoalGetToPointInLevel( "kitty", -114, -94, "miladyhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	waitForNoGoal( "kitty" ) ;
	
	playSound( "writing", 1.0 ) ;
	sayAndWait( "dartagnan", getString( "mpb23d34" ) ) ;
	playSound( "paper", 1.0 ) ;
		
	setMissionFaceCharacter( name, "dartagnan", "kitty" ) ;
	sayAndWait( "dartagnan", getString( "mpb23d35" ) ) ;
	
	removeHeartMaker( "kitty" ) ;
	
	sayAndWait( "kitty", getString( "mpb23d36" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb23d37" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	sayAndWait( "dartagnan", getString( "mpb23d38" ) ) ;
	sayAndWait( "kitty", getString( "mpb23d39" ) ) ;
	
	unlockPlayerInPlace( ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb24" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb24( name )
	-- Go aquire clothing to look like de Wardes
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "kitty", getString( "mpb23d40" ) ) ;

	setMissionFaceCharacter( name, "kitty", "dartagnan" ) ;
	ensureCharacterAroundPoint( "kitty", "miladyhouse2", -114, -94, 600 ) ;

	setInventoryItem( "hat_de_wardes", 0 ) ;
	setInventoryItem( "doublet_de_wardes", 0 ) ;

	local deWardesCost = 500 ;
	local boughtDeWardes = false ;
	
	while ( not boughtDeWardes ) do
		local marker = addMarkerCharacter( name, true, getString( "mpb24m1" ), "clothesdealer2" ) ;
	
		waitForTalk( "dartagnan", "clothesdealer2", false ) ;
		removeMarker( name, marker ) ;
			
		lockPlayerInPlace( ) ;
		
		setMissionFaceCharacter( name, "clothesdealer2", "dartagnan" ) ;
		
		sayAndWait( "dartagnan", getString( "mpb24d1" ) ) ;
		sayAndWait( "clothesdealer2", getString( "mpb24d2" ) ) ;
		
		if ( getMoney( ) >= deWardesCost ) then
			local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb24d4" ), getString( "mpb24d5" ) ) ;
			local option = waitForBubbleOption( bubInd ) ;
			if ( option == 0 ) then
				-- buy it
				boughtDeWardes = true ;
				
				playSound( "dropmoney", 0.5 ) ;
				
				sayAndWait( "clothesdealer2", getString( "mpb24d6" ) ) ;
				
				setInventoryItem( "hat_de_wardes", 1 ) ;
				setInventoryItem( "doublet_de_wardes", 1 ) ;
			else
				-- don't buy it
				sayAndWait( "clothesdealer2", getString( "mpb24d7" ) ) ;
			end
		else
			-- doesn't have enough money
			sayAndWait( "dartagnan", getString( "mpb24d3" ) ) ;
		end
			
		unlockPlayerInPlace( ) ;
		
		coroutine.yield( ) ;
	end

	removeMoney( deWardesCost ) ;

	completeMission( name ) ;
	activateMission( "missionparisb25" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb25( name )
	-- Meeting disguised as de Wardes to Milady
	DEBUG_OUTPUT( name .. " started" ) ;

	local overrideSaveID = createOverrideSavePos( "france", 2974, -540 ) ;
	setOverrideSaveLevel( overrideSaveID, "miladyhouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "miladyhouse2" ) ;

	setInventoryItem( "hat_de_wardes", 1 ) ;
	setInventoryItem( "doublet_de_wardes", 1 ) ;
	setInventoryItem( "milady_saphire_ring", 0 ) ;
	
	setMissionFaceCharacter( name, "kitty", "milady" ) ;
	setMissionFaceCharacter( name, "milady", "kitty" ) ;
	placeCharacter( "kitty", "miladyhouse2", 55, 17 ) ;
	placeCharacter( "milady", "miladyhouse2", 95, 17 ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb25m1" ), "milady" ) ;
	
	while ( not ( 
		( getCharacterFunctionalLevel( "dartagnan" ) == "miladyhouse" )
		or
		( getCharacterFunctionalLevel( "dartagnan" ) == "miladyhouse2" ) ) ) do
		coroutine.yield( ) ;
	end
	
	lockPlayerInPlace( ) ;

	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "miladyhouse2" ) ;
	setCameraTo( -32, 37 ) ;

	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	sayAndWait( "milady", getString( "mpb25d1" ) ) ;

	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	placeDead( "kitty" ) ;
	placeCharacter( "milady", "miladyhouse2", 98, 225 ) ;
	setMissionFaceCharacter( name, "milady", "dartagnan" ) ;
	
	setCameraFollowCharacter( "dartagnan", true ) ;

	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	local darkRoomWeather = addWeatherSpot( "miladyhouse2", 0, 0, 100000.0 ) ;
	setWeatherSpotDark( darkRoomWeather, 0.0, 0.0, 0.0, 0.65 ) ;
	
	unlockPlayerInPlace( ) ;
	
	local upstairsFailed = 0 ;
	
	local trickedMilady = false ;
	
	while ( not trickedMilady ) do
		while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "miladyhouse2" ) ) do
			coroutine.yield( ) ;
		end
		
		lockPlayerInPlace( ) ;
		
		-- darken room
		--setFadeColour( 0.0, 0.0, 0.0, 0.5 ) ;
		--setFadeFull( ) ;
		
		setStateMessageIdle( "dartagnan" ) ;
		addGoalGetToPointInLevel( "dartagnan", -223, 160, "miladyhouse2", false, true ) ;
		waitForNoGoal( "dartagnan" ) ;
		unlockPlayerInPlace( ) ;
		
		if ( isItemEquipped( "hat_de_wardes" ) and isItemEquipped( "doublet_de_wardes" ) 
			and getEquippedItem( "tabbard" ) == "" ) then
			trickedMilady = true ;
		else
			lockPlayerInPlace( ) ;
			
			sayAndWait( "milady", getString( "mpb25d2" ) ) ;
						
			addGoalGetToPointInLevel( "dartagnan", -99, 133, "miladyhouse", false, true ) ;
			
			while ( not ( getCharacterFunctionalLevel( "dartagnan" ) == "miladyhouse" ) ) do
				coroutine.yield( ) ;
			end
		
			--setFadeNone( ) ;
			
			waitForNoGoal( "dartagnan" ) ;
			
			
			if ( isItemEquipped( "hat_de_wardes" ) and isItemEquipped( "doublet_de_wardes" )
				and not ( getEquippedItem( "tabbard" ) == "" ) ) then
				-- dart wearing disguise, but tabbard is overtop
				local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb25d3_5" ) ) ;
				waitForBubbleClosed( bubInd ) ;
			else
				-- dart doesn't even have on disguise
				local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb25d3" ) ) ;
				waitForBubbleClosed( bubInd ) ;
			end
			
			upstairsFailed = upstairsFailed + 1 ;
			if ( upstairsFailed >= 3 ) then
				equipItem( "hat_de_wardes" ) ;
				equipItem( "doublet_de_wardes" ) ;
				unequipItem( getEquippedItem( "tabbard" ) ) ;
			end
			
			unlockPlayerInPlace( ) ;
		end
	end
	
	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "milady" ) ;
	
	sayAndWait( "milady", getString( "mpb25d4" ) ) ;
	local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb25d5" ), getString( "mpb25d6" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	sayAndWait( "milady", getString( "mpb25d7" ) ) ;
	local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb25d8" ), getString( "mpb25d9" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;

	addGoalGetToPointInLevel( "dartagnan", 65, 225, "miladyhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	sayAndWait( "milady", getString( "mpb25d10" ) ) ;
	local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mpb25d11" ), getString( "mpb25d12" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	
	sayAndWait( "milady", getString( "mpb25d13" ) ) ;

	local noMusicID = addMusic( "none", 15 ) ;

	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	playSound( "intimate", 1.0 ) ;
	
	wait( 4 ) ;
	
	removeMusic( noMusicID ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	-- fade from black	
	--setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	--fadeFromColour( fadeTime ) ;
	--while ( getFadeRatio( ) < 0.5 ) do
	--	coroutine.yield( ) ;
	--end
	
	--setFadeColour( 0.0, 0.0, 0.0, 0.5 ) ;
	--setFadeFull( ) ;

	sayAndWait( "milady", getString( "mpb25d14" ) ) ;
	
	setInventoryItem( "milady_saphire_ring", 1 ) ;

	unlockPlayerInPlace( ) ;

	setMissionFreezeGame( name, true ) ; -- going outside, so need to use freeze
	
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	placeDead( "milady" ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	placeCharacter( "dartagnan", "france", 2977, -575 ) ;
	
	unequipItem( "hat_de_wardes" ) ;
	unequipItem( "doublet_de_wardes" ) ;
	setInventoryItem( "hat_de_wardes", 0 ) ;
	setInventoryItem( "doublet_de_wardes", 0 ) ;

	-- put a hat and shirt back on
	equipItem( getBestItem( "hat" ) ) ;
	equipItem( getBestItem( "shirt" ) ) ;
		
	-- fade from black
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb25d14_5" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb25d15" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	setMissionFreezeGame( name, false ) ;
	
	removeWeatherSpot( darkRoomWeather ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb26" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb26( name )
	-- Inform Athos about the saphire that you just got
	DEBUG_OUTPUT( name .. " started" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb26m1" ), "athos" ) ;
	
	waitForTalk( "dartagnan", "athos", false ) ;
	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mpb26d1" ) ) ;
	sayAndWait( "athos", getString( "mpb26d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb26d3" ) ) ;
	sayAndWait( "athos", getString( "mpb26d4" ) ) ;
	sayAndWait( "athos", getString( "mpb26d5" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb26d6" ) ) ;
	
	unlockPlayerInPlace( ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb27" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb27( name )
	-- Go back to you appartment, Kitty is there
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "athos", getString( "mpb26d7" ) ) ;
	setMissionChatString( name, "planchet", getString( "mpb26d8" ) ) ;
		
	setMissionFaceCharacter( name, "kitty", "dartagnan" ) ;
	placeCharacter( "kitty", "bonacieuxhouse2", -151, -7 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb27m1" ), "kitty" ) ;
	
	while ( not getCharacterLevel( "dartagnan" ) == "bonacieuxhouse2" ) do
		coroutine.yield( ) ;
	end
	
	addHeartMaker( "kitty" ) ;
		
	waitForTalk( "dartagnan", "kitty", false ) ;
	removeMarker( name, marker ) ;

	removeHeartMaker( "kitty" ) ;
	
	lockPlayerInPlace( ) ;
	
	sayAndWait( "dartagnan", getString( "mpb27d1" ) ) ;
	sayAndWait( "kitty", getString( "mpb27d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb27d3" ) ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, -1 ) ;
	addGoalGetToPointInLevel( "dartagnan", -36, -51, "bonacieuxhouse2", false, true ) ;
	wait( 1 ) ;
	
	addGoalGetToPointInLevel( "kitty", -101, -36, "bonacieuxhouse2", false, true ) ;
	
	waitForNoGoal( "dartagnan" ) ;
	waitForNoGoal( "kitty" ) ;
	
	playSound( "writing", 1.0 ) ;
	sayAndWait( "dartagnan", getString( "mpb27d4" ) ) ;
	playSound( "paper", 1.0 ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "kitty" ) ;
	sayAndWait( "dartagnan", getString( "mpb27d5" ) ) ;

	addHeartMaker( "kitty" ) ;
	sayAndWait( "kitty", getString( "mpb27d6" ) ) ;
	removeHeartMaker( "kitty" ) ;
	
	addGoalGetToPointInLevel( "kitty", -169, -128, "bonacieuxhouse", false, true ) ;
	
	while ( isCharacterOnScreen( "kitty" ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "kitty" ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb27d7" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	addGoalGetToPointInLevel( "dartagnan", -58, -25, "bonacieuxhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	playSound( "snoring", 1.0 ) ;
	wait( 2.1 ) ;
	playSound( "snoring", 1.0 ) ;
	wait( 2 ) ;
	
	placeCharacter( "kitty", "bonacieuxhouse2", -169, -84 ) ;
	setMissionFaceCharacter( name, "dartagnan", "kitty" ) ;
	addGoalGetToPointInLevel( "kitty", -100, -25, "bonacieuxhouse2", false, true ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	waitForNoGoal( "kitty" ) ;
	sayAndWait( "kitty", getString( "mpb27d8" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb27d9" ) ) ;
	
	setMissionFaceDirection( name, "dartagnan", -1, 0 ) ;
	addGoalGetToPointInLevel( "kitty", -169, -128, "bonacieuxhouse", false, true ) ;
	
	while ( isCharacterOnScreen( "kitty" ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "kitty" ) ;
	placeDead( "kitty" ) ;
	
	unlockPlayerInPlace( ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb28" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb28( name )
	-- Go visit Milady, as d'Artagnan now, sleep with her, she gets mad, comic
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "athos", getString( "mpb26d7" ) ) ;
	setMissionChatString( name, "kitty", getString( "mpb27d10" ) ) ;

	setMissionFaceCharacter( name, "milady", "dartagnan" ) ;
	placeCharacter( "milady", "miladyhouse2", 112, 56 ) ;

	setMissionFaceCharacter( name, "kitty", "dartagnan" ) ;
	placeCharacter( "kitty", "miladyhouse2", -244, -130 ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb28m1" ), "milady" ) ;
	
	waitForTalk( "dartagnan", "milady", false ) ;
	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;	
	
	sayAndWait( "dartagnan", getString( "mpb28d1" ) ) ;
	sayAndWait( "milady", getString( "mpb28d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb28d3" ) ) ;
	sayAndWait( "milady", getString( "mpb28d4" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb28d5" ) ) ;
	sayAndWait( "milady", getString( "mpb28d6" ) ) ;
		
	setMissionFaceCharacter( name, "dartagnan", "milady" ) ;
	setMissionFaceCharacter( name, "milady", "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", 65, 138, "miladyhouse2", false, true ) ;
	addGoalGetToPointInLevel( "milady", 100, 138, "miladyhouse2", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	waitForNoGoal( "milady" ) ;
		
	local noMusicID = addMusic( "none", 15 ) ;
		
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	playSound( "intimate", 1.0 ) ;
	
	wait( 4 ) ;
	
	removeMusic( noMusicID ) ;
		
	-- show comic
	local comic1 = createComic( "milady1" ) ;
	
	addText( comic1, getString( "milady1_d1" ), 9, 5, 152, 50 ) ;
	addText( comic1, getString( "milady1_d2" ), 9, 137, 74, 168 ) ;
	addText( comic1, getString( "milady1_d3" ), 55, 202, 219, 239 ) ;
	addText( comic1, getString( "milady1_d4" ), 9, 260, 157, 288 ) ;
	addText( comic1, getString( "milady1_d5" ), 262, 115, 414, 195 ) ;
	addText( comic1, getString( "milady1_d6" ), 246, 210, 350, 238 ) ;
	addText( comic1, getString( "milady1_d7" ), 369, 231, 415, 254 ) ;
	addText( comic1, getString( "milady1_d8" ), 468, 3, 572, 31 ) ;
	addText( comic1, getString( "milady1_d8_5" ), 459, 185, 557, 241 ) ;
	addText( comic1, getString( "milady1_d9" ), 615, 3, 789, 42 ) ;
	addText( comic1, getString( "milady1_d10" ), 611, 248, 792, 287 ) ;
	addText( comic1, getString( "milady1_d11" ), 47, 519, 251, 583 ) ;
	addText( comic1, getString( "milady1_d12" ), 285, 499, 462, 582 ) ;
	addText( comic1, getString( "milady1_d13" ), 628, 311, 792, 355 ) ;
	
	addMouseOver( comic1, getString( "milady" ), 12, 51, 109, 180, 54, 55 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 125, 45, 220, 170, 166, 48 ) ;

	addMouseOver( comic1, getString( "milady" ), 239, 12, 326, 138, 264, 25 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 348, 15, 415, 133, 381, 19 ) ;

	addMouseOver( comic1, getString( "milady" ), 436, 26, 527, 166, 480, 28 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 552, 56, 597, 223, 585, 66 ) ;

	addMouseOver( comic1, getString( "milady" ), 678, 53, 795, 258, 727, 59 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 186, 314, 250, 512, 211, 316 ) ;
	addMouseOver( comic1, getString( "milady" ), 13, 354, 121, 591, 78, 353 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 345, 282, 440, 474, 372, 281 ) ;
	addMouseOver( comic1, getString( "kitty" ), 426, 443, 541, 595, 498, 440 ) ;

	addMouseOver( comic1, getString( "kitty" ), 575, 360, 648, 469, 596, 363 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 656, 363, 748, 592, 687, 362 ) ;

	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	placeCharacter( "dartagnan", "france", 2978, -592 ) ;
	
	clearGoals( "milady" ) ;
	placeDead( "milady" ) ;
	
	dressUnequipLady( ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	unlockPlayerInPlace( ) ;

	completeMission( name ) ;
	activateMission( "missionparisb29" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function dressUnequipLady( )
	-- unequip all equipment
	local itemName = getAEquippedItem( ) ;
	while ( not ( itemName == "" ) ) do
		unequipItem( itemName ) ;
		itemName = getAEquippedItem( ) ;
	end
	
	dress_dartagnanLady( "dartagnan" ) ;
end

function execute_missionparisb29( name )
	-- Run through city dressed as lady
	DEBUG_OUTPUT( name .. " started" ) ;
	
	dressUnequipLady( ) ;
	
	setForceShowFootprintGuide( true ) ;
	
	-- people treat you like a lady
	setMissionChatString( name, "parishousebman2", getString( "mpb29d17" ) ) ;
	setMissionChatString( name, "parislady9", getString( "mpb29d15" ) ) ;
	setMissionChatString( name, "parisman14", getString( "mpb29d17" ) ) ;
	setMissionChatString( name, "parisman3", getString( "mpb29d16" ) ) ;
	setMissionChatString( name, "parisman2", getString( "mpb29d16" ) ) ;
	setMissionChatString( name, "parislady17", getString( "mpb29d15" ) ) ;
	setMissionChatString( name, "athoshouselady", getString( "mpb29d15" ) ) ;
	setMissionChatString( name, "athoshouseman", getString( "mpb29d18" ) ) ;
	setMissionChatString( name, "aramis", getString( "mpb29d17" ) ) ;
		
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "grimaud", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "kitty", "dartagnan" ) ;
	
	placeCharacter( "aramis", "athoshouse2", 97, -132 ) ;
	
	setOintmentButtonVisible( false ) ;
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	
	local triggerAreaA = addTriggerArea( name, "missionparrisb29LockOut1", true, "france", 
		{ 2960, -425, 3131, -231 }, { 3100, -718, 3348, -251 } ) ;
		
	local triggerAreaB = addTriggerArea( name, "missionparrisb29LockOut2", true, "france", 
		{ 2132, -821, 2548, -642 }, { 2054, -721, 2207, -387 } ) ;
		
	local triggerAreaC = addTriggerArea( name, "missionparrisb29LockOut3", true, "france", 
		{ 2154, -182, 2570, -77 } ) ;
	
	local doorLockA = addDoorLock( name, "missionparrisb29DoorLockOut", true, 
		"miladyout", "parishousebout", "parishouseaout", "parischurchaout1", "parischurchaout2", "parishousehout" ) ;
	
	
	setMissionFreezeGame( name, true ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb29d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	setMissionFreezeGame( name, false ) ;	
	
	local markerPosX = 2079 ;
	local markerPosY = -263 ;
	local marker = addMarkerPosition( name, true, getString( "mpb29m1" ), "france", markerPosX, markerPosY ) ;
	
	local dist = 150.0
	while ( distanceToPoint( "dartagnan", "france", markerPosX, markerPosY ) > dist ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	local triggerAreaD = addTriggerArea( name, "missionparrisb29LockOut3", true, "france", 
		{ 2278, -805, 2760, -600, 2606, -257, 2120, -480 } ) ;
	
	local triggerAreaE = addTriggerArea( name, "missionparrisb29LockOut4", true, "france", 
		{ 1654, -602, 2003, -412 } ) ;
		
	local triggerAreaF = addTriggerArea( name, "missionparrisb29LockOut5", true, "france", 
		{ 910, -577, 1405, -424 } ) ;
		
	local triggerAreaG = addTriggerArea( name, "missionparrisb29LockOut6", true, "france", 
		{ 1320, -174, 1668, 803 } ) ;
		
	local triggerAreaH = addTriggerArea( name, "missionparrisb29LockOut7", true, "france", 
		{ 636, 141, 854, 652 } ) ;
		
	local triggerAreaI = addTriggerArea( name, "missionparrisb29LockOut8", true, "france", 
		{ 656, 914, 857, 1480 }, { 1023, 942, 1262, 1472 } ) ;
		
	local triggerAreaJ = addTriggerArea( name, "missionparrisb29LockOut9", true, "france", 
		{ 1024, 1937, 1310, 2383 }, { 569, 1799, 854, 1922, 861, 1994, 748, 2367, 386, 2247 } ) ;
	
	local triggerAreaK = addTriggerArea( name, "missionparrisb29LockOut10", true, "france", 
		{ 586, 2363, 764, 2740 }, { 1032, 2407, 1247, 2732 } ) ;
		
	local triggerAreaL = addTriggerArea( name, "missionparrisb29LockOut11", true, "france", 
		{ 542, 2696, 751, 3324 }, { 1188, 2701, 1368, 3058 } ) ;
		
	local triggerAreaM = addTriggerArea( name, "missionparrisb29LockOut12", true, "france", 
		{ 744, 3257, 1662, 3496 }, { 1355, 3011, 1646, 3533 } ) ;
		
	local markerPosX = 1190 ;
	local markerPosY = -270 ;
	local marker = addMarkerPosition( name, true, getString( "mpb29m1" ), "france", markerPosX, markerPosY ) ;

	local dist = 300.0
	while ( distanceToPoint( "dartagnan", "france", markerPosX, markerPosY ) > dist ) do
		coroutine.yield( ) ;
	end
	
	removeMarker( name, marker ) ;
	
	local triggerAreaN = addTriggerArea( name, "missionparrisb29LockOut13", true, "france", 
		{ 1712, -450, 1985, -42 } ) ;
	
	local markerPosX = 905 ;
	local markerPosY = 2860 ;
	local marker = addMarkerPosition( name, true, getString( "mpb29m1" ), "france", markerPosX, markerPosY ) ;

	local dist = 300.0
	while ( distanceToPoint( "dartagnan", "france", markerPosX, markerPosY ) > dist ) do
		coroutine.yield( ) ;
	end

	removeMarker( name, marker ) ;

	local triggerAreaO = addTriggerArea( name, "missionparrisb29LockOut14", true, "france", 
		{ 694, 2149, 1186, 2393 } ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mpb29m1" ), "athos" ) ;
	waitForTalk( "dartagnan", "athos", false ) ;
	removeMarker( name, marker ) ;
	
	removeTriggerArea( triggerAreaA ) ;
	removeTriggerArea( triggerAreaB ) ;
	removeTriggerArea( triggerAreaC ) ;
	removeTriggerArea( triggerAreaD ) ;
	removeTriggerArea( triggerAreaE ) ;
	removeTriggerArea( triggerAreaF ) ;
	removeTriggerArea( triggerAreaG ) ;
	removeTriggerArea( triggerAreaH ) ;
	removeTriggerArea( triggerAreaI ) ;
	removeTriggerArea( triggerAreaJ ) ;
	removeTriggerArea( triggerAreaK ) ;
	removeTriggerArea( triggerAreaL ) ;
	removeTriggerArea( triggerAreaM ) ;
	removeTriggerArea( triggerAreaN ) ;
	removeTriggerArea( triggerAreaO ) ;
	
	removeDoorLock( doorLockA ) ;
	
	lockPlayerInPlace( ) ;
	
	setForceShowFootprintGuide( false ) ;
	
	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	sayAndWait( "dartagnan", getString( "mpb29d2" ) ) ;
	sayAndWait( "athos", getString( "mpb29d3" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb29d4" ) ) ;
	sayAndWait( "athos", getString( "mpb29d5" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb29d6" ) ) ;
	sayAndWait( "athos", getString( "mpb29d7" ) ) ;
	
	-- kitty comes in
	setMissionFaceCharacter( name, "dartagnan", "kitty" ) ;
	setMissionFaceCharacter( name, "aramis", "kitty" ) ;
	setMissionFaceCharacter( name, "athos", "kitty" ) ;
	
	placeCharacterInDoor( "kitty", "athosstairsup", false ) ;
	addGoalGetToPointInLevel( "kitty", -16, -65, "athoshouse2", false, true ) ;
	waitForNoGoal( "kitty" ) ;
	
	sayAndWait( "kitty", getString( "mpb29d8" ) ) ;
	
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	sayAndWait( "dartagnan", getString( "mpb29d9" ) ) ;

	setMissionFaceCharacter( name, "athos", "aramis" ) ;
	setMissionFaceCharacter( name, "kitty", "aramis" ) ;
	sayAndWait( "aramis", getString( "mpb29d10" ) ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "kitty" ) ;
	sayAndWait( "kitty", getString( "mpb29d11" ) ) ;
	
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	playSound( "equipclothes", 1.0 ) ;
	wait( 0.5 ) ;
	
	-- get normal clothes back
	setOintmentButtonVisible( true ) ;
	setMapButtonVisible( true ) ;
	setInventoryButtonVisible( true ) ;

	clearCharacterPieces( "dartagnan" ) ;
	equipItem( getBestItem( "weaponmelee" ) ) ;
	equipItem( getBestItem( "weaponranged" ) ) ;
	equipItem( getBestItem( "shirt" ) ) ;
	equipItem( getBestItem( "tabbard" ) ) ;
	equipItem( getBestItem( "hat" ) ) ;
	equipItem( getBestItem( "gloves" ) ) ;
	equipItem( getBestItem( "pants" ) ) ;
	equipItem( getBestItem( "boots" ) ) ;
	equipItem( getBestItem( "collar" ) ) ;
	equipItem( getBestItem( "sashbelt" ) ) ;
	equipItem( getBestItem( "belt" ) ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
			
	sayAndWait( "dartagnan", getString( "mpb29d12" ) ) ;
	sayAndWait( "athos", getString( "mpb29d13" ) ) ;
	
	unlockPlayerInPlace( ) ;

	removeMusic( tenseMusicID ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb30" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function mpb29Helper( x, y )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 200.0, true, getString( "mpb29d14" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb29d14" ) ) ;

	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function missionparrisb29LockOut1( )
	mpb29Helper( 2984, -553 ) ;
end

function missionparrisb29LockOut2( )
	mpb29Helper( 2322, -544 ) ;
end

function missionparrisb29LockOut3( )
	mpb29Helper( 2308, -264 ) ;
end

function missionparrisb29LockOut4( )
	mpb29Helper( 1863, -351 ) ;
end

function missionparrisb29LockOut5( )
	mpb29Helper( 1195, -330 ) ;
end

function missionparrisb29LockOut6( )
	mpb29Helper( 1181, 318 ) ;
end

function missionparrisb29LockOut7( )
	mpb29Helper( 941, 407 ) ;
end

function missionparrisb29LockOut8( )
	mpb29Helper( 948, 1218 ) ;
end

function missionparrisb29LockOut9( )
	mpb29Helper( 918, 2219 ) ;
end

function missionparrisb29LockOut10( )
	mpb29Helper( 901, 2558 ) ;
end

function missionparrisb29LockOut11( )
	mpb29Helper( 904, 3160 ) ;
end

function missionparrisb29LockOut12( )
	mpb29Helper( 1228, 3193 ) ;
end

function missionparrisb29LockOut13( )
	mpb29Helper( 1538, -274 ) ;
end

function missionparrisb29LockOut14( )
	mpb29Helper( 903, 2528 ) ;
end

function missionparrisb29DoorLockOut( )
	--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "mpb29d14" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mpb29d14" ) ) ;
	waitForBubbleClosed( bubInd ) ;
end

function execute_missionparisb30( name )
	-- Sell saphire ring
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "aramis", getString( "mpb29d19" ) ) ;
	setMissionChatString( name, "athos", getString( "mpb29d20" ) ) ;
	setMissionChatString( name, "kitty", getString( "mpb29d21" ) ) ;

	setInventoryItem( "milady_saphire_ring", 1 ) ;
	setInventoryItem( "athos_ring_money_pouch", 0 ) ;

	setMissionFaceCharacter( name, "aramis", "athos" ) ;
	setMissionFaceCharacter( name, "athos", "aramis" ) ;
	setMissionFaceCharacter( name, "kitty", "dartagnan" ) ;
	ensureCharacterAroundPoint( "aramis", "athoshouse2", 97, -132, 300 ) ;
	ensureCharacterAroundPoint( "kitty", "athoshouse2", -16, -65, 300 ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb30m1" ), "jeweller1" ) ;
	waitForTalk( "dartagnan", "jeweller1", false ) ;
	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "jeweller1", true ) ;
	setMissionFaceCharacter( name, "jeweller1", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mpb30d1" ) ) ;
	sayAndWait( "jeweller1", getString( "mpb30d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb30d3" ) ) ;
	
	playSound( "dropmoney", 0.5 ) ;
	setInventoryItem( "athos_ring_money_pouch", 1 ) ;
	setInventoryItem( "milady_saphire_ring", 0 ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "jeweller1", false ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb31" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb31( name )
	-- Return to Athos with money from ring
	DEBUG_OUTPUT( name .. " started" ) ;

	setInventoryItem( "athos_ring_money_pouch", 1 ) ;

	place_aramisA( "aramis" ) ;
	placeDead( "kitty" ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb31m1" ), "athos" ) ;
	waitForTalk( "dartagnan", "athos", false ) ;
	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;

	sayAndWait( "dartagnan", getString( "mpb31d1" ) ) ;
	
	playSound( "dropmoney", 0.5 ) ;
	setInventoryItem( "athos_ring_money_pouch", 0 ) ;
		
	-- planchet come in, inform d'artagnan that he got letter from constance and the cardinal
	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;
	placeCharacterInDoor( "planchet", "athosstairsup", false ) ;
	addGoalGetToPointInLevel( "planchet", -17, -53, "athoshouse2", false, true ) ;
	waitForNoGoal( "planchet" ) ;
	
	sayAndWait( "planchet", getString( "mpb31d2" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	sayAndWait( "dartagnan", getString( "mpb31d3" ) ) ;

	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	
	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mpb31d4" ) ) ;
	removeHeartMaker( "dartagnan" ) ;

	sayAndWait( "athos", getString( "mpb31d5" ) ) ;

	addHeartMaker( "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mpb31d6" ) ) ;
	removeHeartMaker( "dartagnan" ) ;

	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;
	sayAndWait( "planchet", getString( "mpb31d7" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	sayAndWait( "dartagnan", getString( "mpb31d8" ) ) ;
	sayAndWait( "athos", getString( "mpb31d9" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb31d10" ) ) ;
	
	unlockPlayerInPlace( ) ;
	
	addGoalGetToPointInLevel( "planchet", getPlanchetAPosX( ), getPlanchetAPosY( ), getPlanchetALevel( ), false, true ) ;
		
	addMoney( 2500 ) ;
		
	completeMission( name ) ;
	activateMission( "missionparisb32" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb32( name )
	-- See Constance's carriage on road
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "athos", getString( "mpb31d12" ) ) ;
	setMissionChatString( name, "aramis", getString( "mpb31d11" ) ) ;

	local overrideSaveID = createOverrideSavePos( "france", -1393, 5033 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -2054, 4503, -127, 6511 } ) ;

	local marker = addMarkerPosition( name, true, getString( "mpb32m1" ), "france", -973, 5634 ) ;

	local triggerArea = addTriggerArea( name, "", false, "france", { -1376, 5451, -690, 5767 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	setMissionFaceDirection( name, "dartagnan", 1, 0 ) ;
	addGoalGetToPointInLevel( "dartagnan", -1129, 5646, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;	
	
	local loveMusicID = addMusic( "love", 15 ) ;
		
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	-- show comic
	local comic1 = createComic( "constance2" ) ;

	addText( comic1, getString( "constance2_d1" ), 574, 15, 668, 58 ) ;
	addText( comic1, getString( "constance2_d2" ), 23, 279, 208, 342 ) ;
	addText( comic1, getString( "constance2_d3" ), 475, 242, 706, 307 ) ;
		
	addMouseOver( comic1, getString( "constance" ), 57, 84, 78, 101, 67, 85 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 171, 74, 283, 247, 238, 69 ) ;

	addMouseOver( comic1, getString( "constance" ), 370, 41, 495, 176, 435, 44 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 635, 14, 794, 215, 711, 19 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 88, 326, 205, 582, 145, 330 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 363, 288, 500, 491, 426, 285 ) ;

	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	removeMusic( loveMusicID ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	setMissionFreezeGame( name, false ) ;
	
	clearGoals( "planchet" ) ;
	place_planchetA( "planchet" ) ;

	removeOverrideSavePos( overrideSaveID ) ;
	
	completeMission( name ) ;
	activateMission( "missionparisb33" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb33( name )
	-- Meet with the Cardinal
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "aramis", getString( "mpb31d11" ) ) ;
	setMissionChatString( name, "athos", getString( "mpb31d13" ) ) ;

	local marker = addMarkerCharacter( name, true, getString( "mpb33m1" ), "cardinal" ) ;
	waitForTalk( "dartagnan", "cardinal", false ) ;
	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	setMissionFaceCharacter( name, "cardinal", "dartagnan" ) ;
	
	sayAndWait( "cardinal", getString( "mpb33d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb33d2" ) ) ;
	sayAndWait( "cardinal", getString( "mpb33d3" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb33d4" ) ) ;
	sayAndWait( "cardinal", getString( "mpb33d5" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb33d6" ) ) ;
	sayAndWait( "cardinal", getString( "mpb33d7" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb33d8" ) ) ;
	sayAndWait( "cardinal", getString( "mpb33d9" ) ) ;
	sayAndWait( "cardinal", getString( "mpb33d10" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb33d11" ) ) ;
	sayAndWait( "cardinal", getString( "mpb33d12" ) ) ;
	sayAndWait( "cardinal", getString( "mpb33d13" ) ) ;
	
	unlockPlayerInPlace( ) ;

	completeMission( name ) ;
	activateMission( "missionparisb34" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionparisb34( name )
	-- Report to d'Essart
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "louisxiii", getString( "mpb34d8" ) ) ;

	placeCharacter( "essart", "guardhouse", -62, 301 ) ;

	local marker = addMarkerCharacter( name, true, getString( "reportessart" ), "essart" ) ;
	waitForTalk( "dartagnan", "essart", false ) ;
	removeMarker( name, marker ) ;	

	lockPlayerInPlace( ) ;
	setMissionFaceCharacter( name, "essart", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "essart" ) ;
	
	sayAndWait( "essart", getString( "mpb34d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mpb34d2" ) ) ;
	sayAndWait( "essart", getString( "mpb34d3" ) ) ;
	sayAndWait( "essart", getString( "mpb34d4" ) ) ;
	
	addGoalGetToPointInLevel( "essart", 3038, 3327, "france", false, true ) ;
	
	while ( isCharacterOnScreen( "essart" ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "essart" ) ;
	
	unlockPlayerInPlace( ) ;
	
	completeMission( name ) ;
	activateMission( "missionrochelle1" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle1( name )
	-- Encounter with two assasin's going to La Rochelle
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "louisxiii", getString( "mpb34d8" ) ) ;
		
	setMissionChatString( name, "athos", getString( "mpb34d5" ) ) ;
	setMissionChatString( name, "porthos", getString( "mpb34d6" ) ) ;
	setMissionChatString( name, "aramis", getString( "mpb34d7" ) ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", -6561, 8702 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -8925, 8462, -6109, 10346 } ) ;
	
	-- two ambush enemies
	local enemy1 = createTempCharacter( getString( "assassin" ), "france", -7443, 9115 ) ;
	setStatsCalculatorStatic( enemy1, 24, 24, 24, 24 ) ;
	randomDressEnemy( enemy1, 0.0, 1133 ) ;
	setRangedWeapon( enemy1, "musket_matchlock_1" ) ;
	
	local enemy2 = createTempCharacter( getString( "assassin" ), "france", -7395, 9539 ) ;
	setStatsCalculatorStatic( enemy2, 24, 24, 24, 24 ) ;
	randomDressEnemy( enemy2, 0.0, 988379 ) ;
	setRangedWeapon( enemy2, "musket_matchlock_1" ) ;
	
	--local radius = 400.0 ;
	--setContainZone( enemy1, true, -7234, 9126, radius ) ;
	--setContainZone( enemy2, true, -7262, 9481, radius ) ;
	
	setMissionFaceCharacter( name, enemy1, "dartagnan" ) ;
	setMissionFaceCharacter( name, enemy2, "dartagnan" ) ;
	
	local triggerArea = addTriggerArea( name, "", false, "france", 
		{ -7762, 8495, -7295, 8324, -6466, 9584, -7314, 9995 } ) ;
	
	local markerX = -7234 ;
	local markerY = 9344 ;
	local marker = addMarkerPosition( name, true, getString( "mpb35m1" ), "france", markerX, markerY ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeMarker( name, marker ) ;

	removeTriggerArea( triggerArea ) ;

	makeEnemies( "dartagnan", enemy1, enemy2 ) ;
	setRangedLoadedRatio( enemy1, 0.99 ) ;
	setRangedLoadedRatio( enemy2, 0.98 ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( enemy1, true ) ;
	setIgnoreFreeze( enemy2, true ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", markerX, markerY, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	
	setIgnoreFreeze( enemy1, false ) ;
	setIgnoreFreeze( enemy2, false ) ;
	
	sayAndWait( "dartagnan", getString( "mr1d1" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	
	
	--local bubInd = characterSay( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "mr1d1" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	
	local markerEnemy1 = addMarkerCharacter( name, true, getString( "fight" ), enemy1 ) ;
	local markerEnemy2 = addMarkerCharacter( name, true, getString( "fight" ), enemy2 ) ;

	while ( isCharacterAlive( enemy1 ) or isCharacterAlive( enemy2 ) ) do
		coroutine.yield( ) ;
	end	

	removeMarker( name, markerEnemy1 ) ;
	removeMarker( name, markerEnemy2 ) ;

	setMissionFreezeGame( name, true ) ;
	if ( characterExists( enemy1 ) ) then
		setIgnoreFreeze( enemy1, true ) ;
	end
	if ( characterExists( enemy2 ) ) then
		setIgnoreFreeze( enemy2, true ) ;
	end
	
	setStateMessageIdle( "dartagnan" ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mr1d2" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mr1d3" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	if ( characterExists( enemy1 ) ) then
		setIgnoreFreeze( enemy1, false ) ;
	end
	if ( characterExists( enemy2 ) ) then
		setIgnoreFreeze( enemy2, false ) ;
	end

	removeOverrideSavePos( overrideSaveID ) ;

	completeMission( name ) ;
	activateMission( "missionrochelle2" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle2( name )
	-- Get mission from d'Essart to south bastion
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "louisxiii", getString( "mpb34d8" ) ) ;

	local marker = addMarkerCharacter( name, true, getString( "reportessart" ), "essart" ) ;
	waitForTalk( "dartagnan", "essart", false ) ;
	removeMarker( name, marker ) ;	

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "essart", true ) ;
	
	setMissionFaceCharacter( name, "essart", "dartagnan" ) ;
	
	sayAndWait( "essart", getString( "mr2d1" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "essart", false ) ;	
	
	completeMission( name ) ;
	activateMission( "missionrochelle3" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle3( name )
	-- Fight at the southern Bastion
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "louisxiii", getString( "mpb34d8" ) ) ;
		
	setMissionChatString( name, "essart", getString( "mr2d2" ) ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", -11521, 12465 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -13422, 12121, -11269, 13732 } ) ;
	
	-- enemy1
	local enemy1 = createTempCharacter( getString( "rochellais" ), "france", -12793, 12828 ) ;
	setStatsCalculatorStatic( enemy1, 28, 28, 28, 28 ) ;
	randomDressRochellais( enemy1, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy1, "sword_1" ) ;

	local enemy2 = createTempCharacter( getString( "rochellais" ), "france", -12789, 12873 ) ;
	setStatsCalculatorStatic( enemy2, 28, 28, 28, 28 ) ;
	randomDressRochellais( enemy2, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy2, "sword_1" ) ;

	local enemy3 = createTempCharacter( getString( "rochellais" ), "france", -12813, 12933 ) ;
	setStatsCalculatorStatic( enemy3, 28, 28, 28, 28 ) ;
	randomDressRochellais( enemy3, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy3, "sword_1" ) ;

	local enemy4 = createTempCharacter( getString( "rochellais" ), "france", -12644, 12940 ) ;
	setStatsCalculatorStatic( enemy4, 28, 28, 28, 28 ) ;
	randomDressRochellais( enemy4, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy4, "sword_1" ) ;

	local enemy5 = createTempCharacter( getString( "rochellais" ), "france", -12655, 12833 ) ;
	setStatsCalculatorStatic( enemy5, 28, 28, 28, 28 ) ;
	randomDressRochellais( enemy5, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy5, "sword_1" ) ;
	
	local enemyWall1 = createTempCharacter( getString( "rochellais" ), "france", -12734, 12557 ) ;
	setStatsCalculatorStatic( enemyWall1, 28, 20, 28, 32 ) ;
	randomDressRochellais( enemyWall1, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( enemyWall1, "musket_matchlock_1" ) ;
	setRangedAttackDist( enemyWall1, 300 ) ; -- shoot from just offscreen
	setRangedLoadedRatio( enemyWall1, 0.9 ) ;
	setBaseFaceCharacter( enemyWall1, "dartagnan" ) ;
	setHasLootDrop( enemyWall1, false ) ;
	setBreadcrumbToPos( enemyWall1, -12734, 12800 ) ;
	setLockRangedStill( enemyWall1, true ) ;

	local enemyWall2 = createTempCharacter( getString( "rochellais" ), "france", -12547, 12559 ) ;
	setStatsCalculatorStatic( enemyWall2, 28, 20, 28, 32 ) ;
	randomDressRochellais( enemyWall2, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( enemyWall2, "musket_matchlock_1" ) ;
	setRangedAttackDist( enemyWall2, 300 ) ; -- shoot from just offscreen
	setRangedLoadedRatio( enemyWall2, 0.9 ) ;
	setBaseFaceCharacter( enemyWall2, "dartagnan" ) ;
	setHasLootDrop( enemyWall2, false ) ;
	setBreadcrumbToPos( enemyWall2, -12547, 12800 ) ;
	setLockRangedStill( enemyWall2, true ) ;
	
	local goodGuard1 = createTempCharacter( getString( "guardsman" ), "france", -12359, 12805 ) ;
	setStatsCalculatorStatic( goodGuard1, 28, 28, 28, 28 ) ;
	randomDressGuardsman( goodGuard1, 0.0, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( goodGuard1, "musket_matchlock_1" ) ;
	setMeleeWeapon( goodGuard1, "sword_1" ) ;
	loadRanged( goodGuard1 ) ;
	setRangedAttackDist( goodGuard1, 300 ) ;
	
	local goodGuard2 = createTempCharacter( getString( "guardsman" ), "france", -12311, 12884 ) ;
	setStatsCalculatorStatic( goodGuard2, 28, 28, 28, 28 ) ;
	randomDressGuardsman( goodGuard2, 0.0, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( goodGuard2, "musket_matchlock_1" ) ;
	setMeleeWeapon( goodGuard2, "sword_1" ) ;
	loadRanged( goodGuard2 ) ;
	setRangedAttackDist( goodGuard2, 300 ) ;
	
	local goodGuard3 = createTempCharacter( getString( "guardsman" ), "france", -12314, 12963 ) ;
	setStatsCalculatorStatic( goodGuard3, 28, 28, 28, 28 ) ;
	randomDressGuardsman( goodGuard3, 0.0, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( goodGuard3, "musket_matchlock_1" ) ;
	setMeleeWeapon( goodGuard3, "sword_1" ) ;
	loadRanged( goodGuard3 ) ;
	setRangedAttackDist( goodGuard3, 300 ) ;
	
	local marker = addMarkerPosition( name, true, getString( "mr3m1" ), "france", -12585, 12854 ) ;
	
	-- trigger in front of Aramis' place
	local triggerArea = addTriggerArea( name, "", false, "france", { -12958, 12675, -12099, 13099 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;
	
	makeEnemies( "dartagnan", enemy1, enemy2, enemy3, enemy4, enemy5, enemyWall1, enemyWall2 ) ;
	makeEnemies( goodGuard1, enemy1, enemy2, enemy3, enemy4, enemy5, enemyWall1, enemyWall2 ) ;
	makeEnemies( goodGuard2, enemy1, enemy2, enemy3, enemy4, enemy5, enemyWall1, enemyWall2 ) ;
	makeEnemies( goodGuard3, enemy1, enemy2, enemy3, enemy4, enemy5, enemyWall1, enemyWall2 ) ;

	local enemy1ID = addMarkerCharacter( name, true, getString( "fight" ), enemy1 ) ;
	local enemy2ID = addMarkerCharacter( name, true, getString( "fight" ), enemy2 ) ;
	local enemy3ID = addMarkerCharacter( name, true, getString( "fight" ), enemy3 ) ;
	local enemy4ID = addMarkerCharacter( name, true, getString( "fight" ), enemy4 ) ;
	local enemy5ID = addMarkerCharacter( name, true, getString( "fight" ), enemy5 ) ;
	local enemyWall1ID = addMarkerCharacter( name, true, getString( "fight" ), enemyWall1 ) ;
	local enemyWall2ID = addMarkerCharacter( name, true, getString( "fight" ), enemyWall2 ) ;

	while ( 
		isCharacterAlive( enemy1 ) or 
		isCharacterAlive( enemy2 ) or 
		isCharacterAlive( enemy3 ) or 
		isCharacterAlive( enemy4 ) or 
		isCharacterAlive( enemy5 ) ) do
		coroutine.yield( ) ;
	end	
	
	-- make good guards run away if they are still alive
	if ( characterExists( goodGuard1 ) ) then
		addGoalGetToPointInLevel( goodGuard1, -11366, 12612, "france", false, true ) ;
		setMissionChatString( name, goodGuard1, getString( "mr3d3" ) ) ;
		if ( characterExists( enemyWall1 ) ) then
			makeNotEnemies( goodGuard1, enemyWall1 ) ;
		end
		if ( characterExists( enemyWall2 ) ) then
			makeNotEnemies( goodGuard1, enemyWall2 ) ;
		end
	end
	if ( characterExists( goodGuard2 ) ) then
		addGoalGetToPointInLevel( goodGuard2, -11326, 12612, "france", false, true ) ;
		setMissionChatString( name, goodGuard2, getString( "mr3d3" ) ) ;
		if ( characterExists( enemyWall1 ) ) then
			makeNotEnemies( goodGuard2, enemyWall1 ) ;
		end
		if ( characterExists( enemyWall2 ) ) then
			makeNotEnemies( goodGuard2, enemyWall2 ) ;
		end
	end
	if ( characterExists( goodGuard3 ) ) then
		addGoalGetToPointInLevel( goodGuard3, -11396, 12612, "france", false, true ) ;
		setMissionChatString( name, goodGuard3, getString( "mr3d3" ) ) ;
		if ( characterExists( enemyWall1 ) ) then
			makeNotEnemies( goodGuard3, enemyWall1 ) ;
		end
		if ( characterExists( enemyWall2 ) ) then
			makeNotEnemies( goodGuard3, enemyWall2 ) ;
		end
	end
	
	while ( 
		isCharacterAlive( enemyWall1 ) or 
		isCharacterAlive( enemyWall2 ) ) do
		coroutine.yield( ) ;
	end	
	
	if ( characterExists( goodGuard1 ) ) then
		setMissionChatNone( name, goodGuard1 ) ;
	end
	if ( characterExists( goodGuard2 ) ) then
		setMissionChatNone( name, goodGuard2 ) ;
	end
	if ( characterExists( goodGuard3 ) ) then
		setMissionChatNone( name, goodGuard3 ) ;
	end
	
	autoDeleteCharacterOffScreen( goodGuard1 ) ;
	autoDeleteCharacterOffScreen( goodGuard2 ) ;
	autoDeleteCharacterOffScreen( goodGuard3 ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionrochelle4" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle4( name )
	-- Report to d'Essart and get mission where two assasins go with you
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "louisxiii", getString( "mpb34d8" ) ) ;
		
	setInventoryItem( "letter_miladysoldiers1", 0 ) ;

	-- two ambush enemies
	local soldier1 = createTempCharacter( getString( "soldier" ), "france", -8295, 9336 ) ;
	setStatsCalculatorStatic( soldier1, 30, 30, 30, 30 ) ;
	randomDressEnemy( soldier1, 0.0, 9883729 ) ;
	setRangedWeapon( soldier1, "musket_matchlock_1" ) ;
	setAllowPermanentDeath( soldier1, false ) ;
	setHasLootDrop( soldier1, false ) ;
		
	setMissionFaceCharacter( name, "foureau", soldier1 ) ;
	setMissionFaceCharacter( name, soldier1, "foureau" ) ;
		
	local marker = addMarkerCharacter( name, true, getString( "reportessart" ), "essart" ) ;
	waitForTalk( "dartagnan", "essart", false ) ;
	removeMarker( name, marker ) ;	

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "essart", true ) ;
	setIgnoreFreeze( "guardsman9", true ) ;
	setIgnoreFreeze( "guardsman10", true ) ;
	setIgnoreFreeze( "guardsman11", true ) ;
	setIgnoreFreeze( "guardsman12", true ) ;
	setIgnoreFreeze( "foureau", true ) ;
	setIgnoreFreeze( soldier1, true ) ;
	
	setMissionFaceDirection( name, "essart", 1, 0 ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -8241, 9220, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "essart" ) ;
		
	setMissionFaceCharacter( name, "guardsman9", "essart" ) ;
	setMissionFaceCharacter( name, "guardsman10", "essart" ) ;
	setMissionFaceCharacter( name, "guardsman11", "essart" ) ;
	setMissionFaceCharacter( name, "guardsman12", "essart" ) ;
	setMissionFaceCharacter( name, "foureau", "essart" ) ;
	setMissionFaceCharacter( name, soldier1, "essart" ) ;
	
	sayAndWait( "essart", getString( "mr4d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mr4d2" ) ) ;
	
	setMissionFaceCharacter( name, "essart", "foureau" ) ;
	
	sayAndWait( "foureau", getString( "mr4d3" ) ) ;
	
	setMissionFaceCharacter( name, "essart", "dartagnan" ) ;
	
	sayAndWait( "essart", getString( "mr4d4" ) ) ;

	setMissionFaceCharacter( name, "dartagnan", "foureau" ) ;
	setMissionFaceCharacter( name, "foureau", "dartagnan" ) ;
	setMissionFaceCharacter( name, soldier1, "dartagnan" ) ;

	sayAndWait( "dartagnan", getString( "mr4d5" ) ) ;
	
	setMissionFaceNone( name, "guardsman9" ) ;
	setMissionFaceNone( name, "guardsman10" ) ;
	setMissionFaceNone( name, "guardsman11" ) ;
	setMissionFaceNone( name, "guardsman12" ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "essart", false ) ;
	setIgnoreFreeze( "guardsman9", false ) ;
	setIgnoreFreeze( "guardsman10", false ) ;
	setIgnoreFreeze( "guardsman11", false ) ;
	setIgnoreFreeze( "guardsman12", false ) ;
	setIgnoreFreeze( "foureau", false ) ;
	setIgnoreFreeze( soldier1, false ) ;	

	setMissionChatString( name, "essart", getString( "mr4d26" ) ) ;
	setMissionChatString( name, "foureau", getString( "mr4d27" ) ) ;
	setMissionChatString( name, soldier1, getString( "mr4d27" ) ) ;

	setMissionFaceNone( name, "dartagnan" ) ;
	setMissionFaceCharacter( name, "foureau", "dartagnan" ) ;
	setMissionFaceCharacter( name, soldier1, "dartagnan" ) ;

	local overrideSaveID = createOverrideSavePos( "france", -8346, 9490 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -10576, 10218, -8229, 11819 } ) ;

	local foureauDest1X = -8972 ;
	local foureauDest1Y = 11119 ;
	local foureauDest2X = -9297 ;
	local foureauDest2Y = 11148 ;
	
	local soldier1Dest1X = -8979 ;
	local soldier1Dest1Y = 11168 ;
	local soldier1Dest2X = -9575 ;
	local soldier1Dest2Y = 11154 ;

	addGoalGetToPointInLevel( "foureau", foureauDest1X, foureauDest1Y, "france", false, true ) ;
	addGoalGetToPointInLevel( "foureau", foureauDest2X, foureauDest2Y, "france", false, true ) ;
	
	addGoalGetToPointInLevel( soldier1, soldier1Dest1X, soldier1Dest1Y, "france", false, true ) ;
	addGoalGetToPointInLevel( soldier1, soldier1Dest2X, soldier1Dest2Y, "france", false, true ) ;

	-- go to Bastion (once we get there, soldiers attack dart)
	local markerPosX = -9418 ;
	local markerPosY = 11154 ;
	local marker = addMarkerPosition( name, true, getString( "mr4m1" ), "france", markerPosX, markerPosY ) ;
	
	local triggerArea = addTriggerArea( name, "", false, "france", { -9850, 11051, -9059, 11272 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	local tenseMusicID = addMusic( "tense", 15 ) ;

	removeMarker( name, marker ) ;
	removeTriggerArea( triggerArea ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "foureau", true ) ;
	setIgnoreFreeze( soldier1, true ) ;

	setMissionFaceDirection( name, "dartagnan", -1, 0 ) ;
	setMissionFaceDirection( name, "foureau", -1, 0 ) ;
	setMissionFaceDirection( name, soldier1, -1, 0 ) ;

	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", markerPosX, markerPosY, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	-- if soldiers are far away, skip there positions closer so that we don't have to wait for them
	if ( not isCharacterOnScreen( "foureau" ) ) then
		clearGoals( "foureau" ) ;
		placeCharacter( "foureau", "france", foureauDest1X, foureauDest1Y ) ;
		addGoalGetToPointInLevel( "foureau", foureauDest2X, foureauDest2Y, "france", false, true ) ;
	end

	if ( not isCharacterOnScreen( soldier1 ) ) then
		clearGoals( soldier1 ) ;
		placeCharacter( soldier1, "france", soldier1Dest1X, soldier1Dest1Y ) ;
		addGoalGetToPointInLevel( soldier1, soldier1Dest2X, soldier1Dest2Y, "france", false, true ) ;
	end

	waitForNoGoal( "foureau" ) ;
	waitForNoGoal( soldier1 ) ;

	-- create rochelais on wall
	local enemyWall1 = createTempCharacter( getString( "rochellais" ), "france", -10300, 10900 ) ;
	setStatsCalculatorStatic( enemyWall1, 30, 22, 30, 34 ) ;
	randomDressRochellais( enemyWall1, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( enemyWall1, "musket_matchlock_1" ) ;
	setRangedAttackDist( enemyWall1, 500 ) ; -- shoot from just offscreen
	loadRanged( enemyWall1 ) ;
	setMissionFaceDirection( name, enemyWall1, 1, 0 ) ;
	setHasLootDrop( enemyWall1, false ) ;
	setLockRangedStill( enemyWall1, true ) ;
	
	local enemyWall2 = createTempCharacter( getString( "rochellais" ), "france", -10300, 11000 ) ;
	setStatsCalculatorStatic( enemyWall2, 30, 22, 30, 34 ) ;
	randomDressRochellais( enemyWall2, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( enemyWall2, "musket_matchlock_1" ) ;
	setRangedAttackDist( enemyWall2, 500 ) ; -- shoot from just offscreen
	loadRanged( enemyWall2 ) ;
	setMissionFaceDirection( name, enemyWall2, 1, 0 ) ;
	setHasLootDrop( enemyWall2, false ) ;
	setLockRangedStill( enemyWall2, true ) ;
	
	local enemyWall3 = createTempCharacter( getString( "rochellais" ), "france", -10300, 11100 ) ;
	setStatsCalculatorStatic( enemyWall3, 30, 22, 30, 34 ) ;
	randomDressRochellais( enemyWall3, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( enemyWall3, "musket_matchlock_1" ) ;
	setRangedAttackDist( enemyWall3, 500 ) ; -- shoot from just offscreen
	loadRanged( enemyWall3 ) ;
	setMissionFaceDirection( name, enemyWall3, 1, 0 ) ;
	setHasLootDrop( enemyWall3, false ) ;
	setLockRangedStill( enemyWall3, true ) ;
	
	local enemyWall4 = createTempCharacter( getString( "rochellais" ), "france", -10300, 11200 ) ;
	setStatsCalculatorStatic( enemyWall4, 30, 30, 30, 30 ) ;
	randomDressRochellais( enemyWall4, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( enemyWall4, "musket_matchlock_1" ) ;
	setRangedAttackDist( enemyWall4, 500 ) ; -- shoot from just offscreen
	loadRanged( enemyWall4 ) ;
	setMissionFaceDirection( name, enemyWall4, 1, 0 ) ;
	setHasLootDrop( enemyWall4, false ) ;
	setLockRangedStill( enemyWall4, true ) ;
	
	local enemyWall5 = createTempCharacter( getString( "rochellais" ), "france", -10300, 11300 ) ;
	setStatsCalculatorStatic( enemyWall5, 30, 30, 30, 30 ) ;
	randomDressRochellais( enemyWall5, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( enemyWall5, "musket_matchlock_1" ) ;
	setRangedAttackDist( enemyWall5, 500 ) ; -- shoot from just offscreen
	loadRanged( enemyWall5 ) ;
	setMissionFaceDirection( name, enemyWall5, 1, 0 ) ;
	setHasLootDrop( enemyWall5, false ) ;
	setLockRangedStill( enemyWall5, true ) ;	
	
	setIgnoreFreeze( enemyWall1, true ) ;
	setIgnoreFreeze( enemyWall2, true ) ;
	setIgnoreFreeze( enemyWall3, true ) ;
	setIgnoreFreeze( enemyWall4, true ) ;
	setIgnoreFreeze( enemyWall5, true ) ;
		

	sayAndWait( "dartagnan", getString( "mr4d6" ) ) ;
	
	-- pan camera over
	stopCameraFollowCharacter( ) ;
	local panSpeed = 800 ;
	panCameraToWait( -10297, 11047, panSpeed, true ) ;
	wait( 2 ) ;	

	panCameraToWait( markerPosX, markerPosY, panSpeed, true ) ;

	sayAndWait( "dartagnan", getString( "mr4d7" ) ) ;
	
	setMissionFaceCharacter( name, "foureau", "dartagnan" ) ;
	setMissionFaceCharacter( name, soldier1, "dartagnan" ) ;
	sayAndWait( soldier1, getString( "mr4d8" ) ) ;
	
	addGoalGetToPointInLevel( soldier1, -9768, 11155, "france", false, true ) ;
	addGoalGetToPointInLevel( "foureau", -9137, 11152, "france", false, true ) ;
	waitForNoGoal( soldier1 ) ;
	
	removeMusic( tenseMusicID ) ;
	local combatMusicID = addMusic( "combat", 15 ) ;
		
	-- soldiers discharge weapons at d'Artagnan
	setRangedAttackDist( soldier1, 400 ) ;
	loadRanged( soldier1 ) ;
	makeEnemies( "dartagnan", soldier1 ) ;

	wait( 0.2 ) ;
	waitForNoGoal( "foureau" ) ;

	removeMeleeWeapon( "foureau" ) ;
	setRangedAttackDist( "foureau", 400 ) ;
	loadRanged( "foureau" ) ;
	makeEnemies( "dartagnan", "foureau" ) ;

	wait( 2 ) ;

	makeNotEnemies( "dartagnan", "foureau", soldier1 ) ;
	setStateMessageIdle( "dartagnan" ) ;
	setStateMessageIdle( "foureau" ) ;
	setStateMessageIdle( soldier1 ) ;
	
	setMeleeWeapon( "foureau", "sword_12" ) ;
	
	if ( not isCharacterAlive( "dartagnan" ) ) then
		wait( 10000 ) ; -- dart just died
	end
		
	sayAndWait( "dartagnan", getString( "mr4d9" ) ) ;
	sayAndWait( soldier1, getString( "mr4d10" ) ) ;

	--setWalkSpeed( soldier1, 120 ) ;
	--wait( 0.75 ) ;


	setIgnoreAll( soldier1, true ) ;

	addGoalGetToPointInLevel( soldier1, -10115, 11133, "france", false, true ) ;

	panCameraToWait( -10038, 11075, panSpeed, true ) ;

	wait( 1.5 ) ;
	makeEnemies( soldier1, enemyWall1, enemyWall2, enemyWall3, enemyWall4, enemyWall5 ) ;
	
	while ( isCharacterAlive( soldier1 ) and characterHasGoal( soldier1 ) ) do
		coroutine.yield( ) ;
	end

	takeDamage( soldier1, 200 ) ;
	
	makeNotEnemies( soldier1, enemyWall1, enemyWall2, enemyWall3, enemyWall4, enemyWall5 ) ;
	
	wait( 1 ) ;

	local marker = addMarkerCharacter( name, true, getString( "fight" ), "foureau" ) ;
	
	setCameraFollowCharacter( "dartagnan", true ) ;
	makeEnemies( "dartagnan", "foureau", enemyWall1, enemyWall2, enemyWall3, enemyWall4, enemyWall5 ) ;
	
	removeMusic( combatMusicID ) ;
	
	setContainZone( "foureau", true, -9247, 11150, 300.0 ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "foureau", false ) ;
	setIgnoreFreeze( soldier1, false ) ;
	setIgnoreFreeze( enemyWall1, false ) ;
	setIgnoreFreeze( enemyWall2, false ) ;
	setIgnoreFreeze( enemyWall3, false ) ;
	setIgnoreFreeze( enemyWall4, false ) ;
	setIgnoreFreeze( enemyWall5, false ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	
	-- kill foureau
	while ( isCharacterAlive( "foureau" ) ) do
		coroutine.yield( ) ;
	end	
	
	makeNotEnemies( "dartagnan", "foureau" ) ;
	
	setContainZone( "foureau", false ) ;
	
	-- marker gets removed on death - re-add
	removeMarker( name, marker ) ; 
	local marker = addMarkerCharacter( name, true, getString( "fight" ), "foureau" ) ;
	
	-- player needs to be close to foureau
	while ( distanceBetweenCharacters( "dartagnan", "foureau" ) > 150.0 ) do
		coroutine.yield( ) ;
	end
		
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "foureau", true ) ;
	
	
	local tenseLocalMusicID = addLocalMusicInner( "tense", "france", -10279, 10870, -8914, 11390, 15 ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "foureau" ) ;
	setMissionFaceCharacter( name, "foureau", "dartagnan" ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	
	wait( 2 ) ;
	
	giveHealth( "foureau", 20 ) ;
	reviveCharacter( "foureau" ) ;

	setMissionChatFunction( name, "foureau", "chat_mr4d28" ) ;

	wait( 0.5 ) ;
	
	sayAndWait( "foureau", getString( "mr4d11" ) ) ;
	sayAndWait( "dartagnan", getString( "mr4d12" ) ) ;
	sayAndWait( "foureau", getString( "mr4d13" ) ) ;
	sayAndWait( "dartagnan", getString( "mr4d14" ) ) ;
	sayAndWait( "foureau", getString( "mr4d15" ) ) ;
	sayAndWait( "dartagnan", getString( "mr4d16" ) ) ;
	sayAndWait( "foureau", getString( "mr4d17" ) ) ;
	sayAndWait( "dartagnan", getString( "mr4d18" ) ) ;

	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "foureau", false ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	
	-- go get letter
	local soldierX, soldierY = getCharacterPos( soldier1 ) ;
	createItem( "ms1", "letter_miladysoldiers1", "france", soldierX, soldierY, false ) ;
	
	addMarkerPickUp( name, true, getString( "mr4m2" ), "ms1" ) ;

	setRangedLoadedRatio( enemyWall1, 0.99 ) ;
	setRangedLoadedRatio( enemyWall2, 0.95 ) ;
	setRangedLoadedRatio( enemyWall3, 0.9 ) ;
	setRangedLoadedRatio( enemyWall4, 0.7 ) ;
	setRangedLoadedRatio( enemyWall5, 0.5 ) ;

	while ( numOfItemType( "letter_miladysoldiers1" ) < 1 ) do
		coroutine.yield( ) ;
	end
	
	local marker = addMarkerCharacter( name, true, getString( "mr4m3" ), "foureau" ) ;
	waitForTalk( "dartagnan", "foureau", false ) ;
	removeMarker( name, marker ) ;
	
	removeLocalMusic( "france", tenseLocalMusicID ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "foureau", true ) ;
	
	sayAndWait( "dartagnan", getString( "mr4d19" ) ) ;
	sayAndWait( "dartagnan", getString( "mr4d20" ) ) ;
	sayAndWait( "foureau", getString( "mr4d21" ) ) ;
	sayAndWait( "dartagnan", getString( "mr4d22" ) ) ;
	sayAndWait( "foureau", getString( "mr4d23" ) ) ;
	sayAndWait( "dartagnan", getString( "mr4d24" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mr4d25" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "foureau", false ) ;
	
	autoDeleteCharacterOffScreen( soldier1 ) ;
	
	deleteTempCharacter( enemyWall1 ) ;
	deleteTempCharacter( enemyWall2 ) ;
	deleteTempCharacter( enemyWall3 ) ;
	deleteTempCharacter( enemyWall4 ) ;
	deleteTempCharacter( enemyWall5 ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionrochelle5" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle5( name )
	-- Get mission from d'Essart to north bastion
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "louisxiii", getString( "mpb34d8" ) ) ;

	setMissionChatString( name, "foureau", getString( "mr4d29" ) ) ;

	-- finished fighting, talking to foureau
	ensureCharacterAroundPoint( "foureau", "france", -9424, 11151, 1300 ) ;
	addGoalGetToPointInLevel( "foureau", -7585, 9106, "france", false, true ) ;
	setMissionFaceCharacter( name, "foureau", "dartagnan" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "reportessart" ), "essart" ) ;
	waitForTalk( "dartagnan", "essart", false ) ;
	removeMarker( name, marker ) ;	

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "essart", true ) ;
	
	setMissionFaceCharacter( name, "essart", "dartagnan" ) ;
	
	sayAndWait( "essart", getString( "mr5d1" ) ) ;
	sayAndWait( "dartagnan", getString( "mr5d2" ) ) ;
	sayAndWait( "essart", getString( "mr5d3" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "essart", false ) ;	
	
	clearGoals( "foureau" ) ;
	
	completeMission( name ) ;
	activateMission( "missionrochelle6" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle6( name )
	-- Fight at the northern Bastion
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "louisxiii", getString( "mpb34d8" ) ) ;
		
	setMissionChatString( name, "foureau", getString( "mr4d29" ) ) ;
	setMissionChatString( name, "essart", getString( "mr5d4" ) ) ;
	
	local overrideSaveID = createOverrideSavePos( "france", -11070, 8538 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -13428, 7413, -10388, 9222 } ) ;
	
	-- enemy1
	local enemy1 = createTempCharacter( getString( "rochellais" ), "france", -12004, 8166 ) ;
	setStatsCalculatorStatic( enemy1, 32, 32, 32, 32 ) ;
	randomDressRochellais( enemy1, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy1, "sword_1" ) ;

	local enemy2 = createTempCharacter( getString( "rochellais" ), "france", -12110, 8205 ) ;
	setStatsCalculatorStatic( enemy2, 32, 32, 32, 32 ) ;
	randomDressRochellais( enemy2, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy2, "sword_1" ) ;

	local enemy3 = createTempCharacter( getString( "rochellais" ), "france", -11951, 8207 ) ;
	setStatsCalculatorStatic( enemy3, 32, 32, 32, 32 ) ;
	randomDressRochellais( enemy3, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy3, "sword_1" ) ;

	local enemy4 = createTempCharacter( getString( "rochellais" ), "france", -11911, 8276 ) ;
	setStatsCalculatorStatic( enemy4, 32, 32, 32, 32 ) ;
	randomDressRochellais( enemy4, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy4, "sword_1" ) ;

	local enemy5 = createTempCharacter( getString( "rochellais" ), "france", -11857, 8119 ) ;
	setStatsCalculatorStatic( enemy5, 32, 32, 32, 32 ) ;
	randomDressRochellais( enemy5, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy5, "sword_1" ) ;
	
	local enemyWall1 = createTempCharacter( getString( "rochellais" ), "france", -11976, 8396 ) ;
	setStatsCalculatorStatic( enemyWall1, 32, 24, 32, 36 ) ;
	randomDressRochellais( enemyWall1, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( enemyWall1, "musket_matchlock_1" ) ;
	setRangedAttackDist( enemyWall1, 300 ) ; -- shoot from just offscreen
	setRangedLoadedRatio( enemyWall1, 0.9 ) ;
	setBaseFaceCharacter( enemyWall1, "dartagnan" ) ;
	setHasLootDrop( enemyWall1, false ) ;
	setBreadcrumbToPos( enemyWall1, -11976, 8300 ) ;
	setLockRangedStill( enemyWall1, true ) ;
		
	local enemyWall2 = createTempCharacter( getString( "rochellais" ), "france", -11765, 8396 ) ;
	setStatsCalculatorStatic( enemyWall2, 32, 24, 32, 36 ) ;
	randomDressRochellais( enemyWall2, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( enemyWall2, "musket_matchlock_1" ) ;
	setRangedAttackDist( enemyWall2, 300 ) ; -- shoot from just offscreen
	setRangedLoadedRatio( enemyWall2, 0.9 ) ;
	setBaseFaceCharacter( enemyWall2, "dartagnan" ) ;
	setHasLootDrop( enemyWall2, false ) ;
	setBreadcrumbToPos( enemyWall2, -11765, 8300 ) ;
	setLockRangedStill( enemyWall2, true ) ;
		
	local goodGuard1 = createTempCharacter( getString( "guardsman" ), "france", -11684, 8183 ) ;
	setStatsCalculatorStatic( goodGuard1, 32, 32, 32, 32 ) ;
	randomDressGuardsman( goodGuard1, 0.0, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( goodGuard1, "musket_matchlock_1" ) ;
	setMeleeWeapon( goodGuard1, "sword_1" ) ;
	loadRanged( goodGuard1 ) ;
	setRangedAttackDist( goodGuard1, 300 ) ;
	
	local goodGuard2 = createTempCharacter( getString( "guardsman" ), "france", -11667, 8166 ) ;
	setStatsCalculatorStatic( goodGuard2, 32, 32, 32, 32 ) ;
	randomDressGuardsman( goodGuard2, 0.0, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( goodGuard2, "musket_matchlock_1" ) ;
	setMeleeWeapon( goodGuard2, "sword_1" ) ;
	loadRanged( goodGuard2 ) ;
	setRangedAttackDist( goodGuard2, 300 ) ;
	
	local goodGuard3 = createTempCharacter( getString( "guardsman" ), "france", -11616, 8276 ) ;
	setStatsCalculatorStatic( goodGuard3, 32, 32, 32, 32 ) ;
	randomDressGuardsman( goodGuard3, 0.0, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( goodGuard3, "musket_matchlock_1" ) ;
	setMeleeWeapon( goodGuard3, "sword_1" ) ;
	loadRanged( goodGuard3 ) ;
	setRangedAttackDist( goodGuard3, 300 ) ;
	
	local marker = addMarkerPosition( name, true, getString( "mr6m1" ), "france", -11859, 8204 ) ;
	
	-- trigger in front of Aramis' place
	local triggerArea = addTriggerArea( name, "", false, "france", { -12468, 7925, -11413, 8402 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;
	
	makeEnemies( "dartagnan", enemy1, enemy2, enemy3, enemy4, enemy5, enemyWall1, enemyWall2 ) ;
	makeEnemies( goodGuard1, enemy1, enemy2, enemy3, enemy4, enemy5, enemyWall1, enemyWall2 ) ;
	makeEnemies( goodGuard2, enemy1, enemy2, enemy3, enemy4, enemy5, enemyWall1, enemyWall2 ) ;
	makeEnemies( goodGuard3, enemy1, enemy2, enemy3, enemy4, enemy5, enemyWall1, enemyWall2 ) ;

	local enemy1ID = addMarkerCharacter( name, true, getString( "fight" ), enemy1 ) ;
	local enemy2ID = addMarkerCharacter( name, true, getString( "fight" ), enemy2 ) ;
	local enemy3ID = addMarkerCharacter( name, true, getString( "fight" ), enemy3 ) ;
	local enemy4ID = addMarkerCharacter( name, true, getString( "fight" ), enemy4 ) ;
	local enemy5ID = addMarkerCharacter( name, true, getString( "fight" ), enemy5 ) ;
	local enemyWall1ID = addMarkerCharacter( name, true, getString( "fight" ), enemyWall1 ) ;
	local enemyWall2ID = addMarkerCharacter( name, true, getString( "fight" ), enemyWall2 ) ;
	
	while ( 
		isCharacterAlive( enemy1 ) or 
		isCharacterAlive( enemy2 ) or 
		isCharacterAlive( enemy3 ) or 
		isCharacterAlive( enemy4 ) or 
		isCharacterAlive( enemy5 ) ) do
		coroutine.yield( ) ;
	end	
	
	-- make good guards run away if they are still alive
	if ( characterExists( goodGuard1 ) ) then
		addGoalGetToPointInLevel( goodGuard1, -10950, 8127, "france", false, true ) ;
		setMissionChatString( name, goodGuard1, getString( "mr3d3" ) ) ;
		if ( characterExists( enemyWall1 ) ) then
			makeNotEnemies( goodGuard1, enemyWall1 ) ;
		end
		if ( characterExists( enemyWall2 ) ) then
			makeNotEnemies( goodGuard1, enemyWall2 ) ;
		end
	end
	if ( characterExists( goodGuard2 ) ) then
		addGoalGetToPointInLevel( goodGuard2, -10975, 8127, "france", false, true ) ;
		setMissionChatString( name, goodGuard2, getString( "mr3d3" ) ) ;
		if ( characterExists( enemyWall1 ) ) then
			makeNotEnemies( goodGuard2, enemyWall1 ) ;
		end
		if ( characterExists( enemyWall2 ) ) then
			makeNotEnemies( goodGuard2, enemyWall2 ) ;
		end
	end
	if ( characterExists( goodGuard3 ) ) then
		addGoalGetToPointInLevel( goodGuard3, -10950, 8175, "france", false, true ) ;
		setMissionChatString( name, goodGuard3, getString( "mr3d3" ) ) ;
		if ( characterExists( enemyWall1 ) ) then
			makeNotEnemies( goodGuard3, enemyWall1 ) ;
		end
		if ( characterExists( enemyWall2 ) ) then
			makeNotEnemies( goodGuard3, enemyWall2 ) ;
		end
	end
	
	while ( 
		isCharacterAlive( enemyWall1 ) or 
		isCharacterAlive( enemyWall2 ) ) do
		coroutine.yield( ) ;
	end	
	
	if ( characterExists( goodGuard1 ) ) then
		setMissionChatNone( name, goodGuard1 ) ;
	end
	if ( characterExists( goodGuard2 ) ) then
		setMissionChatNone( name, goodGuard2 ) ;
	end
	if ( characterExists( goodGuard3 ) ) then
		setMissionChatNone( name, goodGuard3 ) ;
	end
	
	autoDeleteCharacterOffScreen( goodGuard1 ) ;
	autoDeleteCharacterOffScreen( goodGuard2 ) ;
	autoDeleteCharacterOffScreen( goodGuard3 ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionrochelle7" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle7( name )
	-- Planchet has received wine from Musketeers
	-- Just then trumpet plays, procession of Louis and Musketeers comes in 
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "louisxiii", getString( "mpb34d8" ) ) ;
		
	-- get horse out of the way (obstructs view of wine)
	placeVehicle( "planchethorse", "france", -7532, 8927 ) ;
	
	setMissionChatString( name, "foureau", getString( "mr5d6" ) ) ;
	setMissionChatString( name, "essart", getString( "mr5d5" ) ) ;	
	
	setToggleVisElsVisible( "poisonwine1", true ) ;
	setToggleVisElsVisible( "poisonwine2", true ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "checkplanchet" ), "planchet" ) ;
	waitForTalk( "dartagnan", "planchet", false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	
	sayAndWait( "planchet", getString( "mr7d1" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	sayAndWait( "dartagnan", getString( "mr7d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mr7d3" ) ) ;
	
	stopCameraFollowCharacter( ) ;
	panCameraTo( -7549, 9233, 300.0, true ) ;
		
	local noMusicID = addMusic( "none", 15 ) ;
		
	-- fanfare plays
	playSound( "fanfare1", 1.0 ) ;
	
	-- everyone faces
	setIgnoreFreeze( "foureau", true ) ;
	setIgnoreFreeze( "guardsman14", true ) ;
	setIgnoreFreeze( "guardsman13", true ) ;
	setIgnoreFreeze( "guardsman4", true ) ;
	setIgnoreFreeze( "guardsman5", true ) ;
	setIgnoreFreeze( "guardsman6", true ) ;
	
	setMissionFaceDirection( name, "foureau", 0, 1 ) ;
	setMissionFaceDirection( name, "guardsman14", 1, 1 ) ;
	setMissionFaceDirection( name, "guardsman13", 1, 1 ) ;
	setMissionFaceDirection( name, "guardsman4", 1, 1 ) ;
	setMissionFaceDirection( name, "guardsman5", 1, 1 ) ;
	setMissionFaceDirection( name, "guardsman6", 1, 1 ) ;
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	setMissionFaceDirection( name, "planchet", 0, 1 ) ;
	
	-- let fanfare play mostly
	wait( 3 ) ;
	
	removeMusic( noMusicID ) ;
	
	-- king and musketeers come in
	local startX = -7043 ;
	local startY = 9165 ;
	local endX = -8429 ;
	local endY = 9646 ;
	local waitTime = 1.0 ;
	
	local louis = createTempCharacter( getString( "louisxiii" ), "france", startX, startY ) ;
	dress_louisxiiiA( louis ) ;
	addGoalGetToPointInLevel( louis, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( louis, "prochorse1" ) ;
	setIgnoreFreeze( louis, true ) ;
	
	wait( waitTime ) ;
	
	local treville = createTempCharacter( getString( "treville" ), "france", startX, startY ) ;
	dress_treville( treville ) ;
	addGoalGetToPointInLevel( treville, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( treville, "prochorse15" ) ;
	setIgnoreFreeze( treville, true ) ;
	
	wait( waitTime ) ;
	
	local athos = createTempCharacter( getString( "athos" ), "france", startX, startY ) ;
	dress_athosB( athos ) ;
	addGoalGetToPointInLevel( athos, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( athos, "prochorse2" ) ;
	setIgnoreFreeze( athos, true ) ;
	
	wait( waitTime ) ;
	
	local porthos = createTempCharacter( getString( "porthos" ), "france", startX, startY ) ;
	dress_porthosC( porthos ) ;
	addGoalGetToPointInLevel( porthos, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( porthos, "prochorse3" ) ;
	setIgnoreFreeze( porthos, true ) ;
	
	wait( waitTime ) ;
	
	local aramis = createTempCharacter( getString( "aramis" ), "france", startX, startY ) ;
	dress_aramisB( aramis ) ;
	addGoalGetToPointInLevel( aramis, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( aramis, "prochorse4" ) ;
	setIgnoreFreeze( aramis, true ) ;
	
	wait( waitTime ) ;
	
	local musk1 = createTempCharacter( getString( "musketeer" ), "france", startX, startY ) ;
	randomDressMusketeer( musk1, 0.0, randomInt( 0, 99999 ) ) ;
	addGoalGetToPointInLevel( musk1, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( musk1, "prochorse5" ) ;
	setIgnoreFreeze( musk1, true ) ;
	
	wait( waitTime ) ;
	
	local musk2 = createTempCharacter( getString( "musketeer" ), "france", startX, startY ) ;
	randomDressMusketeer( musk2, 0.0, randomInt( 0, 99999 ) ) ;
	addGoalGetToPointInLevel( musk2, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( musk2, "prochorse6" ) ;
	setIgnoreFreeze( musk2, true ) ;
	
	wait( waitTime ) ;
	
	local musk3 = createTempCharacter( getString( "musketeer" ), "france", startX, startY ) ;
	randomDressMusketeer( musk3, 0.0, randomInt( 0, 99999 ) ) ;
	addGoalGetToPointInLevel( musk3, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( musk3, "prochorse7" ) ;
	setIgnoreFreeze( musk3, true ) ;
	
	wait( waitTime ) ;
	
	local musk4 = createTempCharacter( getString( "musketeer" ), "france", startX, startY ) ;
	randomDressMusketeer( musk4, 0.0, randomInt( 0, 99999 ) ) ;
	addGoalGetToPointInLevel( musk4, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( musk4, "prochorse8" ) ;
	setIgnoreFreeze( musk4, true ) ;
	
	wait( waitTime ) ;
	
	local musk5 = createTempCharacter( getString( "musketeer" ), "france", startX, startY ) ;
	randomDressMusketeer( musk5, 0.0, randomInt( 0, 99999 ) ) ;
	addGoalGetToPointInLevel( musk5, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( musk5, "prochorse9" ) ;
	setIgnoreFreeze( musk5, true ) ;
	
	wait( waitTime ) ;
	
	local musk6 = createTempCharacter( getString( "musketeer" ), "france", startX, startY ) ;
	randomDressMusketeer( musk6, 0.0, randomInt( 0, 99999 ) ) ;
	addGoalGetToPointInLevel( musk6, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( musk6, "prochorse10" ) ;
	setIgnoreFreeze( musk6, true ) ;
	
	wait( waitTime ) ;
	
	local musk7 = createTempCharacter( getString( "musketeer" ), "france", startX, startY ) ;
	randomDressMusketeer( musk7, 0.0, randomInt( 0, 99999 ) ) ;
	addGoalGetToPointInLevel( musk7, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( musk7, "prochorse11" ) ;
	setIgnoreFreeze( musk7, true ) ;
	
	wait( waitTime ) ;
	
	local musk8 = createTempCharacter( getString( "musketeer" ), "france", startX, startY ) ;
	randomDressMusketeer( musk8, 0.0, randomInt( 0, 99999 ) ) ;
	addGoalGetToPointInLevel( musk8, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( musk8, "prochorse12" ) ;
	setIgnoreFreeze( musk8, true ) ;
	
	wait( waitTime ) ;
	
	local musk9 = createTempCharacter( getString( "musketeer" ), "france", startX, startY ) ;
	randomDressMusketeer( musk9, 0.0, randomInt( 0, 99999 ) ) ;
	addGoalGetToPointInLevel( musk9, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( musk9, "prochorse13" ) ;
	setIgnoreFreeze( musk9, true ) ;
	
	wait( waitTime ) ;
	
	local musk10 = createTempCharacter( getString( "musketeer" ), "france", startX, startY ) ;
	randomDressMusketeer( musk10, 0.0, randomInt( 0, 99999 ) ) ;
	addGoalGetToPointInLevel( musk10, endX, endY, "france", false, true ) ;
	putCharacterInPlaceOnHorse( musk10, "prochorse14" ) ;
	setIgnoreFreeze( musk10, true ) ;
	
	wait( waitTime ) ;
	
	while ( isCharacterOnScreen( louis )
		or  isCharacterOnScreen( treville )
		or  isCharacterOnScreen( athos )
		or  isCharacterOnScreen( porthos )
		or  isCharacterOnScreen( aramis )
		or  isCharacterOnScreen( musk1 )
		or  isCharacterOnScreen( musk2 )
		or  isCharacterOnScreen( musk3 )
		or  isCharacterOnScreen( musk4 )
		or  isCharacterOnScreen( musk5 )
		or  isCharacterOnScreen( musk6 )
		or  isCharacterOnScreen( musk7 )
		or  isCharacterOnScreen( musk8 )
		or  isCharacterOnScreen( musk9 )
		or  isCharacterOnScreen( musk10 ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	setIgnoreFreeze( "foureau", false ) ;
	setIgnoreFreeze( "guardsman14", false ) ;
	setIgnoreFreeze( "guardsman13", false ) ;
	setIgnoreFreeze( "guardsman4", false ) ;
	setIgnoreFreeze( "guardsman5", false ) ;
	setIgnoreFreeze( "guardsman6", false ) ;
	
	setMissionFaceNone( name, "foureau" ) ;
	setMissionFaceNone( name, "guardsman14" ) ;
	setMissionFaceNone( name, "guardsman13" ) ;
	setMissionFaceNone( name, "guardsman4" ) ;
	setMissionFaceNone( name, "guardsman5" ) ;
	setMissionFaceNone( name, "guardsman6" ) ;
	setMissionFaceNone( name, "dartagnan" ) ;
	setMissionFaceNone( name, "planchet" ) ;
	
	-- cleanup
	removeDriver( "prochorse1", louis ) ;
	removeDriver( "prochorse15", treville ) ;
	removeDriver( "prochorse2", athos ) ;
	removeDriver( "prochorse3", porthos ) ;
	removeDriver( "prochorse4", aramis ) ;
	removeDriver( "prochorse5", musk1 ) ;
	removeDriver( "prochorse6", musk2 ) ;
	removeDriver( "prochorse7", musk3 ) ;
	removeDriver( "prochorse8", musk4 ) ;
	removeDriver( "prochorse9", musk5 ) ;
	removeDriver( "prochorse10", musk6 ) ;
	removeDriver( "prochorse11", musk7 ) ;
	removeDriver( "prochorse12", musk8 ) ;
	removeDriver( "prochorse13", musk9 ) ;
	removeDriver( "prochorse14", musk10 ) ;
	
	placeVehicle( "prochorse1", "france", -30000, 0 ) ;
	placeVehicle( "prochorse15", "france", -30000, 0 ) ;
	placeVehicle( "prochorse2", "france", -30000, 0 ) ;
	placeVehicle( "prochorse3", "france", -30000, 0 ) ;
	placeVehicle( "prochorse4", "france", -30000, 0 ) ;
	placeVehicle( "prochorse5", "france", -30000, 0 ) ;
	placeVehicle( "prochorse6", "france", -30000, 0 ) ;
	placeVehicle( "prochorse7", "france", -30000, 0 ) ;
	placeVehicle( "prochorse8", "france", -30000, 0 ) ;
	placeVehicle( "prochorse9", "france", -30000, 0 ) ;
	placeVehicle( "prochorse10", "france", -30000, 0 ) ;
	placeVehicle( "prochorse11", "france", -30000, 0 ) ;
	placeVehicle( "prochorse12", "france", -30000, 0 ) ;
	placeVehicle( "prochorse13", "france", -30000, 0 ) ;
	placeVehicle( "prochorse14", "france", -30000, 0 ) ;

	clearGoals( louis ) ;
	deleteTempCharacter( louis ) ;
	
	clearGoals( treville ) ;
	deleteTempCharacter( treville ) ;
	
	clearGoals( athos ) ;
	deleteTempCharacter( athos ) ;
	
	clearGoals( porthos ) ;
	deleteTempCharacter( porthos ) ;
	
	clearGoals( aramis ) ;
	deleteTempCharacter( aramis ) ;
	
	clearGoals( musk1 ) ;
	deleteTempCharacter( musk1 ) ;
	
	clearGoals( musk2 ) ;
	deleteTempCharacter( musk2 ) ;
	
	clearGoals( musk3 ) ;
	deleteTempCharacter( musk3 ) ;
	
	clearGoals( musk4 ) ;
	deleteTempCharacter( musk4 ) ;
	
	clearGoals( musk5 ) ;
	deleteTempCharacter( musk5 ) ;
	
	clearGoals( musk6 ) ;
	deleteTempCharacter( musk6 ) ;
	
	clearGoals( musk7 ) ;
	deleteTempCharacter( musk7 ) ;
	
	clearGoals( musk8 ) ;
	deleteTempCharacter( musk8 ) ;
	
	clearGoals( musk9 ) ;
	deleteTempCharacter( musk9 ) ;
	
	clearGoals( musk10 ) ;
	deleteTempCharacter( musk10 ) ;
		
	setCameraFollowCharacter( "dartagnan", true ) ;
			
	completeMission( name ) ;
	activateMission( "missionrochelle8" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function placeServantsRochelle1( name )
	setMissionFaceDirection( name, "grimaud", 0, 1 ) ;
	placeCharacter( "grimaud", "france", -8860, 9718 ) ;
	setMissionFaceCharacter( name, "mousqueton", "bazin" ) ;
	placeCharacter( "mousqueton", "france", -9040, 9685 ) ;
	setMissionFaceCharacter( name, "bazin", "mousqueton" ) ;
	placeCharacter( "bazin", "france", -9000, 9685 ) ;
end

function placeServantsRochelle2( name )
	setMissionFaceCharacter( name, "grimaud", "mousqueton" ) ;
	placeCharacter( "grimaud", "france", -8886, 9717 ) ;
	
	setMissionFaceCharacter( name, "mousqueton", "grimaud" ) ;
	placeCharacter( "mousqueton", "france", -8846, 9717 ) ;
	
	setMissionFaceDirection( name, "bazin", 0, 1 ) ;
	placeCharacter( "bazin", "france", -7378, 9066 ) ;
	putCharacterInPlaceOnHorse( "bazin" ) ;
	
	setMissionFaceDirection( name, "planchet", 0, 1 ) ;
	placeCharacter( "planchet", "france", -7328, 9066 ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
end

function execute_missionrochelle8( name )
	-- Musketeers are here. Go talk to them, wine events play out.
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "foureau", getString( "mr5d6" ) ) ;
	setMissionChatString( name, "planchet", getString( "mr7d4" ) ) ;

	setMissionChatString( name, "bazin", getString( "mr9d72" ) ) ;
	setMissionChatString( name, "mousqueton", getString( "mr9d73" ) ) ;
		
	setToggleVisElsVisible( "poisonwine1", true ) ;
	setToggleVisElsVisible( "poisonwine2", true ) ;
	
	placeCharacter( "athos", "france", -8730, 9630 ) ;
	placeCharacter( "porthos", "france", -8690, 9630 ) ;
	placeCharacter( "aramis", "france", -8710, 9660 ) ;
	
	placeServantsRochelle1( name ) ;
	
	placeCharactersHorseClose( "athos" ) ;
	placeCharactersHorseClose( "porthos" ) ;
	placeCharactersHorseClose( "aramis" ) ;
	
	setMissionFaceDirection( name, "athos", 1, 0 ) ;
	setMissionFaceDirection( name, "porthos", -1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "speakmusk" ), "athos" ) ;
	waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
	removeMarker( name, marker ) ;

	local tenseLocalMusicID = addLocalMusicInner( "tense", "france", -9224, 8971, -7320, 9865, 15 ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;

	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	
	sayAndWait( "dartagnan", getString( "mr8d1" ) ) ;
	sayAndWait( "athos", getString( "mr8d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mr8d3" ) ) ;
	sayAndWait( "athos", getString( "mr8d4" ) ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	sayAndWait( "porthos", getString( "mr8d5" ) ) ;

	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	sayAndWait( "aramis", getString( "mr8d6" ) ) ;
	sayAndWait( "dartagnan", getString( "mr8d7" ) ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	
	-- get horse out of the way (obstructs view of wine)
	placeVehicle( "planchethorse", "france", -7532, 8927 ) ;
		
	-- go over to planchet and foureau, foureau dies
	-- wine bottles moves over to foureau
	setToggleVisElsVisible( "poisonwine2", false ) ;
	setToggleVisElsVisible( "poisonwine3", true ) ;

	-- planchet's horse always getting in way
	placeVehicle( "planchethorse", "france", -7322, 9078 ) ;

	addGoalDriveVehicle( "athos", getCharacterOwnedHorseName( "athos" ), true ) ;
	addGoalGetToPointInLevel( "athos", -7670, 9300, "france", true, true ) ;
	
	addGoalDriveVehicle( "porthos", getCharacterOwnedHorseName( "porthos" ), true ) ;
	addGoalGetToPointInLevel( "porthos", -7610, 9300, "france", true, true ) ;
	
	addGoalDriveVehicle( "aramis", getCharacterOwnedHorseName( "aramis" ), true ) ;
	addGoalGetToPointInLevel( "aramis", -7550, 9300, "france", true, true ) ;

	local markerPosX = -7609 ;
	local markerPosY = 9100 ;
	local marker = addMarkerPosition( name, true, getString( "mr8m1" ), "france", markerPosX, markerPosY ) ;

	local triggerArea = addTriggerArea( name, "", false, "france", { -7729, 9067, -7496, 9350 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	setIgnoreFreeze( "foureau", true ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, -1 ) ;
	setMissionFaceDirection( name, "athos", 0, -1 ) ;
	setMissionFaceDirection( name, "porthos", 0, -1 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -7609, 9225, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	if ( ( not isCharacterOnScreen( "athos" ) ) and
		( not isCharacterOnScreen( "porthos" ) ) and
		( not isCharacterOnScreen( "aramis" ) ) ) then
		-- musketeers are all offscreen, for closer
		clearGoals( "athos" ) ;
		clearGoals( "porthos" ) ;
		clearGoals( "aramis" ) ;
		placeCharacter( "athos", "france", -8075, 9496 ) ;
		placeCharacter( "porthos", "france", -8075, 9496 ) ;
		placeCharacter( "aramis", "france", -8075, 9496 ) ;
		putCharacterInPlaceOnHorse( "athos" ) ;
		putCharacterInPlaceOnHorse( "porthos" ) ;
		putCharacterInPlaceOnHorse( "aramis" ) ;
		addGoalGetToPointInLevel( "athos", -7670, 9300, "france", true, true ) ;
		addGoalGetToPointInLevel( "porthos", -7610, 9300, "france", true, true ) ;
		addGoalGetToPointInLevel( "aramis", -7550, 9300, "france", true, true ) ;
	end

	sayAndWait( "foureau", getString( "mr8d8" ) ) ;
	sayAndWait( "dartagnan", getString( "mr8d9" ) ) ;
	sayAndWait( "foureau", getString( "mr8d10" ) ) ;
	sayAndWait( "dartagnan", getString( "mr8d11" ) ) ;
	sayAndWait( "foureau", getString( "mr8d12" ) ) ;
	
	-- walk forward before dying (so he doesn't get drawn under tent when dying)
	addGoalGetToPointInLevel( "foureau", -7553, 9149, "france", false, true ) ;
	waitForNoGoal( "foureau" ) ;
	
	-- play death animation - make him fall to right down
	faceDirection( "foureau", 1, 1 ) ;
	setMissionFaceDirection( name, "foureau", 1, 1 ) ;
	takeDamage( "foureau", 150 ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	
	wait( 2 ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	
	sayAndWait( "aramis", getString( "mr8d13" ) ) ;
	sayAndWait( "dartagnan", getString( "mr8d14" ) ) ;
	sayAndWait( "dartagnan", getString( "mr8d15" ) ) ;
	sayAndWait( "dartagnan", getString( "mr8d16" ) ) ;
	sayAndWait( "athos", getString( "mr8d17" ) ) ;
	sayAndWait( "porthos", getString( "mr8d18" ) ) ;
	sayAndWait( "aramis", getString( "mr8d19" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mr8d20" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	sayAndWait( "porthos", getString( "mr8d21" ) ) ;
	sayAndWait( "dartagnan", getString( "mr8d22" ) ) ;
	sayAndWait( "porthos", getString( "mr8d23" ) ) ;
	
	removeLocalMusic( "france", tenseLocalMusicID ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	setIgnoreFreeze( "foureau", false ) ;
		
	completeMission( name ) ;
	activateMission( "missionrochelle9" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle9( name )
	-- Go to tavern, but meet Cardinal on way, escort him, overhear Milady, Athos get note, etc.
	DEBUG_OUTPUT( name .. " started" ) ;
	
	placeServantsRochelle1( name ) ;
	
	lockPlayerInPlace( ) ;
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	
	placeCharacter( "cardinal", "france", -6815, 10025 ) ;
	setMissionFaceDirection( name, "cardinal", 0, 1 ) ;
	putCharacterInPlaceOnHorse( "cardinal", "cardhorse1" ) ;
	
	setMissionFaceCharacter( name, "milady", "cardinal" ) ;
	placeCharacter( "milady", "colombierrougehouse2", -213, -44 ) ;
	
	ensureCharacterAroundPoint( "athos", "france", -7670, 9300, 600 ) ;
	ensureCharacterAroundPoint( "porthos", "france", -7610, 9300, 600 ) ;
	ensureCharacterAroundPoint( "aramis", "france", -7550, 9300, 600 ) ;
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "porthos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;
	
	setCameraFollowCharacter( "athos", true ) ;
	
	setMissionFaceDirection( name, "athos", 0, 1 ) ;
	setMissionFaceDirection( name, "porthos", 0, 1 ) ;
	setMissionFaceDirection( name, "aramis", 0, 1 ) ;

	local markerPosX = -6817 ;
	local markerPosY = 10055 ;
	
	addGoalGetToPointInLevel( "athos", markerPosX, markerPosY, "france", true, true ) ;
	wait( 0.5 ) ;
	addGoalGetToPointInLevel( "porthos", -6791, 9962, "france", true, true ) ;
	wait( 0.5 ) ;
	addGoalGetToPointInLevel( "aramis", -6846, 9933, "france", true, true ) ;
		
	local darkForestWeather = addWeatherSpot( "france", markerPosX, markerPosY, 500.0 ) ;
	setWeatherSpotDark( darkForestWeather, 0.0, 0.0, 0.0, 0.3 ) ;
	
	coroutine.yield( ) ; -- let sprite pos be in right place so onScreen doesn't get triggered too soon
	
	while ( not isCharacterOnScreen( "cardinal" ) ) do
		coroutine.yield( ) ;
	end
	DEBUG_OUTPUT( "cardinal on screen" ) ;
	
	setMissionFaceDirection( name, "cardinal", 0, -1 ) ;
	addGoalGetToPointInLevel( "cardinal", -6824, 10296, "france", true, true ) ;
		
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "cardinal" ) ;
	
	local tenseMusicID = addMusic( "tense", 15 ) ;
		
	sayAndWait( "athos", getString( "mr9d1" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d2" ) ) ;
	sayAndWait( "athos", getString( "mr9d3" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d4" ) ) ;
	sayAndWait( "athos", getString( "mr9d5" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d6" ) ) ;
	sayAndWait( "athos", getString( "mr9d7" ) ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	setMissionFaceNone( name, "athos" ) ;
	setMissionFaceNone( name, "porthos" ) ;
	setMissionFaceNone( name, "aramis" ) ;
	setMissionFaceNone( name, "cardinal" ) ;
	
	setMissionFaceCharacter( name, "athos", "cardinal" ) ;
	setMissionFaceCharacter( name, "porthos", "cardinal" ) ;
	setMissionFaceCharacter( name, "aramis", "cardinal" ) ;
	setMissionFaceCharacter( name, "cardinal", "athos" ) ;
	
	addGoalGetToPointInLevel( "athos", -6634, 11088, "france", true, true ) ;
	addGoalGetToPointInLevel( "porthos", -6656, 10990, "france", true, true ) ;
	addGoalGetToPointInLevel( "aramis", -6772, 11079, "france", true, true ) ;
	addGoalGetToPointInLevel( "cardinal", -6770, 10992, "france", true, true ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "cardinal" ) ;
	
	addGoalGetToPointInLevel( "athos", -6138, 11154, "france", true, true ) ;
	addGoalGetToPointInLevel( "porthos", -6198, 11154, "france", true, true ) ;
	addGoalGetToPointInLevel( "aramis", -6258, 11154, "france", true, true ) ;
	addGoalGetToPointInLevel( "cardinal", -6284, 11055, "france", true, true ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "cardinal" ) ;

	setMissionFaceDirection( name, "cardinal", -1, 0 ) ;
	setMissionFaceDirection( name, "athos", 1, 0 ) ;
	setMissionFaceDirection( name, "porthos", 1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 1, 0 ) ;	

	addGoalGetToPointInLevel( "cardinal", -122, -20, "colombierrougehouse", false, true ) ;
	addGoalGetToPointInLevel( "athos", -182, -20, "colombierrougehouse", false, true ) ;
	addGoalGetToPointInLevel( "porthos", -210, -35, "colombierrougehouse", false, true ) ;
	addGoalGetToPointInLevel( "aramis", -210, -5, "colombierrougehouse", false, true ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "cardinal" ) ;
			
	sayAndWait( "cardinal", getString( "mr9d8" ) ) ;
	
	setMissionFaceCharacter( name, "cardinal", "milady" ) ;
	addGoalGetToPointInLevel( "cardinal", -173, -44, "colombierrougehouse2", false, true ) ;
	
	wait( 3 ) ;
	
	setMissionFaceDirection( name, "athos", -1, 0 ) ;
		
	sayAndWait( "porthos", getString( "mr9d9" ) ) ;
	sayAndWait( "athos", getString( "mr9d10" ) ) ;
	sayAndWait( "porthos", getString( "mr9d11" ) ) ;

	setMissionFaceDirection( name, "porthos", 0, -1 ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	setMissionFaceCharacter( name, "aramis", "porthos" ) ;
	addGoalGetToPointInLevel( "porthos", -205, -52, "colombierrougehouse", false, true ) ;
	waitForNoGoal( "porthos" ) ;

	sayAndWait( "porthos", getString( "mr9d12" ) ) ;
	
	setMissionFaceDirection( name, "aramis", 1, -1 ) ;
	setMissionFaceDirection( name, "athos", -1, -1 ) ;
	addGoalGetToPointInLevel( "aramis", -230, -52, "colombierrougehouse", false, true ) ;
	addGoalGetToPointInLevel( "athos", -180, -52, "colombierrougehouse", false, true ) ;

	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "athos" ) ;
	
	wait( 1 ) ;

	sayAndWait( "athos", getString( "mr9d13" ) ) ;
	
	removeMusic( tenseMusicID ) ;
	local tenseMusicID = addMusic( "extratense", 15 ) ;
		
	-- fade to black	
	local fadeTime = 0.25 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	clearGoals( "cardinal" ) ;
	placeCharacter( "cardinal", "colombierrougehouse2", -173, -44 ) ;
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "colombierrougehouse2" ) ;
	setCameraTo( -193, -44 ) ;
	
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end	

	sayAndWait( "cardinal", getString( "mr9d14" ) ) ;
	sayAndWait( "milady", getString( "mr9d15" ) ) ;

	-- fade to black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setActiveLevel( "colombierrougehouse" ) ;
	setCameraTo( -203, -47 ) ;

	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end	

	sayAndWait( "athos", getString( "mr9d16" ) ) ;

	-- fade to black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setActiveLevel( "colombierrougehouse2" ) ;
	setCameraTo( -193, -44 ) ;

	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end	

	sayAndWait( "cardinal", getString( "mr9d17" ) ) ;
	sayAndWait( "milady", getString( "mr9d18" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d19" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d20" ) ) ;
	sayAndWait( "milady", getString( "mr9d21" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d22" ) ) ;
	sayAndWait( "milady", getString( "mr9d23" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d24" ) ) ;
	sayAndWait( "milady", getString( "mr9d25" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d26" ) ) ;
	sayAndWait( "milady", getString( "mr9d27" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d28" ) ) ;
	sayAndWait( "milady", getString( "mr9d29" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d30" ) ) ;
	sayAndWait( "milady", getString( "mr9d31" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d32" ) ) ;
	sayAndWait( "milady", getString( "mr9d33" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d34" ) ) ;
	sayAndWait( "milady", getString( "mr9d35" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d36" ) ) ;
	sayAndWait( "milady", getString( "mr9d37" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d38" ) ) ;
	
	setMissionFaceDirection( name, "cardinal", 0, -1 ) ;
	addGoalGetToPointInLevel( "cardinal", -249, -27, "colombierrougehouse2", false, true ) ;
	waitForNoGoal( "cardinal" ) ;
	wait( 0.5 ) ;
	
	playSound( "writing", 1.0 ) ;
	sayAndWait( "cardinal", getString( "mr9d39" ) ) ;
	
	-- fade to black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setActiveLevel( "colombierrougehouse" ) ;
	setCameraTo( -119, 66 ) ;

	removeMusic( tenseMusicID ) ;
	local tenseMusicID = addMusic( "tense", 15 ) ;			

	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end	
	
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	setMissionFaceCharacter( name, "porthos", "athos" ) ;
	setMissionFaceCharacter( name, "aramis", "aramis" ) ;
	sayAndWait( "athos", getString( "mr9d40" ) ) ;
		
	-- send Athos to hide outside
	setMissionFaceDirection( name, "athos", 0, 1 ) ;
	addGoalGetToLevel( "athos", "france", false, true ) ;
	addGoalDriveVehicle( "athos", getCharacterOwnedHorseName( "athos" ), true ) ;
	addGoalGetToPointInLevel( "athos", -6013, 10948, "france", true, true ) ;
	
	wait( 5 ) ;
	
	-- bring Cardinal downstairs
	placeCharacterInDoor( "cardinal", "colombierrougedown", false ) ;
	
	setMissionFaceDirection( name, "cardinal", -1, 0 ) ;
	setMissionFaceDirection( name, "porthos", 1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 1, 0 ) ;
	
	addGoalGetToPointInLevel( "cardinal", -122, -20, "colombierrougehouse", false, true ) ;
	addGoalGetToPointInLevel( "porthos", -210, -35, "colombierrougehouse", false, true ) ;
	addGoalGetToPointInLevel( "aramis", -210, -5, "colombierrougehouse", false, true ) ;
	
	waitForNoGoal( "cardinal" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	
	sayAndWait( "cardinal", getString( "mr9d41" ) ) ;
	sayAndWait( "aramis", getString( "mr9d42" ) ) ;
	sayAndWait( "cardinal", getString( "mr9d43" ) ) ;
	
	-- cardinal, porthos and aramis go off
	setMissionFaceDirection( name, "cardinal", 0, 1 ) ;
	addGoalGetToLevel( "cardinal", "france", false, true ) ;
	addGoalDriveVehicle( "cardinal", "cardhorse1", true ) ;
	addGoalGetToPointInLevel( "cardinal", -6867, 9717, "france", true, true ) ;

	setMissionFaceDirection( name, "porthos", 0, 1 ) ;
	addGoalGetToLevel( "porthos", "france", false, true ) ;
	addGoalDriveVehicle( "porthos", getCharacterOwnedHorseName( "porthos" ), true ) ;
	addGoalGetToPointInLevel( "porthos", -6840, 9805, "france", true, true ) ;

	setMissionFaceDirection( name, "aramis", 0, 1 ) ;
	addGoalGetToLevel( "aramis", "france", false, true ) ;
	addGoalDriveVehicle( "aramis", getCharacterOwnedHorseName( "aramis" ), true ) ;
	addGoalGetToPointInLevel( "aramis", -6807, 9770, "france", true, true ) ;
	
	wait( 6 ) ;
	
	-- fade to black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setActiveLevel( "france" ) ;
	setCameraTo( -6216, 11015 ) ;

	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end	

	wait( 6 ) ;

	while ( isCharacterOnScreen( "cardinal" )
		or  isCharacterOnScreen( "porthos" )
		or  isCharacterOnScreen( "aramis" ) ) do
		coroutine.yield( ) ;
	end

	setCameraFollowCharacter( "athos", true ) ;

	setMissionFaceCharacter( name, "athos", "milady" ) ;
	setMissionFaceDirection( name, "milady", 1, 0 ) ;
	placeCharacter( "milady", "colombierrougehouse2", -130, 191 ) ;
	addGoalGetToPointInLevel( "athos", -90, 191, "colombierrougehouse2", true, true ) ;
	
	waitForNoGoal( "athos" ) ;
	setMissionFaceCharacter( name, "milady", "athos" ) ;
	
	removeMusic( tenseMusicID ) ;
	local tenseMusicID = addMusic( "extratense", 15 ) ;			
		
	sayAndWait( "athos", getString( "mr9d44" ) ) ;
	sayAndWait( "milady", getString( "mr9d45" ) ) ;
	sayAndWait( "athos", getString( "mr9d46" ) ) ;
	sayAndWait( "milady", getString( "mr9d47" ) ) ;
	sayAndWait( "athos", getString( "mr9d48" ) ) ;

	addGoalGetToPointInLevel( "milady", -162, 190, "colombierrougehouse2", false, true ) ;
	waitForNoGoal( "milady" ) ;
	
	sayAndWait( "athos", getString( "mr9d49" ) ) ;
	sayAndWait( "milady", getString( "mr9d50" ) ) ;
	
	-- athos points pistol at milady
	
	removeMeleeWeapon( "athos" ) ;
	setRangedWeapon( "athos", "pistol_matchlock_1" ) ;
	setRangedLoadedRatio( "athos", 0.0 ) ;
	
	makeEnemies( "athos", "milady" ) ;
	
	wait( 0.2 ) ;
	playSound( "musketreload", 1.0 ) ;
	wait( 0.3 ) ;
	
	local bubInd = characterSay( "athos", true, -1, -1, true, getString( "mr9d51" ) ) ;
	while ( isBubbleOpen( bubInd ) ) do
		setRangedLoadedRatio( "athos", 0.0 ) ;
		coroutine.yield( ) ;
	end
	deleteBubble( bubInd ) ;
	
	wait( 0.5 ) ;
	
	local bubInd = characterSay( "athos", true, -1, -1, true, getString( "mr9d52" ) ) ;
	while ( isBubbleOpen( bubInd ) ) do
		setRangedLoadedRatio( "athos", 0.0 ) ;
		coroutine.yield( ) ;
	end
	deleteBubble( bubInd ) ;

	playSound( "paper", 1.0 ) ;

	local bubInd = characterSay( "milady", true, -1, -1, true, getString( "mr9d53" ) ) ;
	while ( isBubbleOpen( bubInd ) ) do
		setRangedLoadedRatio( "athos", 0.0 ) ;
		coroutine.yield( ) ;
	end
	deleteBubble( bubInd ) ;
	
	makeNotEnemies( "athos", "milady" ) ;
	setStateMessageIdle( "athos" ) ;
	setStateMessageIdle( "milady" ) ;
	
	wait( 0.5 ) ;
	
	removeRangedWeapon( "athos" ) ;
	dress_athosB( "athos" ) ;
	
	sayAndWait( "athos", getString( "mr9d54" ) ) ;
	
	addGoalGetToPointInLevel( "athos", 38, -42, "colombierrougehouse2", false, true ) ;
	
	wait( 4 ) ;
	
	-- fade to black
	local fadeTime = 0.5
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "cardinal" ) ;
	clearGoals( "athos" ) ;
	clearGoals( "porthos" ) ;
	clearGoals( "aramis" ) ;
	
	removeDriver( "cardhorse1", "cardinal" ) ;
	removeDriver( getCharacterOwnedHorseName( "porthos" ), "porthos" ) ;
	removeDriver( getCharacterOwnedHorseName( "aramis" ), "aramis" ) ;
	removeDriver( getCharacterOwnedHorseName( "dartagnan" ), "dartagnan" ) ;
	
	setToggleVisElsVisible( "poisonwine1", false ) ;
	setToggleVisElsVisible( "poisonwine2", false ) ;
	setToggleVisElsVisible( "poisonwine3", false ) ;
	
	wait( 3 ) ;
	
	removeMusic( tenseMusicID ) ;
		
	place_cardinalB( "cardinal" ) ;
	
	placeCharacter( "dartagnan", "france", -8730, 9630 ) ;
	placeCharacter( "porthos", "france", -8690, 9630 ) ;
	placeCharacter( "aramis", "france", -8710, 9660 ) ;
	
	--placeCharactersHorseClose( "porthos" ) ;
	--placeCharactersHorseClose( "aramis" ) ;
	
	setMissionFaceDirection( name, "dartagnan", 1, 0 ) ;
	setMissionFaceDirection( name, "porthos", -1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;

	setCameraFollowCharacter( "dartagnan", false ) ;
	
	placeCharacter( "athos", "france", -8279, 9503 ) ;
	putCharacterInPlaceOnHorse( "athos" ) ;
	addGoalGetToPointInLevel( "athos", -8709, 9540, "france", true, true ) ;
		
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end	
	
	waitForNoGoal( "athos" ) ;
	removeDriver( getCharacterOwnedHorseName( "athos" ), "athos" ) ;
	setMissionFaceDirection( name, "athos", 0, 1 ) ;
	addGoalGetToPointInLevel( "athos", -8704, 9581, "france", false, true ) ;

	wait( 0.5 ) ;
	unlockPlayerInPlace( ) ;
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "grimaud", true ) ;
	setIgnoreFreeze( "musketeer36", true ) ;
	setIgnoreFreeze( "musketeer37", true ) ;
	setIgnoreFreeze( "musketeer43", true ) ;
	setIgnoreFreeze( "musketeer44", true ) ;
	
	waitForNoGoal( "athos" ) ;

	sayAndWait( "athos", getString( "mr9d55" ) ) ;
	sayAndWait( "porthos", getString( "mr9d56" ) ) ;
	sayAndWait( "athos", getString( "mr9d57" ) ) ;
	sayAndWait( "dartagnan", getString( "mr9d58" ) ) ;
	sayAndWait( "athos", getString( "mr9d59" ) ) ;
	
	setMissionFaceCharacter( name, "athos", "musketeer36" ) ;
	setMissionFaceCharacter( name, "porthos", "athos" ) ;
	setMissionFaceCharacter( name, "aramis", "athos" ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	addGoalGetToPointInLevel( "athos", -8678, 9672, "france", false, true ) ;
	waitForNoGoal( "athos" ) ;

	setMissionFaceCharacter( name, "musketeer36", "athos" ) ;
	setMissionFaceCharacter( name, "musketeer37", "athos" ) ;
	setMissionFaceCharacter( name, "musketeer43", "athos" ) ;
	setMissionFaceCharacter( name, "musketeer44", "athos" ) ;

	sayAndWait( "athos", getString( "mr9d60" ) ) ;
	sayAndWait( "musketeer36", getString( "mr9d61" ) ) ;
	sayAndWait( "athos", getString( "mr9d62" ) ) ;
	sayAndWait( "musketeer36", getString( "mr9d63" ) ) ;
	sayAndWait( "athos", getString( "mr9d64" ) ) ;
	
	sayAndWait( "dartagnan", getString( "mr9d65" ) ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	sayAndWait( "athos", getString( "mr9d66" ) ) ;
	
	setMissionFaceCharacter( name, "athos", "musketeer36" ) ;
	sayAndWait( "musketeer36", getString( "mr9d67" ) ) ;
	sayAndWait( "athos", getString( "mr9d68" ) ) ;
	sayAndWait( "musketeer36", getString( "mr9d69" ) ) ;

	setMissionFaceCharacter( name, "athos", "grimaud" ) ;
	setMissionFaceCharacter( name, "grimaud", "athos" ) ;
	addGoalGetToPointInLevel( "athos", -8812, 9720, "france", false, true ) ;
	waitForNoGoal( "athos" ) ;
	sayAndWait( "athos", getString( "mr9d70" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "grimaud", false ) ;
	setIgnoreFreeze( "musketeer36", false ) ;
	setIgnoreFreeze( "musketeer37", false ) ;
	setIgnoreFreeze( "musketeer43", false ) ;
	setIgnoreFreeze( "musketeer44", false ) ;

	removeWeatherSpot( darkForestWeather ) ;
		
	completeMission( name ) ;
	activateMission( "missionrochelle10" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function grimaudReload( )
	local muskPosX = -10309 ;
	local grimPosX = muskPosX + 40 ;
	local dartagnanPosY = 10960 ;
	local athosPosY = 11030 ;
	local porthosPosY = 11100 ;
	local aramisPosY = 11170 ;
	
	local loadDelay1 = 0.1 ;
	
	setWalkSpeed( "grimaud", 140 ) ;
	
	while ( gRunGrimaudReload ) do
		setMissionFaceDirection( "missionrochelle10", "grimaud", -1, 0 ) ;
		addGoalGetToPointInLevel( "grimaud", grimPosX, dartagnanPosY, "france", false, true ) ;
		waitForNoGoal( "grimaud" ) ;
		wait( loadDelay1 ) ;
		if ( not gRunGrimaudReload ) then
			break ;
		end
		loadRanged( "dartagnan" ) ;
				
		addGoalGetToPointInLevel( "grimaud", grimPosX, athosPosY, "france", false, true ) ;
		waitForNoGoal( "grimaud" ) ;
		wait( loadDelay1 ) ;
		if ( not gRunGrimaudReload ) then
			break ;
		end
		loadRanged( "athos" ) ;
		
		addGoalGetToPointInLevel( "grimaud", grimPosX, porthosPosY, "france", false, true ) ;
		waitForNoGoal( "grimaud" ) ;
		wait( loadDelay1 ) ;
		if ( not gRunGrimaudReload ) then
			break ;
		end
		loadRanged( "porthos" ) ;
		
		addGoalGetToPointInLevel( "grimaud", grimPosX, aramisPosY, "france", false, true ) ;
		waitForNoGoal( "grimaud" ) ;
		wait( loadDelay1 ) ;
		if ( not gRunGrimaudReload ) then
			break ;
		end
		loadRanged( "aramis" ) ;
	end
	
	setWalkSpeed( "grimaud", getDefaultWalkSpeed( ) ) ;
end

function createRochelle( )
	local enemyStartX = -11082 ;
	local enemyStartY1 = 10982 ;
	local enemyStartY2 = 11248 ;
	
	local enemy = createTempCharacter( getString( "rochellais" ), "france", enemyStartX, randomInt( enemyStartY1, enemyStartY2 ) ) ;
	setStatsCalculatorStatic( enemy, 19, 19, 19, 19 ) ;
	randomDressRochellais( enemy, 0.5, randomInt( 0, 99999 ) ) ;
	setHasLootDrop( enemy, false ) ;
	
	makeEnemies( enemy, "dartagnan", "athos", "porthos", "aramis" ) ;
		
	return enemy ;
end

function createRochelleM( )
	local enemy = createRochelle( ) ;
	setRangedWeapon( enemy, "musket_matchlock_1" ) ;
	setRangedAttackDist( enemy, randomInt( 400, 600 ) ) ;
	loadRanged( enemy ) ;
	return enemy ;
end

function createRochelleS( )
	local enemy = createRochelle( ) ;
	setMeleeWeapon( enemy, "sword_1" ) ;
	return enemy ;
end

function createRochelleMS( )
	local enemy = createRochelle( ) ;
	setMeleeWeapon( enemy, "sword_1" ) ;
	setRangedWeapon( enemy, "musket_matchlock_1" ) ;
	setRangedAttackDist( enemy, randomInt( 400, 600 ) ) ;
	loadRanged( enemy ) ;
	return enemy ;
end

function missionrochelle10LockOut1( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mr10d3" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mr10d3" ) ) ;

	local x = -10310 ;
	local y = 10790 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;
end

function missionrochelle10LockOut2( )
	lockPlayerInPlace( ) ;

	--local bubInd = characterThink( "dartagnan", true, -1, 150.0, true, getString( "mr10d4" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mr10d4" ) ) ;
	
	local x = -10310 ;
	local y = 10790 ;
	addGoalGetToPointInLevel( "dartagnan", x, y, "france", false, true ) ;
	while ( characterHasGoal( "dartagnan" ) ) do
		coroutine.yield( ) ;
	end

	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end

function execute_missionrochelle10( name )
	-- Fight at bastion
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "musketeer36", getString( "mr9d75" ) ) ;
	setMissionChatString( name, "musketeer43", getString( "mr9d76" ) ) ;
	setMissionChatString( name, "musketeer44", getString( "mr9d76" ) ) ;
	setMissionChatString( name, "musketeer37", getString( "mr9d77" ) ) ;
		
	setMissionChatString( name, "bazin", getString( "mr9d72" ) ) ;
	setMissionChatString( name, "mousqueton", getString( "mr9d73" ) ) ;
	
	setMissionChatString( name, "athos", getString( "mr9d71" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr9d71" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr9d71" ) ) ;
	
	setInventoryItem( "letter_carteblanche", 0 ) ;
	
	placeServantsRochelle1( name ) ;
	
	ensureCharacterAroundPoint( "porthos", "france", -8690, 9630, 600 ) ;
	ensureCharacterAroundPoint( "aramis", "france", -8710, 9660, 600 ) ;
	ensureCharacterAroundPoint( "athos", "france", -8782, 9718, 600 ) ;
	
	setRatioHealth( "athos", 1.0 ) ;
	setRatioHealth( "porthos", 1.0 ) ;
	setRatioHealth( "aramis", 1.0 ) ;
	setCharacterSlowDamage( "athos", true ) ;
	setCharacterSlowDamage( "porthos", true ) ;
	setCharacterSlowDamage( "aramis", true ) ;
	
	local triggerAreaA = addTriggerArea( name, "missionrochelle10LockOut1", true, "france", 
		{ -10579, 10664, -10368, 10878 } ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", -8546, 9534 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -9139, 9110, -8016, 9895 },
		{ -9130, 9174, -8838, 9997, -10160, 10966, -10988, 10606 },
		{ -10766, 10590, -9788, 11766 } ) ;
	
	-- destroy wall
	setToggleVisElsVisible( "rochelle3", false ) ;
	setToggleVisElsVisible( "rochelle4", true ) ;
	
	-- create dead guys up on bastion
	local deadGuy1 = createTempCharacter( getString( "rochellais" ), "france", -10307, 11302 ) ;
	setStatsCalculatorDynamic( deadGuy1, -10, -10, 2, 1000, 0.5 ) ;
	randomDressRochellais( deadGuy1, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( deadGuy1, "musket_matchlock_1" ) ;
	setHasLootDrop( deadGuy1, false ) ;
	setAllowPermanentDeath( deadGuy1, false ) ;
	faceDirection( deadGuy1, 1, 1 ) ;
	takeDamage( deadGuy1, 500 ) ;
	
	local deadGuy2 = createTempCharacter( getString( "rochellais" ), "france", -10308, 10811 ) ;
	setStatsCalculatorDynamic( deadGuy2, -10, -10, 2, 1000, 0.5 ) ;
	randomDressRochellais( deadGuy2, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( deadGuy2, "musket_matchlock_1" ) ;
	setHasLootDrop( deadGuy2, false ) ;
	setAllowPermanentDeath( deadGuy2, false ) ;
	faceDirection( deadGuy2, -1, -1 ) ;
	takeDamage( deadGuy2, 500 ) ;
	
	local deadGuy3 = createTempCharacter( getString( "guardsman" ), "france", -10314, 11171 ) ;
	setStatsCalculatorDynamic( deadGuy3, -10, -10, 2, 1000, 0.5 ) ;
	randomDressGuardsman( deadGuy3, 0.0, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( deadGuy3, "musket_matchlock_1" ) ;
	setHasLootDrop( deadGuy3, false ) ;
	setAllowPermanentDeath( deadGuy3, false ) ;
	faceDirection( deadGuy3, 1, -1 ) ;
	takeDamage( deadGuy3, 500 ) ;
	
	local deadGuy4 = createTempCharacter( getString( "guardsman" ), "france", -10594, 11543 ) ;
	setStatsCalculatorDynamic( deadGuy4, -10, -10, 2, 1000, 0.5 ) ;
	randomDressGuardsman( deadGuy4, 0.0, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( deadGuy4, "musket_matchlock_1" ) ;
	setHasLootDrop( deadGuy4, false ) ;
	setAllowPermanentDeath( deadGuy4, false ) ;
	faceDirection( deadGuy4, -1, 0 ) ;
	takeDamage( deadGuy4, 500 ) ;
	
	local deadGuy5 = createTempCharacter( getString( "rochellais" ), "france", -10579, 11369 ) ;
	setStatsCalculatorDynamic( deadGuy5, -10, -10, 2, 1000, 0.5 ) ;
	randomDressRochellais( deadGuy5, 0.5, randomInt( 0, 99999 ) ) ;
	setRangedWeapon( deadGuy5, "musket_matchlock_1" ) ;
	setHasLootDrop( deadGuy5, false ) ;
	setAllowPermanentDeath( deadGuy5, false ) ;
	faceDirection( deadGuy5, 1, 0 ) ;
	takeDamage( deadGuy5, 500 ) ;
	
	-- make sure that death anim gets played
	addWatchCharacterTimed( deadGuy1, 5 ) ;
	addWatchCharacterTimed( deadGuy2, 5 ) ;
	addWatchCharacterTimed( deadGuy3, 5 ) ;
	addWatchCharacterTimed( deadGuy4, 5 ) ;
	addWatchCharacterTimed( deadGuy5, 5 ) ;
	
	addGoalGetToPointInLevel( "athos", -10327, 11057, "france", false, true ) ;
	addGoalGetToPointInLevel( "aramis", -10287, 11057, "france", false, true ) ;
	addGoalGetToPointInLevel( "porthos", -10327, 11100, "france", false, true ) ;
	addGoalGetToPointInLevel( "grimaud", -10287, 11100, "france", false, true ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mr10m1" ), "athos" ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "grimaud" ) ;
	
	local triggerArea = addTriggerArea( name, "", false, "france", { -10355, 10905, -10256, 11260 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	setStateMessageIdle( "dartagnan" ) ;

	removeTriggerArea( triggerArea ) ;
		
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "grimaud", true ) ;
	
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- show comic
	local comic1 = createComic( "bastion1" ) ;
	
	addText( comic1, getString( "bastion1_d1" ), 4, 5, 265, 71 ) ;
	addText( comic1, getString( "bastion1_d2" ), 162, 169, 344, 212 ) ;
	addText( comic1, getString( "bastion1_d3" ), 384, 5, 569, 50 ) ;
	addText( comic1, getString( "bastion1_d4" ), 410, 225, 603, 290 ) ;
	addText( comic1, getString( "bastion1_d5" ), 616, 172, 792, 241 ) ;
	addText( comic1, getString( "bastion1_d6" ), 34, 316, 219, 361 ) ;
	addText( comic1, getString( "bastion1_d7" ), 121, 536, 282, 575 ) ;
	addText( comic1, getString( "bastion1_d8" ), 268, 316, 523, 361 ) ;
	addText( comic1, getString( "bastion1_d9" ), 395, 536, 554, 575 ) ;
	addText( comic1, getString( "bastion1_d10" ), 575, 466, 690, 504 ) ;
		
	addMouseOver( comic1, getString( "aramis" ), 45, 62, 227, 254, 147, 70 ) ;
	addMouseOver( comic1, getString( "athos" ), 284, 24, 427, 256, 346, 23 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 465, 57, 595, 231, 516, 57 ) ;
	addMouseOver( comic1, getString( "porthos" ), 610, 56, 796, 236, 658, 59 ) ;

	addMouseOver( comic1, getString( "grimaud" ), 545, 301, 629, 481, 587, 314 ) ;
	addMouseOver( comic1, getString( "porthos" ), 5, 376, 183, 552, 127, 411 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 212, 378, 370, 553, 281, 381 ) ;
	addMouseOver( comic1, getString( "athos" ), 411, 362, 539, 531, 474, 365 ) ;
	addMouseOver( comic1, getString( "aramis" ), 650, 359, 768, 541, 718, 357 ) ;
	
	setInventoryItem( "letter_carteblanche", 1 ) ;
		
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	local muskPosX = -10309 ;
	local grimPosX = muskPosX + 40 ;
	local dartagnanPosY = 10960 ;
	local athosPosY = 11030 ;
	local porthosPosY = 11100 ;
	local aramisPosY = 11170 ;
	
	placeCharacter( "athos", "france", muskPosX, athosPosY ) ;
	placeCharacter( "dartagnan", "france", muskPosX, dartagnanPosY ) ;
	placeCharacter( "porthos", "france", muskPosX, porthosPosY ) ;
	placeCharacter( "aramis", "france", muskPosX, aramisPosY ) ;

	placeCharacter( "grimaud", "france", grimPosX, athosPosY ) ;

	setMissionFaceDirection( name, "porthos", -1, 0 ) ;
	setMissionFaceDirection( name, "aramis", -1, 0 ) ;
	setMissionFaceDirection( name, "dartagnan", -1, 0 ) ;
	
	setMissionFaceDirection( name, "athos", 1, 0 ) ;
	setMissionFaceDirection( name, "grimaud", -1, 0 ) ;
	
	-- remove dart from horse + put horse somewhere else
	local playerHorse = getCharacterOwnedHorseName( "dartagnan" ) ;
	if ( not ( playerHorse == "" ) ) then
		removeDriver( playerHorse, "dartagnan" ) ;
		placeVehicle( playerHorse, "france", -10084, 11105 ) ;
	end
	
	-- give dart a musket here and equip it
	forceHasEquipMusket( ) ;
	loadRanged( "dartagnan" ) ;
	setRangedActive( ) ;
	
	-- don't let player changed active musket
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	
	setRangedAttackDist( "athos", 300 ) ;
	setRangedAttackDist( "porthos", 300 ) ;
	setRangedAttackDist( "aramis", 300 ) ;
	
	setLockRangedStill( "dartagnan", true ) ;
	setLockRangedStill( "athos", true ) ;
	setLockRangedStill( "porthos", true ) ;
	setLockRangedStill( "aramis", true ) ;
	
	loadRanged( "athos" ) ;
	loadRanged( "porthos" ) ;
	loadRanged( "aramis" ) ;
	
	setRangedAttackDist( "athos", 680 ) ;
	setRangedAttackDist( "porthos", 720 ) ;
	setRangedAttackDist( "aramis", 640 ) ;
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "france" ) ;
	setCameraTo( -10631, 11046 ) ;
	
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	sayAndWait( "athos", getString( "mr10d1" ) ) ;
	
	setMissionFaceDirection( name, "athos", -1, 0 ) ;
	setMissionFaceDirection( name, "dartagnan", -1, 0 ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "grimaud", false ) ;
	
	local combatMusicID = addMusic( "combat", 15 ) ;
	
	gRunGrimaudReload = true ;
	activateScriptMessage( "grimaudReload" ) ;

	-- wave 1-1
	local enemy1 = createRochelleM( ) ;
	local enemy2 = createRochelleM( ) ;
	local enemy3 = createRochelleM( ) ;
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;

	-- wave 1-2
	local enemy1 = createRochelleS( ) ;
	local enemy2 = createRochelleS( ) ;
	local enemy3 = createRochelleM( ) ;
	local enemy4 = createRochelleM( ) ;
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;
	waitUntilDead( enemy4 ) ;

	-- wave 1-3
	local enemy1 = createRochelleMS( ) ;
	local enemy2 = createRochelleMS( ) ;
	local enemy3 = createRochelleMS( ) ;
	local enemy4 = createRochelleMS( ) ;
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;
	waitUntilDead( enemy4 ) ;

	-- wave 1-4
	local enemy1 = createRochelleS( ) ;
	local enemy2 = createRochelleS( ) ;
	local enemy3 = createRochelleM( ) ;
	local enemy4 = createRochelleM( ) ;
	local enemy5 = createRochelleM( ) ;
	local enemy6 = createRochelleM( ) ;
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;
	waitUntilDead( enemy4 ) ;
	waitUntilDead( enemy5 ) ;
	waitUntilDead( enemy6 ) ;
	
	wait( 1 ) ;
	
	removeMusic( combatMusicID ) ;
	
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- show comic
	local comic1 = createComic( "bastion2" ) ;

	addText( comic1, getString( "bastion2_d1" ), 157, 6, 340, 75 ) ;
	addText( comic1, getString( "bastion2_d2" ), 32, 225, 248, 290 ) ;
	addText( comic1, getString( "bastion2_d3" ), 271, 225, 441, 290 ) ;
	addText( comic1, getString( "bastion2_d4" ), 467, 111, 669, 155 ) ;
	addText( comic1, getString( "bastion2_d5" ), 560, 225, 791, 290 ) ;
	addText( comic1, getString( "bastion2_d6" ), 7, 317, 147, 360 ) ;
	addText( comic1, getString( "bastion2_d7" ), 26, 464, 218, 503 ) ;
	addText( comic1, getString( "bastion2_d8" ), 332, 306, 531, 382 ) ;
	addText( comic1, getString( "bastion2_d9" ), 357, 414, 474, 452 ) ;
	addText( comic1, getString( "bastion2_d10" ), 554, 411, 763, 457 ) ;
	addText( comic1, getString( "bastion2_d11" ), 690, 484, 767, 517 ) ;
		
	addMouseOver( comic1, getString( "athos" ), 49, 63, 180, 231, 122, 69 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 264, 61, 397, 236, 329, 64 ) ;
	addMouseOver( comic1, getString( "porthos" ), 443, 2, 627, 257, 499, 10 ) ;
	addMouseOver( comic1, getString( "aramis" ), 680, 63, 797, 287, 746, 71 ) ;
	
	addMouseOver( comic1, getString( "athos" ), 35, 355, 196, 588, 133, 356 ) ;
	addMouseOver( comic1, getString( "porthos" ), 231, 308, 440, 536, 268, 307 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 482, 368, 606, 590, 549, 369 ) ;
	addMouseOver( comic1, getString( "aramis" ), 653, 316, 796, 583, 730, 310 ) ;
		
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	local combatMusicID = addMusic( "combat", 15 ) ;
		
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- wave 2-1
	local enemy1 = createRochelleMS( ) ;
	local enemy2 = createRochelleMS( ) ;
	local enemy3 = createRochelleMS( ) ;
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;

	-- wave 2-2
	local enemy1 = createRochelleMS( ) ;
	local enemy2 = createRochelleMS( ) ;
	local enemy3 = createRochelleMS( ) ;
	local enemy4 = createRochelleMS( ) ;
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;
	waitUntilDead( enemy4 ) ;
	
	-- wave 2-3
	local enemy1 = createRochelleS( ) ;
	local enemy2 = createRochelleS( ) ;
	local enemy3 = createRochelleS( ) ;
	local enemy4 = createRochelleS( ) ;
	local enemy5 = createRochelleM( ) ;
	local enemy6 = createRochelleM( ) ;
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;
	waitUntilDead( enemy4 ) ;
	waitUntilDead( enemy5 ) ;
	waitUntilDead( enemy6 ) ;
	
	-- wave 2-4
	local enemy1 = createRochelleS( ) ;
	local enemy2 = createRochelleS( ) ;
	local enemy3 = createRochelleS( ) ;
	local enemy4 = createRochelleS( ) ;
	local enemy5 = createRochelleM( ) ;
	local enemy6 = createRochelleM( ) ;
	local enemy7 = createRochelleM( ) ;
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;
	waitUntilDead( enemy4 ) ;
	waitUntilDead( enemy5 ) ;
	waitUntilDead( enemy6 ) ;
	waitUntilDead( enemy7 ) ;
	
	-- wave 2-5
	local enemy1 = createRochelleS( ) ;
	local enemy2 = createRochelleS( ) ;
	local enemy3 = createRochelleS( ) ;
	local enemy4 = createRochelleS( ) ;
	local enemy5 = createRochelleM( ) ;
	local enemy6 = createRochelleM( ) ;
	local enemy7 = createRochelleMS( ) ;
	local enemy8 = createRochelleMS( ) ;
	local enemy9 = createRochelleMS( ) ;
	local enemy10 = createRochelleMS( ) ;
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;
	waitUntilDead( enemy4 ) ;
	waitUntilDead( enemy5 ) ;
	waitUntilDead( enemy6 ) ;
	waitUntilDead( enemy7 ) ;
	waitUntilDead( enemy8 ) ;
	waitUntilDead( enemy9 ) ;
	waitUntilDead( enemy10 ) ;
		
	-- end grimaud script
	gRunGrimaudReload = false ;
	
	clearGoals( "grimaud" ) ;
	wait( 1 ) ;
	
	removeTriggerArea( triggerAreaA ) ;
	local triggerAreaB = addTriggerArea( name, "missionrochelle10LockOut2", true, "france", 
		{ -10579, 10664, -10368, 10878 } ) ;
	
	setMissionFaceCharacter( name, "grimaud", "athos" ) ;
	setMissionFaceCharacter( name, "athos", "grimaud" ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	setMissionFaceCharacter( name, "porthos", "athos" ) ;
	setMissionFaceCharacter( name, "aramis", "athos" ) ;
	
	wait( 0.5 ) ;
	sayAndWait( "athos", getString( "mr10d2" ) ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	
	setLockRangedStill( "dartagnan", false ) ;
	setLockRangedStill( "athos", false ) ;
	setLockRangedStill( "porthos", false ) ;
	setLockRangedStill( "aramis", false ) ;
	
	setCameraFollowCharacter( "dartagnan", true ) ;
	
	setMissionChatString( name, "athos", getString( "mr9d74" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr9d74" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr9d74" ) ) ;
			
	local enemy1 = createRochelleMS( ) ;
	local enemy2 = createRochelleMS( ) ;
	local enemy3 = createRochelleMS( ) ;
	local enemy4 = createRochelleMS( ) ;
	local enemy5 = createRochelleMS( ) ;
	local enemy6 = createRochelleMS( ) ;
	local enemy7 = createRochelleMS( ) ;
	local enemy8 = createRochelleMS( ) ;
	local enemy9 = createRochelleMS( ) ;
	local enemy10 = createRochelleMS( ) ;
	
	setIgnoreAll( "athos", true ) ;
	setIgnoreAll( "porthos", true ) ;
	setIgnoreAll( "aramis", true ) ;
	
	addGoalGetToPointInLevel( "athos", -9034, 9567, "france", false, true ) ;
	addGoalGetToPointInLevel( "porthos", -9034, 9567, "france", false, true ) ;
	addGoalGetToPointInLevel( "aramis", -9034, 9567, "france", false, true ) ;
	addGoalGetToPointInLevel( "grimaud", -9034, 9567, "france", false, true ) ;
	
	local marker = addMarkerPosition( name, true, getString( "mr10m2" ), "france", -9021, 9553 ) ;

	local triggerArea = addTriggerArea( name, "", false, "france", { -10757, 11568, -10421, 11668 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	setMissionFreezeGame( name, true ) ;
	setStateMessageIdle( "dartagnan" ) ;
	
	removeMusic( combatMusicID ) ;
	local titleMusicID = addMusic( "title", 15 ) ;
	
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- show comic
	local comic1 = createComic( "bastion3" ) ;
	
	addText( comic1, getString( "bastion3_d1" ), 21, 156, 95, 186 ) ;
	addText( comic1, getString( "bastion3_d2" ), 203, 65, 278, 94 ) ;
	addText( comic1, getString( "bastion3_d3" ), 318, 81, 392, 137 ) ;
	addText( comic1, getString( "bastion3_d4" ), 183, 233, 290, 285 ) ;
	addText( comic1, getString( "bastion3_d5" ), 407, 6, 743, 71 ) ;
	addText( comic1, getString( "bastion3_d6" ), 99, 500, 231, 581 ) ;
	addText( comic1, getString( "bastion3_d7" ), 361, 516, 475, 558 ) ;
	addText( comic1, getString( "bastion3_d8" ), 576, 315, 690, 358 ) ;
		
	addMouseOver( comic1, getString( "dartagnan" ), 175, 16, 227, 104, 196, 28 ) ;
	addMouseOver( comic1, getString( "porthos" ), 112, 8, 174, 111, 136, 14 ) ;
	addMouseOver( comic1, getString( "aramis" ), 55, 75, 175, 294, 97, 79 ) ;
	addMouseOver( comic1, getString( "athos" ), 216, 83, 309, 294, 287, 92 ) ;

	addMouseOver( comic1, getString( "treville" ), 412, 65, 552, 297, 483, 70 ) ;
	addMouseOver( comic1, getString( "cardinal" ), 644, 57, 794, 296, 706, 62 ) ;
	addMouseOver( comic1, getString( "louisxiii" ), 546, 82, 652, 291, 586, 84 ) ;

	addMouseOver( comic1, getString( "treville" ), 148, 304, 251, 514, 189, 308 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 4, 404, 124, 586, 95, 410 ) ;

	addMouseOver( comic1, getString( "cardinal" ), 253, 330, 298, 483, 270, 333 ) ;
	addMouseOver( comic1, getString( "louisxiii" ), 295, 334, 342, 459, 309, 335 ) ;
	addMouseOver( comic1, getString( "athos" ), 350, 329, 391, 392, 367, 332 ) ;
	addMouseOver( comic1, getString( "aramis" ), 399, 326, 445, 427, 414, 330 ) ;
	addMouseOver( comic1, getString( "porthos" ), 443, 305, 497, 400, 464, 307 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 339, 365, 409, 571, 386, 354 ) ;
	addMouseOver( comic1, getString( "treville" ), 468, 341, 552, 560, 494, 335 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 630, 328, 793, 575, 707, 333 ) ;
			
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	
	setMissionFreezeGame( name, false ) ;

	removeTriggerArea( triggerArea ) ;
		
	removeMarker( name, marker ) ;

	deleteTempCharacter( enemy1 ) ;
	deleteTempCharacter( enemy2 ) ;
	deleteTempCharacter( enemy3 ) ;
	deleteTempCharacter( enemy4 ) ;
	deleteTempCharacter( enemy5 ) ;
	deleteTempCharacter( enemy6 ) ;
	deleteTempCharacter( enemy7 ) ;
	deleteTempCharacter( enemy8 ) ;
	deleteTempCharacter( enemy9 ) ;
	deleteTempCharacter( enemy10 ) ;
	
	-- get rid of dead guys
	deleteTempCharacter( deadGuy1 ) ;
	deleteTempCharacter( deadGuy2 ) ;
	deleteTempCharacter( deadGuy3 ) ;
	deleteTempCharacter( deadGuy4 ) ;
	deleteTempCharacter( deadGuy5 ) ;
			
	setMapButtonVisible( true ) ;
	setInventoryButtonVisible( true ) ;
			
	setIgnoreAll( "athos", false ) ;
	setIgnoreAll( "porthos", false ) ;
	setIgnoreAll( "aramis", false ) ;
				
	setRatioHealth( "athos", 1.0 ) ;
	setRatioHealth( "porthos", 1.0 ) ;
	setRatioHealth( "aramis", 1.0 ) ;
	setCharacterSlowDamage( "athos", false ) ;
	setCharacterSlowDamage( "porthos", false ) ;
	setCharacterSlowDamage( "aramis", false ) ;
	
	clearGoals( "athos" ) ;
	clearGoals( "porthos" ) ;
	clearGoals( "aramis" ) ;
	clearGoals( "grimaud" ) ;
	
	placeServantsRochelle1( name ) ;
	placeMusksRochelle2( name ) ;

	placeCharacter( "dartagnan", "france", -8369, 9501 ) ;
	
	moveCameraToDest( ) ;
	
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	removeMusic( titleMusicID ) ;
				
	-- repair wall
	setToggleVisElsVisible( "rochelle3", true ) ;
	setToggleVisElsVisible( "rochelle4", false ) ;
	
	-- reset ranged dist
	setRangedAttackDist( "athos", getDefaultRangedAttackDist( ) ) ;
	setRangedAttackDist( "porthos", getDefaultRangedAttackDist( ) ) ;
	setRangedAttackDist( "aramis", getDefaultRangedAttackDist( ) ) ;
		
	removeTriggerArea( triggerAreaB ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
			
	unequipItem( "tabbard_guard_1" ) ;
	setInventoryItem( "tabbard_guard_1", 0 ) ;
	setInventoryItem( "tabbard_musketeer_1", 1 ) ;
	equipItem( "tabbard_musketeer_1" ) ;
					
	completeMission( name ) ;
	activateMission( "missionrochelle11" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function placeMusksRochelle2( name )
	placeCharacter( "athos", "france", -7330, 9290 ) ;
	placeCharacter( "porthos", "france", -7280, 9290 ) ;
	placeCharacter( "aramis", "france", -7305, 9315 ) ;
	
	setMissionFaceDirection( name, "athos", 1, 0 ) ;
	setMissionFaceDirection( name, "porthos", -1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
end

function placeMusksRochelle3( name )
	removeDriver( getCharacterOwnedHorseName( "dartagnan" ), "dartagnan" ) ;
	
	local middleX = -7524 ;
	local middleY = 9623 ;
	placeCharacter( "athos", "france", middleX - 25, middleY ) ;
	placeCharacter( "porthos", "france", middleX + 25, middleY ) ;
	placeCharacter( "aramis", "france", middleX, middleY + 25 ) ;
	placeCharacter( "dartagnan", "france", middleX, middleY - 25 ) ;
	
	setMissionFaceDirection( name, "athos", 1, 0 ) ;
	setMissionFaceDirection( name, "porthos", -1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
end

function execute_missionrochelle11( name )
	-- Talk to d'Essart to get him to sell diamond ring
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "bazin", getString( "mr9d72" ) ) ;
	setMissionChatString( name, "mousqueton", getString( "mr9d73" ) ) ;
		
	setMissionChatString( name, "treville", getString( "mr11d6" ) ) ;
	setMissionChatString( name, "athos", getString( "mr11d7" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr11d7" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr11d7" ) ) ;
		
	setInventoryItem( "queen_ring", 1 ) ;
	
	placeServantsRochelle2( name ) ;
	placeMusksRochelle2( name ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mr11m1" ), "essart" ) ;
	
	waitForTalk( "dartagnan", "essart", false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "essart", true ) ;
	
	setMissionFaceCharacter( name, "essart", "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mr11d1" ) ) ;
	sayAndWait( "essart", getString( "mr11d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mr11d3" ) ) ;
	sayAndWait( "essart", getString( "mr11d4" ) ) ;
	
	setInventoryItem( "queen_ring", 0 ) ;
		
	sayAndWait( "dartagnan", getString( "mr11d5" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "essart", false ) ;
	
	completeMission( name ) ;
	activateMission( "missionrochelle12" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle12( name )
	-- Talk to Musketeers, send out servants, servants come back...
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "bazin", getString( "mr9d72" ) ) ;
	setMissionChatString( name, "mousqueton", getString( "mr9d73" ) ) ;
		
	setMissionChatString( name, "treville", getString( "mr11d6" ) ) ;
	setMissionChatString( name, "essart", getString( "mr11d8" ) ) ;
		
	placeServantsRochelle2( name ) ;
	placeMusksRochelle2( name ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mr12m1" ), "athos" ) ;
	
	waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
	removeMarker( name, marker ) ;

	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;	
	addGoalGetToPointInLevel( "dartagnan", -7304, 9238, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "essart", true ) ;
	setIgnoreFreeze( "planchet", true ) ;
	setIgnoreFreeze( "grimaud", true ) ;
	setIgnoreFreeze( "mousqueton", true ) ;
	setIgnoreFreeze( "bazin", true ) ;
	setIgnoreFreeze( "cardinal", true ) ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	
	sayAndWait( "dartagnan", getString( "mr12d1" ) ) ;
	
	-- letter for Lord de Winter	
	local bubInd = characterSay( "athos", true, -1, -1, false, getString( "mr12d2" ) ) ;
	waitForBubbleDone( bubInd ) ;
	setBubbleToBackgroundOpacity( bubInd ) ;
	local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, "", getString( "yes" ), getString( "no" ) ) ;
	local option = waitForBubbleOption( bubInd2 ) ;
	deleteBubble( bubInd ) ;
	if ( option == 0 ) then
		-- yes
		sayAndWait( "athos", getString( "mr12d3" ) ) ;
		sayAndWait( "athos", getString( "mr12d4" ) ) ;
		sayAndWait( "athos", getString( "mr12d5" ) ) ;
		sayAndWait( "athos", getString( "mr12d6" ) ) ;
	end			
	sayAndWait( "athos", getString( "mr12d7" ) ) ;

	-- letter for Madame de Chevreuse
	local bubInd = characterSay( "aramis", true, -1, -1, false, getString( "mr12d8" ) ) ;
	waitForBubbleDone( bubInd ) ;
	setBubbleToBackgroundOpacity( bubInd ) ;
	local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, "", getString( "yes" ), getString( "no" ) ) ;
	local option = waitForBubbleOption( bubInd2 ) ;
	deleteBubble( bubInd ) ;
	if ( option == 0 ) then
		-- yes
		sayAndWait( "aramis", getString( "mr12d9" ) ) ;
		sayAndWait( "aramis", getString( "mr12d10" ) ) ;
		sayAndWait( "aramis", getString( "mr12d11" ) ) ;
	end
	sayAndWait( "aramis", getString( "mr12d12" ) ) ;
	
	sayAndWait( "athos", getString( "mr12d13" ) ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "essart" ) ;
	setMissionFaceCharacter( name, "athos", "essart" ) ;
	setMissionFaceCharacter( name, "porthos", "essart" ) ;
	setMissionFaceCharacter( name, "aramis", "essart" ) ;
	setMissionFaceCharacter( name, "essart", "dartagnan" ) ;
	
	-- Monsieur d'Essart walks up
	placeCharacter( "essart", "france", -7777, 9346 ) ;
	addGoalGetToPointInLevel( "essart", -7387, 9237, "france", false, true ) ;
	waitForNoGoal( "essart" ) ;
	
	sayAndWait( "essart", getString( "mr12d14" ) ) ;
	
	playSound( "dropmoney", 0.5 ) ;
		
	sayAndWait( "dartagnan", getString( "mr12d15" ) ) ;
	
	addGoalGetToPointInLevel( "essart", -7889, 9354, "france", false, true ) ;
	wait( 3 ) ;

	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	setMissionFaceCharacter( name, "aramis", "porthos" ) ;
	sayAndWait( "porthos", getString( "mr12d16" ) ) ;

	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	sayAndWait( "dartagnan", getString( "mr12d17" ) ) ;
	
	setMissionFaceCharacter( name, "athos", "aramis" ) ;
	setMissionFaceCharacter( name, "porthos", "aramis" ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	sayAndWait( "aramis", getString( "mr12d18" ) ) ;

	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	setMissionFaceCharacter( name, "porthos", "athos" ) ;
	setMissionFaceCharacter( name, "aramis", "athos" ) ;
	sayAndWait( "athos", getString( "mr12d19" ) ) ;

	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	sayAndWait( "dartagnan", getString( "mr12d20" ) ) ;

	-- bazin and planchet walk up, then get on horses and leave
	setMissionFaceCharacter( name, "planchet", "dartagnan" ) ;
	addGoalGetToPointInLevel( "planchet", -7214, 9215, "france", false, true ) ;
	waitForNoGoal( "planchet" ) ;
	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;
	playSound( "paper", 1.0 ) ;
	sayAndWait( "dartagnan", getString( "mr12d21" ) ) ;
	
	playSound( "dropmoney", 0.5 ) ;
	
	sayAndWait( "planchet", getString( "mr12d22" ) ) ;
	addGoalGetToPointInLevel( "planchet", -6303, 8698, "france", false, true ) ;
	setMissionFaceDirection( name, "bazin", -1, 1 ) ;
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	setMissionFaceCharacter( name, "aramis", "bazin" ) ;
	addGoalGetToPointInLevel( "bazin", -7226, 9231, "france", false, true ) ;
	waitForNoGoal( "bazin" ) ;
	playSound( "paper", 1.0 ) ;
	sayAndWait( "aramis", getString( "mr12d23" ) ) ;
	
	playSound( "dropmoney", 0.5 ) ;
	
	addGoalGetToPointInLevel( "bazin", -6194, 8709, "france", false, true ) ;
	
	while ( isCharacterOnScreen( "planchet" )
		or  isCharacterOnScreen( "bazin" ) ) do
		coroutine.yield( ) ;
	end

	clearGoals( "planchet" ) ;
	clearGoals( "bazin" ) ;

	local tenseMusicID = addMusic( "tense", 15 ) ;

	-- go to comic
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- show comic
	local comic1 = createComic( "milady2" ) ;
	
	addText( comic1, getString( "milady2_d1" ), 6, 5, 233, 60 ) ;
	addText( comic1, getString( "milady2_d2" ), 6, 211, 233, 294 ) ;
	addText( comic1, getString( "milady2_d3" ), 259, 14, 385, 61 ) ;
	addText( comic1, getString( "milady2_d4" ), 338, 195, 473, 237 ) ;
	addText( comic1, getString( "milady2_d5" ), 580, 142, 747, 183 ) ;
	addText( comic1, getString( "milady2_d6" ), 550, 208, 784, 250 ) ;
	addText( comic1, getString( "milady2_d7" ), 6, 307, 233, 366 ) ;
	addText( comic1, getString( "milady2_d8" ), 19, 554, 233, 593 ) ;
	addText( comic1, getString( "milady2_d9" ), 258, 269, 476, 313 ) ;
	addText( comic1, getString( "milady2_d10" ), 250, 490, 416, 555 ) ;
	addText( comic1, getString( "milady2_d11" ), 514, 272, 626, 314 ) ;
	addText( comic1, getString( "milady2_d12" ), 514, 363, 627, 403 ) ;
	addText( comic1, getString( "milady2_d13" ), 569, 422, 785, 478 ) ;

	addMouseOver( comic1, getString( "milady" ), 41, 67, 141, 235, 83, 75 ) ;
	addMouseOver( comic1, getString( "officer_m" ), 150, 64, 221, 234, 175, 66 ) ;
	
	addMouseOver( comic1, getString( "officer_m" ), 506, 17, 572, 166, 527, 27 ) ;
	addMouseOver( comic1, getString( "felton" ), 600, 20, 666, 205, 634, 25 ) ;
	addMouseOver( comic1, getString( "milady" ), 553, 59, 628, 208, 605, 57 ) ;
	addMouseOver( comic1, getString( "lordwinter" ), 715, 13, 799, 207, 735, 21 ) ;

	addMouseOver( comic1, getString( "milady" ), 149, 371, 208, 429, 176, 380 ) ;
	addMouseOver( comic1, getString( "lordwinter" ), 22, 366, 84, 561, 47, 368 ) ;
	addMouseOver( comic1, getString( "felton" ), 200, 375, 242, 556, 220, 374 ) ;

	addMouseOver( comic1, getString( "milady" ), 294, 343, 435, 467, 355, 353 ) ;
	addMouseOver( comic1, getString( "felton" ), 432, 342, 495, 579, 483, 335 ) ;

	addMouseOver( comic1, getString( "felton" ), 525, 309, 556, 353, 537, 314 ) ;
	addMouseOver( comic1, getString( "milady" ), 628, 291, 726, 416, 677, 295 ) ;
	
	addMouseOver( comic1, getString( "felton" ), 532, 492, 563, 534, 544, 499 ) ;
	addMouseOver( comic1, getString( "milady" ), 626, 472, 726, 596, 677, 481 ) ;

	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "essart" ) ;
	place_essartB( "essart" ) ;
	
	-- put musketeers in slightly different place
	placeMusksRochelle3( name ) ;
	moveCameraToDest( ) ;
	
	setMissionFaceCharacter( name, "mousqueton", "grimaud" ) ;
	setMissionFaceCharacter( name, "grimaud", "mousqueton" ) ;
	placeCharacter( "mousqueton", "france", -7724, 9528 ) ;
	placeCharacter( "grimaud", "france", -7684, 9528 ) ;
	
	removeMusic( tenseMusicID ) ;
		
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	placeCharacter( "bazin", "france", -7105, 9225 ) ;
	setMissionFaceDirection( name, "bazin", -1, 1 ) ;
	addGoalGetToPointInLevel( "bazin", -7468, 9560, "france", false, true ) ;
	wait( 2 ) ;
	setMissionFaceCharacter( name, "dartagnan", "bazin" ) ;
	setMissionFaceCharacter( name, "athos", "bazin" ) ;
	setMissionFaceCharacter( name, "porthos", "bazin" ) ;
	setMissionFaceCharacter( name, "aramis", "bazin" ) ;
	waitForNoGoal( "bazin" ) ;
	sayAndWait( "bazin", getString( "mr12d24" ) ) ;
	playSound( "paper", 1.0 ) ;
	wait( 1.5 ) ;
	local bubInd = characterSay( "aramis", true, -1, -1, true, getString( "mr12d25" ) ) ;
	placeCharacter( "cardinal", "france", -7588, 9235 ) ;
	setMissionFaceCharacter( name, "cardinal", "aramis" ) ;
	addGoalGetToPointInLevel( "cardinal", -7576, 9566, "france", false, true ) ;
	waitForBubbleClosed( bubInd ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "cardinal" ) ;
	setMissionFaceCharacter( name, "athos", "cardinal" ) ;
	setMissionFaceCharacter( name, "porthos", "cardinal" ) ;
	setMissionFaceCharacter( name, "aramis", "cardinal" ) ;
	waitForNoGoal( "cardinal" ) ;
	local cardMusicID = addMusic( "cardinalsguards", 15 ) ;
	sayAndWait( "cardinal", getString( "mr12d26" ) ) ;
	sayAndWait( "aramis", getString( "mr12d27" ) ) ;
	sayAndWait( "cardinal", getString( "mr12d28" ) ) ;
	setMissionFaceCharacter( name, "cardinal", "athos" ) ;
	sayAndWait( "athos", getString( "mr12d29" ) ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mr12d30" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	sayAndWait( "cardinal", getString( "mr12d31" ) ) ;
	
	addGoalGetToPointInLevel( "cardinal", -8390, 9504, "france", false, true ) ;
	wait( 2 ) ;
	removeMusic( cardMusicID ) ;
	wait( 1 ) ;
	
	setMissionFaceCharacter( name, "athos", "grimaud" ) ;
	setMissionFaceCharacter( name, "dartagnan", "grimaud" ) ;
	setMissionFaceCharacter( name, "porthos", "grimaud" ) ;
	setMissionFaceCharacter( name, "aramis", "grimaud" ) ;
	setMissionFaceCharacter( name, "grimaud", "athos" ) ;
	sayAndWait( "athos", getString( "mr12d32" ) ) ;
	addGoalGetToPointInLevel( "grimaud", -7605, 9620, "france", false, true ) ;
	waitForNoGoal( "grimaud" ) ;
	sayAndWait( "athos", getString( "mr12d33" ) ) ;
	playSound( "paper", 1.0 ) ;
	wait( 1 ) ;
	sayAndWait( "grimaud", getString( "mr12d34" ) ) ;
	wait( 1 ) ;
	sayAndWait( "athos", getString( "mr12d35" ) ) ;

	setMissionFaceCharacter( name, "grimaud", "mousqueton" ) ;	
	setMissionFaceDirection( name, "bazin", 0, -1 ) ;	
	addGoalGetToPointInLevel( "grimaud", -7684, 9528, "france", false, true ) ;
	addGoalGetToPointInLevel( "bazin", -7610, 9432, "france", false, true ) ;
	
	placeCharacter( "planchet", "france", -7101, 9209 ) ;
	setMissionFaceDirection( name, "planchet", -1, 1 ) ;
	addGoalGetToPointInLevel( "planchet", -7463, 9561, "france", false, true ) ;
	wait( 1 ) ;
	setMissionFaceCharacter( name, "dartagnan", "planchet" ) ;
	setMissionFaceCharacter( name, "athos", "planchet" ) ;
	setMissionFaceCharacter( name, "porthos", "planchet" ) ;
	setMissionFaceCharacter( name, "aramis", "planchet" ) ;
	waitForNoGoal( "planchet" ) ;
	
	sayAndWait( "dartagnan", getString( "mr12d36" ) ) ;
	sayAndWait( "planchet", getString( "mr12d37" ) ) ;
	sayAndWait( "dartagnan", getString( "mr12d38" ) ) ;
	
	setMissionFaceDirection( name, "planchet", 0, -1 ) ;	
	addGoalGetToPointInLevel( "planchet", -7560, 9432, "france", false, true ) ;
	wait( 1 ) ;
	
	setMissionFaceDirection( name, "athos", 1, 0 ) ;
	setMissionFaceDirection( name, "porthos", -1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	
	sayAndWait( "dartagnan", getString( "mr12d39" ) ) ;

	waitForNoGoal( "bazin" ) ;
	waitForNoGoal( "planchet" ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "essart", false ) ;
	setIgnoreFreeze( "planchet", false ) ;
	setIgnoreFreeze( "grimaud", false ) ;
	setIgnoreFreeze( "mousqueton", false ) ;
	setIgnoreFreeze( "bazin", false ) ;
	setIgnoreFreeze( "cardinal", false ) ;
	
	clearGoals( "cardinal" ) ;
	place_cardinalB( "cardinal" ) ;
	
	addMoney( 1000 ) ;
	
	completeMission( name ) ;
	activateMission( "missionrochelle13" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle13( name )
	-- Speak to Treville, speak to friends, escort king to Paris
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "bazin", getString( "mr9d72" ) ) ;
	setMissionChatString( name, "mousqueton", getString( "mr9d73" ) ) ;
		
	setMissionChatString( name, "athos", getString( "mr12d41" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr12d40" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr12d41_5" ) ) ;

	setMissionChatString( name, "treville", getString( "mr12d42" ) ) ;
	setMissionChatString( name, "louisxiii", getString( "mr12d43" ) ) ;
	
	-- place Musketeers and Servants in similar position to last mission
	local middleX = -7524 ;
	local middleY = 9623 ;
	ensureCharacterAroundPoint( "athos", "france", middleX - 25, middleY, 100 ) ;
	ensureCharacterAroundPoint( "porthos", "france", middleX + 25, middleY, 100 ) ;
	ensureCharacterAroundPoint( "aramis", "france", middleX, middleY + 25, 100 ) ;
	
	setMissionFaceDirection( name, "athos", 1, 0 ) ;
	setMissionFaceDirection( name, "porthos", -1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;

	setMissionFaceCharacter( name, "mousqueton", "grimaud" ) ;
	setMissionFaceCharacter( name, "grimaud", "mousqueton" ) ;
	ensureCharacterAroundPoint( "mousqueton", "france", -7724, 9528, 100 ) ;
	ensureCharacterAroundPoint( "grimaud", "france", -7684, 9528, 100 ) ;
	
	setMissionFaceDirection( name, "bazin", 0, -1 ) ;
	ensureCharacterAroundPoint( "bazin", "france", -7610, 9432, 100 ) ;
	putCharacterInPlaceOnHorse( "bazin" ) ;

	setMissionFaceDirection( name, "planchet", 0, -1 ) ;
	ensureCharacterAroundPoint( "planchet", "france", -7560, 9432, 100 ) ;
	putCharacterInPlaceOnHorse( "planchet" ) ;
	
	
	-- Put the King and Louie further apart (because they are on horses)
	placeCharacter( "louisxiii", "france", -8490, 9610 ) ;
	placeCharacter( "treville", "france", -8420, 9610 ) ;
	
	-- Put the King and Treville on horses
	putCharacterInPlaceOnHorse( "louisxiii", "kinghorse1" ) ;
	putCharacterInPlaceOnHorse( "treville", "trevillehorse1" ) ;

	local marker = addMarkerCharacter( name, true, getString( "mr13m1" ), "treville" ) ;
	waitForTalk( "dartagnan", "treville", false ) ;
	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "treville", true ) ;
	setIgnoreFreeze( "louisxiii", true ) ;

	setMissionFaceCharacter( name, "treville", "dartagnan" ) ;

	sayAndWait( "dartagnan", getString( "mr13d1" ) ) ;
	sayAndWait( "treville", getString( "mr13d2" ) ) ;
	sayAndWait( "louisxiii", getString( "mr13d3" ) ) ;
	sayAndWait( "treville", getString( "mr13d4" ) ) ;
	sayAndWait( "dartagnan", getString( "mr13d5" ) ) ;
	sayAndWait( "treville", getString( "mr13d6" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "treville", false ) ;
	setIgnoreFreeze( "louisxiii", false ) ;

	setMissionFaceDirection( name, "treville", 0, -1 ) ;

	-- Put Musks on horses waiting for the King and Treville
	setMissionFaceDirection( name, "athos", -1, -1 ) ;
	setMissionFaceDirection( name, "porthos", -1, -1 ) ;
	setMissionFaceDirection( name, "aramis", -1, -1 ) ;
	placeCharacter( "athos", "france", -7269, 9435 ) ;
	placeCharacter( "porthos", "france", -7239, 9405 ) ;
	placeCharacter( "aramis", "france", -7209, 9375 ) ;
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "porthos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "mr13m2" ), "athos" ) ;
	waitForTalkThree( "dartagnan", "athos", "porthos", "aramis", false ) ;
	removeMarker( name, marker ) ;
	
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "treville", true ) ;
	setIgnoreFreeze( "louisxiii", true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	
	local bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mr13d7" ) ) ;
	
	placeCharacter( "treville", "france", -7880, 9342 ) ;
	placeCharacter( "louisxiii", "france", -7950, 9342 ) ;
	
	setMissionFaceDirection( name, "treville", 1, 1 ) ;
	setMissionFaceDirection( name, "louisxiii", 1, 1 ) ;
	addGoalGetToPointInLevel( "treville", -7377, 9252, "france", false, true ) ;
	addGoalGetToPointInLevel( "louisxiii", -7467, 9252, "france", false, true ) ;
	
	waitForBubbleClosed( bubInd ) ;
	
	waitForNoGoal( "treville" ) ;
	waitForNoGoal( "louisxiii" ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "treville", false ) ;
	setIgnoreFreeze( "louisxiii", false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;

	setMissionChatString( name, "athos", getString( "mr12d44" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr12d44" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr12d44" ) ) ;

	setMissionChatString( name, "treville", getString( "mr12d44" ) ) ;
	setMissionChatString( name, "louisxiii", getString( "mr12d44" ) ) ;

	local overrideSaveID = createOverrideSavePos( "france", -8156, 9498 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -8596, 9435, -8482, 9763, -7617, 9204, -7539, 9537 },
		{ -7631, 9223, -7544, 9553, -6480, 8323, -6176, 8976 },
		{ -6485, 8356, -6191, 8974, -4037, 7886, -4026, 8796 },
		{ -4050, 7983, -4039, 8689, -2740, 7868, -2772, 8566 } ) ;
		
	local marker = addMarkerCharacter( name, true, getString( "mr13m3" ), "louisxiii" ) ;

	setMissionFaceDirection( name, "treville", 1, 1 ) ;
	addGoalGetToPointInLevel( "treville", -4283, 8216, "france", false, true ) ;
	wait( 0.5 ) ;
	setMissionFaceDirection( name, "louisxiii", 1, 1 ) ;
	addGoalGetToPointInLevel( "louisxiii", -4343, 8216, "france", false, true ) ;
	wait( 1 ) ;
	setMissionFaceDirection( name, "aramis", 1, 0 ) ;
	addGoalGetToPointInLevel( "aramis", -4093, 8227, "france", false, true ) ;
	wait( 0.5 ) ;
	setMissionFaceDirection( name, "porthos", 1, 0 ) ;
	addGoalGetToPointInLevel( "porthos", -4093, 8277, "france", false, true ) ;
	wait( 0.5 ) ;
	setMissionFaceDirection( name, "athos", 1, 0 ) ;
	addGoalGetToPointInLevel( "athos", -4093, 8327, "france", false, true ) ;

	waitForNoGoal( "treville" ) ;
	waitForNoGoal( "louisxiii" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "athos" ) ;

	local triggerArea = addTriggerArea( name, "", false, "france", { -4470, 8097, -3912, 8802 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -4234, 8266, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	unlockPlayerInPlace( ) ;

	setMissionChatFunction( name, "aramis", "chat_fight" ) ;
	setMissionChatFunction( name, "porthos", "chat_fight" ) ;
	setMissionChatFunction( name, "athos", "chat_fight" ) ;

	setMissionChatString( name, "treville", getString( "mr12d45" ) ) ;
	setMissionChatString( name, "louisxiii", getString( "mr12d45" ) ) ;

	local enemyDifficulty = 36 ; -- 34

	-- create enemy
	local enemy1 = createTempCharacter( getString( "highwayman" ), "france", -3815, 8200 ) ;
	setStatsCalculatorStatic( enemy1, enemyDifficulty, enemyDifficulty, enemyDifficulty, enemyDifficulty ) ;
	randomDressEnemy( enemy1, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy1, "sword_1" ) ;
	makeEnemies( enemy1, "dartagnan", "athos", "porthos", "aramis" ) ;
	local markerEnemy1 = addMarkerCharacter( name, true, getString( "fight" ), enemy1 ) ;
	
	local enemy2 = createTempCharacter( getString( "highwayman" ), "france", -3815, 8250 ) ;
	setStatsCalculatorStatic( enemy2, enemyDifficulty, enemyDifficulty, enemyDifficulty, enemyDifficulty ) ;
	randomDressEnemy( enemy2, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy2, "sword_1" ) ;
	makeEnemies( enemy2, "dartagnan", "athos", "porthos", "aramis" ) ;
	local markerEnemy2 = addMarkerCharacter( name, true, getString( "fight" ), enemy2 ) ;
	
	local enemy3 = createTempCharacter( getString( "highwayman" ), "france", -3815, 8300 ) ;
	setStatsCalculatorStatic( enemy3, enemyDifficulty, enemyDifficulty, enemyDifficulty, enemyDifficulty) ;
	randomDressEnemy( enemy3, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy3, "sword_1" ) ;
	makeEnemies( enemy3, "dartagnan", "athos", "porthos", "aramis" ) ;
	local markerEnemy3 = addMarkerCharacter( name, true, getString( "fight" ), enemy3 ) ;
	
	local enemy4 = createTempCharacter( getString( "highwayman" ), "france", -3815, 8350 ) ;
	setStatsCalculatorStatic( enemy4, enemyDifficulty, enemyDifficulty, enemyDifficulty, enemyDifficulty ) ;
	randomDressEnemy( enemy4, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy4, "sword_1" ) ;
	makeEnemies( enemy4, "dartagnan", "athos", "porthos", "aramis" ) ;
	local markerEnemy4 = addMarkerCharacter( name, true, getString( "fight" ), enemy4 ) ;
	
	local enemy5 = createTempCharacter( getString( "highwayman" ), "france", -3750, 8250 ) ;
	setStatsCalculatorStatic( enemy5, enemyDifficulty, enemyDifficulty, enemyDifficulty, enemyDifficulty ) ;
	randomDressEnemy( enemy5, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy5, "sword_1" ) ;
	makeEnemies( enemy5, "dartagnan", "athos", "porthos", "aramis" ) ;
	local markerEnemy5 = addMarkerCharacter( name, true, getString( "fight" ), enemy5 ) ;
	
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;
	waitUntilDead( enemy4 ) ;
	waitUntilDead( enemy5 ) ;	
	
	setMissionChatString( name, "athos", getString( "mr12d44" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr12d44" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr12d44" ) ) ;

	setMissionChatString( name, "treville", getString( "mr12d44" ) ) ;
	setMissionChatString( name, "louisxiii", getString( "mr12d44" ) ) ;
		
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -3022, 7914, -2961, 8551, -294, 7199, -99, 8204 },
		{ -1398, 7514, -487, 7268, -1905, 5749, -770, 5783 },
		{ -1558, 5780, -579, 5826, -1696, 4152, -633, 4165 } ) ;
		
	-- revive any dead musketeers
	reviveHelper3( "athos", "porthos", "aramis", true ) ;
	giveHealth( "athos", 200 ) ;
	giveHealth( "porthos", 200 ) ;
	giveHealth( "aramis", 200 ) ;
		
	addGoalDriveVehicle( "athos", getCharacterOwnedHorseName( "athos" ), true ) ;
	addGoalDriveVehicle( "porthos", getCharacterOwnedHorseName( "porthos" ), true ) ;
	addGoalDriveVehicle( "aramis", getCharacterOwnedHorseName( "aramis" ), true ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	


	-- second encounter
	local marker = addMarkerCharacter( name, true, getString( "mr13m3" ), "louisxiii" ) ;

	setMissionFaceDirection( name, "treville", 1, -1 ) ;
	addGoalGetToPointInLevel( "treville", -1247, 5600, "france", false, true ) ;
	wait( 0.5 ) ;
	setMissionFaceDirection( name, "louisxiii", 1, -1 ) ;
	addGoalGetToPointInLevel( "louisxiii", -1247, 5700, "france", false, true ) ;
	wait( 1 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
	addGoalGetToPointInLevel( "aramis", -1041, 5513, "france", false, true ) ;
	wait( 0.5 ) ;
	setMissionFaceDirection( name, "porthos", 0, -1 ) ;
	addGoalGetToPointInLevel( "porthos", -981, 5513, "france", false, true ) ;
	wait( 0.5 ) ;
	setMissionFaceDirection( name, "athos", 0, -1 ) ;
	addGoalGetToPointInLevel( "athos", -921, 5513, "france", false, true ) ;

	waitForNoGoal( "treville" ) ;
	waitForNoGoal( "louisxiii" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "athos" ) ;

	local triggerArea = addTriggerArea( name, "", false, "france", { -1343, 5446, -704, 5782 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;

	lockPlayerInPlace( ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -997, 5640, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	unlockPlayerInPlace( ) ;

	setMissionChatFunction( name, "aramis", "chat_fight" ) ;
	setMissionChatFunction( name, "porthos", "chat_fight" ) ;
	setMissionChatFunction( name, "athos", "chat_fight" ) ;

	setMissionChatString( name, "treville", getString( "mr12d45" ) ) ;
	setMissionChatString( name, "louisxiii", getString( "mr12d45" ) ) ;

	-- create enemy
	local enemy1 = createTempCharacter( getString( "highwayman" ), "france", -1346, 5170 ) ;
	setStatsCalculatorStatic( enemy1, enemyDifficulty, enemyDifficulty, enemyDifficulty, enemyDifficulty ) ;
	randomDressEnemy( enemy1, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy1, "sword_1" ) ;
	makeEnemies( enemy1, "dartagnan", "athos", "porthos", "aramis" ) ;
	local markerEnemy1 = addMarkerCharacter( name, true, getString( "fight" ), enemy1 ) ;
	
	local enemy2 = createTempCharacter( getString( "highwayman" ), "france", -1306, 5170 ) ;
	setStatsCalculatorStatic( enemy2, enemyDifficulty, enemyDifficulty, enemyDifficulty, enemyDifficulty ) ;
	randomDressEnemy( enemy2, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy2, "sword_1" ) ;
	makeEnemies( enemy2, "dartagnan", "athos", "porthos", "aramis" ) ;
	local markerEnemy2 = addMarkerCharacter( name, true, getString( "fight" ), enemy2 ) ;
	
	local enemy3 = createTempCharacter( getString( "highwayman" ), "france", -1266, 5170 ) ;
	setStatsCalculatorStatic( enemy3, enemyDifficulty, enemyDifficulty, enemyDifficulty, enemyDifficulty ) ;
	randomDressEnemy( enemy3, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy3, "sword_1" ) ;
	makeEnemies( enemy3, "dartagnan", "athos", "porthos", "aramis" ) ;
	local markerEnemy3 = addMarkerCharacter( name, true, getString( "fight" ), enemy3 ) ;
	
	local enemy4 = createTempCharacter( getString( "highwayman" ), "france", -1226, 5170 ) ;
	setStatsCalculatorStatic( enemy4, enemyDifficulty, enemyDifficulty, enemyDifficulty, enemyDifficulty ) ;
	randomDressEnemy( enemy4, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy4, "sword_1" ) ;
	makeEnemies( enemy4, "dartagnan", "athos", "porthos", "aramis" ) ;
	local markerEnemy4 = addMarkerCharacter( name, true, getString( "fight" ), enemy4 ) ;
	
	local enemy5 = createTempCharacter( getString( "highwayman" ), "france", -1186, 5170 ) ;
	setStatsCalculatorStatic( enemy5, enemyDifficulty, enemyDifficulty, enemyDifficulty, enemyDifficulty) ; -- 34, 34, 34, 34
	randomDressEnemy( enemy5, 0.0, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy5, "sword_1" ) ;
	makeEnemies( enemy5, "dartagnan", "athos", "porthos", "aramis" ) ;
	local markerEnemy5 = addMarkerCharacter( name, true, getString( "fight" ), enemy5 ) ;
	
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;
	waitUntilDead( enemy4 ) ;
	waitUntilDead( enemy5 ) ;	
	
	setMissionChatString( name, "athos", getString( "mr12d46" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr12d46" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr12d46" ) ) ;

	setMissionChatString( name, "treville", getString( "mr12d46" ) ) ;
	setMissionChatString( name, "louisxiii", getString( "mr12d46" ) ) ;
		
	setOverrideSaveArea( overrideSaveID, "france", 
		{ -1082, 4173, -460, 4753, -338, 3217, 587, 3700 },
		{ -338, 3217, 587, 3700, 390, 2010, 1423, 2063 },
		{ 390, 2010, 1423, 2063, 1152, 195, 598, 682 },
		{ 1144, 190, 1039, 605, -316, 103, -317, 555 } ) ;
	
	-- revive any dead musketeers
	reviveHelper3( "athos", "porthos", "aramis", true ) ;
	
	addGoalDriveVehicle( "athos", getCharacterOwnedHorseName( "athos" ), true ) ;
	addGoalDriveVehicle( "porthos", getCharacterOwnedHorseName( "porthos" ), true ) ;
	addGoalDriveVehicle( "aramis", getCharacterOwnedHorseName( "aramis" ), true ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
		
	
	
	-- go to louvre
	local marker = addMarkerCharacter( name, true, getString( "mr13m3" ), "louisxiii" ) ;

	setMissionFaceDirection( name, "treville", 1, 0 ) ;
	addGoalGetToPointInLevel( "treville", -220, 321, "france", false, true ) ;
	wait( 0.5 ) ;
	setMissionFaceDirection( name, "louisxiii", 1, 0 ) ;
	addGoalGetToPointInLevel( "louisxiii", -220, 381, "france", false, true ) ;
	wait( 1 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
	addGoalGetToPointInLevel( "aramis", -59, 437, "france", false, true ) ;
	wait( 0.5 ) ;
	setMissionFaceDirection( name, "porthos", 0, -1 ) ;
	addGoalGetToPointInLevel( "porthos", 0, 437, "france", false, true ) ;
	wait( 0.5 ) ;
	setMissionFaceDirection( name, "athos", 0, -1 ) ;
	addGoalGetToPointInLevel( "athos", 60, 437, "france", false, true ) ;

	waitForNoGoal( "treville" ) ;
	waitForNoGoal( "louisxiii" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "athos" ) ;
	
	local triggerArea = addTriggerArea( name, "", false, "france", { -347, 121, 189, 469 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "treville", true ) ;
	setIgnoreFreeze( "louisxiii", true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
		
	setStateMessageIdle( "dartagnan" ) ;
	setMissionFaceDirection( name, "dartagnan", -1, 0 ) ;
	addGoalGetToPointInLevel( "dartagnan", 0, 333, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	sayAndWait( "treville", getString( "mr13d8" ) ) ;
	
	removeDriver( "trevillehorse1", "treville" ) ;
	removeDriver( "kinghorse1", "louisxiii" ) ;
	addGoalGetToPointInLevel( "treville", -108, 96, "louvrehouse", false, true ) ;
	addGoalGetToPointInLevel( "louisxiii", -60, 96, "louvrehouse", false, true ) ;
	
	while ( isCharacterOnScreen( "louisxiii" )
		or  isCharacterOnScreen( "treville" ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "louisxiii" ) ;
	clearGoals( "treville" ) ;
	
	local tenseMusicID = addMusic( "intense", 15 ) ;
		
	-- go to comic
	-- fade to black	
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	-- show comic
	local comic1 = createComic( "milady3" ) ;

	addText( comic1, getString( "milady3_d1" ), 96, 5, 308, 60 ) ;
	addText( comic1, getString( "milady3_d2" ), 110, 221, 307, 292 ) ;
	addText( comic1, getString( "milady3_d3" ), 323, 5, 518, 35 ) ;
	addText( comic1, getString( "milady3_d4" ), 323, 150, 500, 184 ) ;
	addText( comic1, getString( "milady3_d5" ), 534, 5, 703, 70 ) ;
	addText( comic1, getString( "milady3_d6" ), 558, 212, 681, 243 ) ;
	addText( comic1, getString( "milady3_d7" ), 115, 307, 252, 358 ) ;
	addText( comic1, getString( "milady3_d8" ), 83, 508, 196, 550 ) ;
	addText( comic1, getString( "milady3_d9" ), 277, 354, 435, 396 ) ;
	addText( comic1, getString( "milady3_d10" ), 670, 306, 781, 372 ) ;
	addText( comic1, getString( "milady3_d11" ), 593, 500, 718, 538 ) ;

	addMouseOver( comic1, getString( "felton" ), 12, 23, 155, 275, 81, 35 ) ;
	addMouseOver( comic1, getString( "milady" ), 164, 64, 305, 223, 223, 70 ) ;
	
	addMouseOver( comic1, getString( "milady" ), 499, 52, 525, 82, 518, 54 ) ;
	addMouseOver( comic1, getString( "lordwinter" ), 326, 47, 380, 139, 349, 49 ) ;
	addMouseOver( comic1, getString( "felton" ), 395, 60, 445, 137, 409, 63 ) ;

	addMouseOver( comic1, getString( "felton" ), 468, 180, 520, 225, 502, 186 ) ;
	addMouseOver( comic1, getString( "milady" ), 363, 186, 425, 291, 393, 192 ) ;

	addMouseOver( comic1, getString( "felton" ), 648, 96, 694, 271, 673, 100 ) ;
	addMouseOver( comic1, getString( "milady" ), 711, 103, 789, 276, 733, 103 ) ;

	addMouseOver( comic1, getString( "milady" ), 78, 318, 109, 347, 98, 321 ) ;
	addMouseOver( comic1, getString( "felton" ), 45, 369, 100, 588, 79, 374 ) ;
	addMouseOver( comic1, getString( "buckingham" ), 177, 367, 256, 592, 207, 369 ) ;

	addMouseOver( comic1, getString( "milady" ), 317, 317, 364, 348, 342, 317 ) ;
	addMouseOver( comic1, getString( "laporte" ), 478, 324, 518, 424, 496, 326 ) ;
	addMouseOver( comic1, getString( "felton" ), 323, 397, 422, 581, 394, 400 ) ;
	addMouseOver( comic1, getString( "buckingham" ), 418, 408, 522, 569, 439, 412 ) ;

	addMouseOver( comic1, getString( "milady" ), 574, 316, 604, 347, 581, 320 ) ;
	addMouseOver( comic1, getString( "laporte" ), 747, 392, 798, 465, 769, 394 ) ;
	addMouseOver( comic1, getString( "buckingham" ), 717, 442, 798, 542, 736, 445 ) ;
	addMouseOver( comic1, getString( "felton" ), 625, 400, 713, 588, 669, 405 ) ;
	
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end

	removeMusic( tenseMusicID ) ;
	
	-- fade from black	
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	sayAndWait( "dartagnan", getString( "mr13d9" ) ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "treville", false ) ;
	setIgnoreFreeze( "louisxiii", false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	
	giveHealth( "athos", 200 ) ;
	giveHealth( "porthos", 200 ) ;
	giveHealth( "aramis", 200 ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
	
	completeMission( name ) ;
	activateMission( "missionrochelle14" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle14( name )
	-- Go part way to Bethune, show clip of Milady and Rochefort at Bethune convent
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "athos", getString( "mr13d10" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr13d10" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr13d10" ) ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", 6562, -11154 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 5707, -13094, 7923, -10464 } ) ;
			
	setCharacterOverrideName( "rochefort", true, getString( "rochefortunknown" ) ) ;
		
	place_grimaudA( "grimaud" ) ;
	place_mousquetonA( "mousqueton" ) ;
	place_bazinA( "bazin" ) ;
	
	ensureCharacterAroundPoint( "athos", "france", -59, 437, 200 ) ;
	ensureCharacterAroundPoint( "porthos", "france", 0, 437, 200 ) ;
	ensureCharacterAroundPoint( "aramis", "france", 60, 437, 200 ) ;
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "porthos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;
	
	local markerPosX = 6950 ;
	local markerPosY = -11896 ;
	local marker = addMarkerPosition( name, true, getString( "mr14m1" ), "france", markerPosX, markerPosY ) ;
	local destPosX = markerPosX ;
	local destPosY = markerPosY ;

	-- trigger in front of Aramis' place
	local triggerArea = addTriggerArea( name, "", false, "france", { 6508, -12136, 7701, -11547 } ) ;
		
	local athosDestPosX = 6850 ;
	local athosDestPosY = -11826 ;

	local porthosDestPosX = 6900 ;
	local porthosDestPosY = -11826 ;

	local aramisDestPosX = 6950 ;
	local aramisDestPosY = -11826 ;
	
	local startDist = 150 ;
	local stopDist = 100 ;
	local athosStartDist = startDist ;
	local athosStopDist = stopDist ;
	local porthosStartDist = startDist + 75 ;
	local porthosStopDist = stopDist + 85 ;
	local aramisStartDist = startDist + 150 ;
	local aramisStopDist = stopDist + 140 ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	
	while( not triggerAreaTriggered( triggerArea ) ) do
		local playerDestDist = distanceToPoint( "dartagnan", "france", destPosX, destPosY ) ;
		local aheadOfAthos = distanceToPoint( "athos", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfPorthos = distanceToPoint( "porthos", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfAramis = distanceToPoint( "aramis", "france", destPosX, destPosY ) - playerDestDist ;
		
		-- Athos
		if ( aheadOfAthos > athosStartDist ) then
			-- start going
			if ( not characterHasGoal( "athos" ) ) then
				addGoalGetToPointInLevel( "athos", athosDestPosX, athosDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfAthos < athosStopDist ) then
			-- stop going
			clearGoals( "athos" ) ;
			setStateMessageIdle( "athos" ) ;
		end
		
		-- Porthos
		if ( aheadOfPorthos > porthosStartDist ) then
			-- start going
			if ( not characterHasGoal( "porthos" ) ) then
				addGoalGetToPointInLevel( "porthos", porthosDestPosX, porthosDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfPorthos < porthosStopDist ) then
			-- stop going
			clearGoals( "porthos" ) ;
			setStateMessageIdle( "porthos" ) ;
		end
		
		-- Aramis
		if ( aheadOfAramis > aramisStartDist ) then
			-- start going
			if ( not characterHasGoal( "aramis" ) ) then
				addGoalGetToPointInLevel( "aramis", aramisDestPosX, aramisDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfAramis < aramisStopDist ) then
			-- stop going
			clearGoals( "aramis" ) ;
			setStateMessageIdle( "aramis" ) ;
		end
		
		coroutine.yield( ) ;
	end

	if ( not characterHasGoal( "athos" ) ) then
		addGoalGetToPointInLevel( "athos", athosDestPosX, athosDestPosY, "france", true, true ) ;
	end
	if ( not characterHasGoal( "porthos" ) ) then
		addGoalGetToPointInLevel( "porthos", porthosDestPosX, porthosDestPosY, "france", true, true ) ;
	end
	if ( not characterHasGoal( "aramis" ) ) then
		addGoalGetToPointInLevel( "aramis", aramisDestPosX, aramisDestPosY, "france", true, true ) ;
	end
	
	setMissionFaceDirection( name, "athos", 0, -1 ) ;
	setMissionFaceDirection( name, "porthos", 0, -1 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
	
	
	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "constance", true ) ;
	setIgnoreFreeze( "bethuneabbess", true ) ;
	setIgnoreFreeze( "milady", true ) ;
	setIgnoreFreeze( "rochefort", true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", destPosX, destPosY, "france", true, true ) ;
	
	waitForNoGoal( "dartagnan" ) ;
	
	-- make sure athos, porthos, and aramis aren't too far away
	if ( not isCharacterOnScreen( "athos" ) ) then
		placeCharacter( "athos", "france", 6700, -11482 ) ;
	end
	if ( not isCharacterOnScreen( "porthos" ) ) then
		placeCharacter( "porthos", "france", 6770, -11482 ) ;
	end
	if ( not isCharacterOnScreen( "aramis" ) ) then
		placeCharacter( "aramis", "france", 6850, -11482 ) ;
	end
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionFaceDirection( name, "bethuneabbess", 0, 1 ) ;
	placeCharacter( "bethuneabbess", "bethuneconventhouse", -56, 104 ) ;
	
	setMissionFaceDirection( name, "constance", 0, 1 ) ;
	placeCharacter( "constance", "bethuneconventhouse", 77, -395 ) ;	
	
	stopCameraFollowCharacter( ) ;
	setActiveLevel( "bethuneconventhouse" ) ;
	setCameraTo( -59, 128 ) ;

	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	placeCharacterInDoor( "milady", "bethuneconventin1", false ) ;
	setMissionFaceDirection( name, "milady", 0, -1 ) ;
	addGoalGetToPointInLevel( "milady", -59, 220, "bethuneconventhouse", false, true ) ;
	waitForNoGoal( "milady" ) ;
	
	local bubInd = characterThink( "milady", true, -1, -1, true, getString( "mr14d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	addGoalGetToPointInLevel( "milady", -56, 160, "bethuneconventhouse", false, true ) ;
	
	waitForNoGoal( "milady" ) ;
	sayAndWait( "milady", getString( "mr14d2" ) ) ;
	sayAndWait( "bethuneabbess", getString( "mr14d3" ) ) ;
	sayAndWait( "milady", getString( "mr14d4" ) ) ;
	sayAndWait( "bethuneabbess", getString( "mr14d5" ) ) ;
	
	setMissionFaceCharacter( name, "bethuneabbess", "milady" ) ;
	
	setCameraFollowCharacter( "milady", true ) ;
	
	setMissionFaceDirection( name, "milady", 0, -1 ) ;
	addGoalGetToPointInLevel( "milady", 77, -340, "bethuneconventhouse", false, true ) ;
	waitForNoGoal( "milady" ) ;
	
	sayAndWait( "milady", getString( "mr14d6" ) ) ;
	
	addHeartMaker( "constance" ) ;
	sayAndWait( "constance", getString( "mr14d7" ) ) ;
	removeHeartMaker( "constance" ) ;
	
	local bubInd = characterThink( "milady", true, -1, -1, true, getString( "mr14d8" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	-- start abbess walking up
	setMissionFaceDirection( name, "bethuneabbess", 0, -1 ) ;
	placeCharacter( "bethuneabbess", "bethuneconventhouse", 142, 30 ) ;
	addGoalGetToPointInLevel( "bethuneabbess", 71, -288, "bethuneconventhouse", false, true ) ;
	
	sayAndWait( "milady", getString( "mr14d9" ) ) ;
	
	setMissionFaceCharacter( name, "milady", "bethuneabbess" ) ;
	
	waitForNoGoal( "bethuneabbess" ) ;

	sayAndWait( "bethuneabbess", getString( "mr14d10" ) ) ;
	sayAndWait( "milady", getString( "mr14d11" ) ) ;

	setMissionFaceDirection( name, "rochefort", 1, 0 ) ;
	placeCharacter( "rochefort", "bethuneconventhouse", -85, 106 ) ;
	
	setMissionFaceDirection( name, "bethuneabbess", 0, 1 ) ;
	addGoalGetToPointInLevel( "bethuneabbess", 150, -241, "bethuneconventhouse", false, true ) ;
	
	setMissionFaceDirection( name, "milady", -1, 0 ) ;
	addGoalGetToPointInLevel( "milady", -45, 106, "bethuneconventhouse", false, true ) ;
	waitForNoGoal( "milady" ) ;

	sayAndWait( "rochefort", getString( "mr14d12" ) ) ;
	sayAndWait( "milady", getString( "mr14d13" ) ) ;
	sayAndWait( "rochefort", getString( "mr14d14" ) ) ;
	sayAndWait( "milady", getString( "mr14d15" ) ) ;
	sayAndWait( "rochefort", getString( "mr14d16" ) ) ;
	
	playSound( "writing", 1.0 ) ;
	sayAndWait( "milady", getString( "mr14d17" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	sayAndWait( "rochefort", getString( "mr14d18" ) ) ;
	sayAndWait( "milady", getString( "mr14d19" ) ) ;
	sayAndWait( "rochefort", getString( "mr14d20" ) ) ;
	sayAndWait( "milady", getString( "mr14d21" ) ) ;
	sayAndWait( "rochefort", getString( "mr14d22" ) ) ;
	
	addGoalGetToPointInLevel( "rochefort", -62, 235, "bethuneconventhouse", false, true ) ;
	wait( 0.5 ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	clearGoals( "rochefort" ) ;
	place_rochefortA( "rochefort" ) ;
	place_miladyA( "milady" ) ;
	
	setCameraFollowCharacter( "dartagnan", true ) ;
		
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "constance", false ) ;
	setIgnoreFreeze( "bethuneabbess", false ) ;
	setIgnoreFreeze( "milady", false ) ;
	setIgnoreFreeze( "rochefort", false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	
	setCharacterOverrideName( "rochefort", false, getString( "unknownname" ) ) ;
	
	removeOverrideSavePos( overrideSaveID ) ;
		
	completeMission( name ) ;
	activateMission( "missionrochelle15" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle15( name )
	-- Go towards Bethune, see Rochefort drop note
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "athos", getString( "mr13d10" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr13d10" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr13d10" ) ) ;

	local overrideSaveID = createOverrideSavePos( "france", 8252, -16451 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 7986, -18797, 11166, -16038 } ) ;

	setCharacterOverrideName( "rochefort", true, getString( "rochefortunknown" ) ) ;

	setInventoryItem( "letter_armentieres", 0 ) ;

	placeVehicle( "rocheforthorse1", "france", 9040, -17252 ) ;
	lockHorseMovement( "rocheforthorse1", true ) ;

	ensureCharacterAroundPoint( "athos", "france", 6850, -11826, 200 ) ;
	ensureCharacterAroundPoint( "porthos", "france", 6900, -11826, 200 ) ;
	ensureCharacterAroundPoint( "aramis", "france", 6950, -11826, 200 ) ;
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "porthos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;
	
	local markerPosX = 9318 ;
	local markerPosY = -17397 ;
	local marker = addMarkerPosition( name, true, getString( "mr14m1" ), "france", markerPosX, markerPosY ) ;
	local destPosX = markerPosX ;
	local destPosY = markerPosY ;

	-- trigger in front of Aramis' place
	local triggerArea = addTriggerArea( name, "", false, "france", { 8643, -17842, 9924, -16972 } ) ;
		
	local athosDestPosX = 9300 ;
	local athosDestPosY = -17527 ;

	local porthosDestPosX = 9350 ;
	local porthosDestPosY = -17527 ;

	local aramisDestPosX = 9400 ;
	local aramisDestPosY = -17527 ;
	
	local startDist = 150 ;
	local stopDist = 100 ;
	local athosStartDist = startDist ;
	local athosStopDist = stopDist ;
	local porthosStartDist = startDist + 75 ;
	local porthosStopDist = stopDist + 85 ;
	local aramisStartDist = startDist + 150 ;
	local aramisStopDist = stopDist + 140 ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	
	while( not triggerAreaTriggered( triggerArea ) ) do
		local playerDestDist = distanceToPoint( "dartagnan", "france", destPosX, destPosY ) ;
		local aheadOfAthos = distanceToPoint( "athos", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfPorthos = distanceToPoint( "porthos", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfAramis = distanceToPoint( "aramis", "france", destPosX, destPosY ) - playerDestDist ;
		
		-- Athos
		if ( aheadOfAthos > athosStartDist ) then
			-- start going
			if ( not characterHasGoal( "athos" ) ) then
				addGoalGetToPointInLevel( "athos", athosDestPosX, athosDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfAthos < athosStopDist ) then
			-- stop going
			clearGoals( "athos" ) ;
			setStateMessageIdle( "athos" ) ;
		end
		
		-- Porthos
		if ( aheadOfPorthos > porthosStartDist ) then
			-- start going
			if ( not characterHasGoal( "porthos" ) ) then
				addGoalGetToPointInLevel( "porthos", porthosDestPosX, porthosDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfPorthos < porthosStopDist ) then
			-- stop going
			clearGoals( "porthos" ) ;
			setStateMessageIdle( "porthos" ) ;
		end
		
		-- Aramis
		if ( aheadOfAramis > aramisStartDist ) then
			-- start going
			if ( not characterHasGoal( "aramis" ) ) then
				addGoalGetToPointInLevel( "aramis", aramisDestPosX, aramisDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfAramis < aramisStopDist ) then
			-- stop going
			clearGoals( "aramis" ) ;
			setStateMessageIdle( "aramis" ) ;
		end
		
		coroutine.yield( ) ;
	end

	if ( not characterHasGoal( "athos" ) ) then
		addGoalGetToPointInLevel( "athos", athosDestPosX, athosDestPosY, "france", true, true ) ;
	end
	if ( not characterHasGoal( "porthos" ) ) then
		addGoalGetToPointInLevel( "porthos", porthosDestPosX, porthosDestPosY, "france", true, true ) ;
	end
	if ( not characterHasGoal( "aramis" ) ) then
		addGoalGetToPointInLevel( "aramis", aramisDestPosX, aramisDestPosY, "france", true, true ) ;
	end
	
	setMissionFaceDirection( name, "athos", 0, 1 ) ;
	setMissionFaceDirection( name, "porthos", 0, 1 ) ;
	setMissionFaceDirection( name, "aramis", 0, 1 ) ;
	setMissionFaceDirection( name, "dartagnan", -1, 1 ) ;
	
	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "rochefort", true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", destPosX, destPosY, "france", true, true ) ;
	
	waitForNoGoal( "dartagnan" ) ;
	
	-- make sure athos, porthos, and aramis aren't too far away
	if ( not isCharacterOnScreen( "athos" ) ) then
		placeCharacter( "athos", "france", 8900, -16897 ) ;
	end
	if ( not isCharacterOnScreen( "porthos" ) ) then
		placeCharacter( "porthos", "france", 8950, -16897 ) ;
	end
	if ( not isCharacterOnScreen( "aramis" ) ) then
		placeCharacter( "aramis", "france", 9000, -16897 ) ;
	end
		
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	
	-- move camera to show rochefort
	stopCameraFollowCharacter( ) ;
	panCameraToWait( 9177, -17332, 400, true ) ;
	
	-- see rochefort come from inn and drop letter
	placeCharacterInDoor( "rochefort", "hersedorhousebout", false ) ;
	lockHorseMovement( "rocheforthorse1", false ) ;
	
	addGoalDriveVehicle( "rochefort", "rocheforthorse1", true ) ;
	waitForNoGoal( "rochefort" ) ;
	
	local bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "mr15d1" ) ) ;
	
	-- drop note
	local rochefortX, rochefortY = getCharacterPos( "rochefort" ) ;
	createItem( "la1", "letter_armentieres", "france", rochefortX, rochefortY, true ) ;
	
	addGoalGetToPointInLevel( "rochefort", 8052, -16405, "france", false, true ) ;
	
	waitForBubbleClosed( bubInd ) ;
	sayAndWait( "aramis", getString( "mr15d2" ) ) ;
	sayAndWait( "dartagnan", getString( "mr15d3" ) ) ;
		
	while ( isCharacterOnScreen( "rochefort" ) ) do
		coroutine.yield( ) ;
	end
	
	setCameraFollowCharacter( "dartagnan", true ) ;
		
	setMissionFaceNone( name, "dartagnan" ) ;

	-- put rochefort out of way
	clearGoals( "rochefort" ) ;
	removeDriver( "rocheforthorse1", "rochefort" ) ;
	placeVehicle( "rocheforthorse1", "france", -30000, 0 ) ;
	place_rochefortA( "rochefort" ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "rochefort", false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	
	setMissionChatString( name, "athos", getString( "mr13d11" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr13d11" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr13d11" ) ) ;
	
	addMarkerPickUp( name, true, getString( "mr15m1" ), "la1" ) ;
	while ( numOfItemType( "letter_armentieres" ) < 1 ) do
		coroutine.yield( ) ;
	end
	
	setStateMessageIdle( "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "porthos" ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	addGoalGetToPointInLevel( "athos", 9234, -17269, "france", false, true ) ;
	addGoalGetToPointInLevel( "porthos", 9234, -17209, "france", false, true ) ;
	addGoalGetToPointInLevel( "aramis", 9234, -17149, "france", false, true ) ;
	
		
	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
		
	playSound( "paper", 1.0 ) ;
	sayAndWait( "dartagnan", getString( "mr15d4" ) ) ;
	sayAndWait( "athos", getString( "mr15d5" ) ) ;
	sayAndWait( "dartagnan", getString( "mr15d6" ) ) ;
	
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	
	setCharacterOverrideName( "rochefort", false, getString( "unknownname" ) ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
			
	completeMission( name ) ;
	activateMission( "missionrochelle16" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle16( name )
	-- Get to convent, Constance dies
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "athos", getString( "mr13d12" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr13d12" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr13d12" ) ) ;

	local overrideSaveID = createOverrideSavePos( "france", 9245, -19799 ) ;
	setOverrideSaveLevel( overrideSaveID, "bethuneconventhouse" ) ;

	-- unlock door to convent
	local doorLockA = addDoorLock( name, "", false, "bethuneconventout1" ) ;
		
	ensureCharacterAroundPoint( "athos", "france", 9234, -17269, 200 ) ;
	ensureCharacterAroundPoint( "porthos", "france", 9234, -17209, 200 ) ;
	ensureCharacterAroundPoint( "aramis", "france", 9234, -17149, 200 ) ;
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "porthos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;

	local marker = addMarkerPosition( name, true, getString( "mr14m1" ), "bethuneconventhouse", -53, 184 ) ;
	
	
	
	local destPosX = 9247 ;
	local destPosY = -19855 ;
	
	local athosDestPosX = 9200 ;
	local athosDestPosY = -19800 ;

	local porthosDestPosX = 9270 ;
	local porthosDestPosY = -19800 ;

	local aramisDestPosX = 9340 ;
	local aramisDestPosY = -19800 ;
	
	local startDist = 150 ;
	local stopDist = 100 ;
	local athosStartDist = startDist ;
	local athosStopDist = stopDist ;
	local porthosStartDist = startDist + 75 ;
	local porthosStopDist = stopDist + 85 ;
	local aramisStartDist = startDist + 150 ;
	local aramisStopDist = stopDist + 140 ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	
	while( not ( getCharacterFunctionalLevel( "dartagnan" ) == "bethuneconventhouse" ) ) do
		local playerDestDist = distanceToPoint( "dartagnan", "france", destPosX, destPosY ) ;
		local aheadOfAthos = distanceToPoint( "athos", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfPorthos = distanceToPoint( "porthos", "france", destPosX, destPosY ) - playerDestDist ;
		local aheadOfAramis = distanceToPoint( "aramis", "france", destPosX, destPosY ) - playerDestDist ;
		
		-- Athos
		if ( aheadOfAthos > athosStartDist ) then
			-- start going
			if ( not characterHasGoal( "athos" ) ) then
				addGoalGetToPointInLevel( "athos", athosDestPosX, athosDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfAthos < athosStopDist ) then
			-- stop going
			clearGoals( "athos" ) ;
			setStateMessageIdle( "athos" ) ;
		end
		
		-- Porthos
		if ( aheadOfPorthos > porthosStartDist ) then
			-- start going
			if ( not characterHasGoal( "porthos" ) ) then
				addGoalGetToPointInLevel( "porthos", porthosDestPosX, porthosDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfPorthos < porthosStopDist ) then
			-- stop going
			clearGoals( "porthos" ) ;
			setStateMessageIdle( "porthos" ) ;
		end
		
		-- Aramis
		if ( aheadOfAramis > aramisStartDist ) then
			-- start going
			if ( not characterHasGoal( "aramis" ) ) then
				addGoalGetToPointInLevel( "aramis", aramisDestPosX, aramisDestPosY, "france", true, true ) ;
			end
		end
		if ( aheadOfAramis < aramisStopDist ) then
			-- stop going
			clearGoals( "aramis" ) ;
			setStateMessageIdle( "aramis" ) ;
		end
		
		coroutine.yield( ) ;
	end

	removeMarker( name, marker ) ;
	
	lockPlayerInPlace( ) ;
	
	--local loveMusicID = addMusic( "love", 15 ) ;
		
	local comic1 = createComic( "constance3" ) ;

	addText( comic1, getString( "constance3_d1" ), 104, 40, 200, 72 ) ;
	addText( comic1, getString( "constance3_d2" ), 5, 250, 167, 293 ) ;
	addText( comic1, getString( "constance3_d3" ), 305, 11, 460, 51 ) ;
	addText( comic1, getString( "constance3_d4" ), 394, 250, 565, 293 ) ;
	addText( comic1, getString( "constance3_d5" ), 587, 11, 703, 97 ) ;
	addText( comic1, getString( "constance3_d6" ), 5, 315, 112, 347 ) ;
	addText( comic1, getString( "constance3_d7" ), 5, 461, 166, 540 ) ;
	addText( comic1, getString( "constance3_d8" ), 257, 315, 384, 377 ) ;
	addText( comic1, getString( "constance3_d9" ), 261, 491, 414, 569 ) ;
	addText( comic1, getString( "constance3_d10" ), 458, 543, 538, 565 ) ;
	addText( comic1, getString( "constance3_d11" ), 593, 322, 778, 355 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 46, 80, 71, 126, 57, 80 ) ;
	addMouseOver( comic1, getString( "milady" ), 73, 95, 163, 280, 108, 93 ) ;
	addMouseOver( comic1, getString( "constance" ), 144, 161, 225, 292, 187, 162 ) ;

	addMouseOver( comic1, getString( "milady" ), 418, 30, 559, 245, 494, 39 ) ;
	addMouseOver( comic1, getString( "constance" ), 257, 50, 401, 294, 303, 57 ) ;

	addMouseOver( comic1, getString( "milady" ), 723, 47, 783, 140, 758, 50 ) ;
	addMouseOver( comic1, getString( "constance" ), 606, 153, 713, 295, 647, 159 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 102, 315, 181, 473, 137, 317 ) ;
	addMouseOver( comic1, getString( "constance" ), 164, 452, 243, 593, 212, 457 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 335, 359, 443, 525, 397, 365 ) ;
	addMouseOver( comic1, getString( "constance" ), 407, 414, 498, 592, 463, 419 ) ;

	addMouseOver( comic1, getString( "dartagnan" ), 655, 406, 739, 548, 715, 404 ) ;
	addMouseOver( comic1, getString( "constance" ), 718, 432, 787, 588, 759, 430 ) ;
	
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;

	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	
		-- hack to stop flicker on return
		setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
		setFadeFull( ) ;
		--fadeFromColour( 0.5 ) ;
	end
	
	--removeMusic( loveMusicID ) ;
	
	-- put all Musketeers and Constance inside
	setMissionFaceDirection( name, "constance", 1, 1 ) ;
	placeCharacter( "constance", "bethuneconventhouse", -41, 94 ) ;
	takeDamage( "constance", 200 ) ;
	
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	placeCharacter( "dartagnan", "bethuneconventhouse", -2, 76 ) ;
	
	clearGoals( "athos" ) ;
	clearGoals( "porthos" ) ;
	clearGoals( "aramis" ) ;
	removeDriver( getCharacterOwnedHorseName( "athos" ), "athos" ) ;
	removeDriver( getCharacterOwnedHorseName( "porthos" ), "porthos" ) ;
	removeDriver( getCharacterOwnedHorseName( "aramis" ), "aramis" ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	placeCharacter( "athos", "bethuneconventhouse", -113, 100 ) ;
	placeCharacter( "porthos", "bethuneconventhouse", -95, 132 ) ;
	placeCharacter( "aramis", "bethuneconventhouse", -63, 146 ) ;
	
	-- wait for death animation
	local seconds = 0.5 ;
	local count = 0.0 ;
	while ( count < seconds ) do
		coroutine.yield( ) ;
		count = count + getDeltaT( ) ;
		setFadeFull( ) ;
	end
	
	moveCameraToDest( ) ;
		
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	wait( 1 ) ;
	
	sayAndWait( "dartagnan", getString( "mr16d1" ) ) ;
	sayAndWait( "athos", getString( "mr16d2" ) ) ;
	
	setMissionFaceCharacter( name, "lordwinter", "dartagnan" ) ; 
	placeCharacterInDoor( "lordwinter", "bethuneconventin1", false ) ;
	addGoalGetToPointInLevel( "lordwinter", -14, 171, "bethuneconventhouse", false ) ;
	waitForNoGoal( "lordwinter" ) ;

	placeCharacter( "bethuneabbess", "bethuneconventhouse", 68, -294 ) ;
	setMissionFaceDirection( name, "bethuneabbess", -1, 0 ) ;
	addGoalGetToPointInLevel( "bethuneabbess", 46, 93, "bethuneconventhouse", false, true ) ;

	setMissionFaceCharacter( name, "dartagnan", "lordwinter" ) ;
	setMissionFaceCharacter( name, "athos", "lordwinter" ) ;
	setMissionFaceCharacter( name, "porthos", "lordwinter" ) ;
	setMissionFaceCharacter( name, "aramis", "lordwinter" ) ;
	sayAndWait( "lordwinter", getString( "mr16d3" ) ) ;
	sayAndWait( "dartagnan", getString( "mr16d4" ) ) ;
	sayAndWait( "lordwinter", getString( "mr16d5" ) ) ;
	sayAndWait( "porthos", getString( "mr16d6" ) ) ;

	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	setMissionFaceCharacter( name, "lordwinter", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mr16d7" ) ) ;

	setMissionFaceCharacter( name, "athos", "aramis" ) ;
	setMissionFaceCharacter( name, "porthos", "aramis" ) ;
	setMissionFaceCharacter( name, "dartagnan", "aramis" ) ;
	setMissionFaceCharacter( name, "lordwinter", "aramis" ) ;
	sayAndWait( "aramis", getString( "mr16d8" ) ) ;

	setMissionFaceCharacter( name, "porthos", "athos" ) ;
	setMissionFaceCharacter( name, "aramis", "athos" ) ;
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	setMissionFaceCharacter( name, "lordwinter", "athos" ) ;
	sayAndWait( "athos", getString( "mr16d9" ) ) ;
	sayAndWait( "dartagnan", getString( "mr16d10" ) ) ;
	sayAndWait( "athos", getString( "mr16d11" ) ) ;
	addGoalGetToPointInLevel( "athos", 9241, -19882, "france", false, true ) ;

	waitForNoGoal( "bethuneabbess" ) ;
	setMissionFaceCharacter( name, "aramis", "bethuneabbess" ) ;
	setMissionFaceCharacter( name, "bethuneabbess", "aramis" ) ;
	sayAndWait( "aramis", getString( "mr16d12" ) ) ;

	while ( isCharacterOnScreen( "athos" ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "athos" ) ;
	placeDead( "athos" ) ;
	placeVehicle( getCharacterOwnedHorseName( "athos" ), "france", -30000, 0 ) ;
	
	-- bring Porthos, Aramis, and d'Artagnan
	placeVehicle( getCharacterOwnedHorseName( "porthos" ), "france", 9168, -19804 ) ;
	placeVehicle( getCharacterOwnedHorseName( "aramis" ), "france", 9230, -19804 ) ;
	placeVehicle( getCharacterOwnedHorseName( "lordwinter" ), "france", 9300, -19804 ) ;
	
	addGoalGetToLevel( "porthos", "france", false, true ) ;
	addGoalDriveVehicle( "porthos", getCharacterOwnedHorseName( "porthos" ), true ) ;
	
	addGoalGetToLevel( "aramis", "france", false, true ) ;
	addGoalDriveVehicle( "aramis", getCharacterOwnedHorseName( "aramis" ), true ) ;
	
	addGoalGetToLevel( "lordwinter", "france", false, true ) ;
	addGoalDriveVehicle( "lordwinter", getCharacterOwnedHorseName( "lordwinter" ), true ) ;
	
	wait( 1 ) ;
	setMissionFaceDirection( name, "dartagnan", 1, 0 ) ;
	addGoalGetToPointInLevel( "dartagnan", -71, 93, "bethuneconventhouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	wait( 1 ) ;
	addTimedHeartMaker( "dartagnan", 0.5 ) ;
	wait( 2 ) ;	
	
	local tenseLocalMusicID = addLocalMusicInner( "tense", "france", 7500, -22000, 16885, -17343, 15 ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", 9304, -19875, "france", false, true ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	
	setMissionFaceDirection( name, "porthos", 0, 1 ) ;
	setMissionFaceDirection( name, "aramis", 0, 1 ) ;
	setMissionFaceDirection( name, "lordwinter", 0, 1 ) ;
	
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "lordwinter" ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	unlockPlayerInPlace( ) ;
	
	removeDoorLock( doorLockA ) ; -- don't let player back in convent

	removeOverrideSavePos( overrideSaveID ) ;

	removeLocalMusic( "france", tenseLocalMusicID ) ;

	completeMission( name ) ;
	activateMission( "missionrochelle17" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function createMissionRochelle17Enemy( mission, startX, startY, endX, endY )
	local enemy	= createTempCharacter( getString( "assassin" ), "france", startX, startY ) ;
	setMissionFaceDirection( mission, enemy, -1, 0 ) ;
	setStatsCalculatorStatic( enemy, 44, 44, 44, 44 ) ; -- 38, 38, 38, 38 
	randomDressRochellais( enemy, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy, "sword_1" ) ;
	setIgnoreFreeze( enemy, true ) ;
	addGoalGetToPointInLevel( enemy, endX, endY, "france", false, true ) ;
	
	return enemy ;
end

function execute_missionrochelle17( name )
	-- Get from convent to inn. Fight along way
	DEBUG_OUTPUT( name .. " started" ) ;
	
	setMissionChatString( name, "porthos", getString( "mr16d13" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr16d13" ) ) ;
	setMissionChatString( name, "lordwinter", getString( "mr16d13" ) ) ;
		
	local tenseLocalMusicID1 = addLocalMusicInner( "tense", "france", 7500, -22000, 14500, -19000, 15 ) ;
	local tenseLocalMusicID2 = addLocalMusicInner( "tense", "posthouse", -100000, -100000, 100000, 100000, 15 ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", 9251, -19796 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 8885, -20035, 9500, -19377, 12897, -20156, 12308, -22110 },
		{ 12355, -21668, 12775, -20419, 14539, -20273, 14290, -21708 } ) ;
	setOverrideSaveLevel( overrideSaveID, "posthouse" ) ;
		
	local rainWeather = addWeatherSpot( "france", 13490, -21119, 3500.0 ) ;
	setRain( rainWeather ) ;

	local withinDist = 200.0 ;
	ensureCharacterAroundPoint( "porthos", "france", 9168, -19804, withinDist ) ;
	ensureCharacterAroundPoint( "aramis", "france", 9230, -19804, withinDist ) ;
	ensureCharacterAroundPoint( "lordwinter", "france", 9300, -19804, withinDist ) ;
	
	putCharacterInPlaceOnHorse( "porthos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;
	putCharacterInPlaceOnHorse( "lordwinter" ) ;

	local markerPosX = 11670 ;
	local markerPosY = -20862 ;
	local marker = addMarkerPosition( name, true, getString( "findmilady" ), "france", markerPosX, markerPosY ) ;

	setMissionFaceDirection( name, "porthos", 1, 0 ) ;
	setMissionFaceDirection( name, "aramis", 1, 0 ) ;
	setMissionFaceDirection( name, "lordwinter", 1, 0 ) ;
	addGoalGetToPointInLevel( "porthos", markerPosX - 100, markerPosY - 70, "france", false, true ) ;
	addGoalGetToPointInLevel( "aramis", markerPosX - 100, markerPosY, "france", false, true ) ;
	addGoalGetToPointInLevel( "lordwinter", markerPosX - 100, markerPosY + 70, "france", false, true ) ;

	local triggerArea = addTriggerArea( name, "", false, "france", { 11240, -21431, 12129, -20188 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "lordwinter", true ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	setMissionFaceDirection( name, "dartagnan", 1, 0 ) ;
	addGoalGetToPointInLevel( "dartagnan", markerPosX, markerPosY, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	-- make sure characters aren't too far away
	if ( not isCharacterOnScreen( "porthos" ) ) then
		placeCharacter( "porthos", "france", 11132, -20900 ) ;
	end
	if ( not isCharacterOnScreen( "aramis" ) ) then
		placeCharacter( "aramis", "france", 11132, -20830 ) ;
	end
	if ( not isCharacterOnScreen( "lordwinter" ) ) then
		placeCharacter( "lordwinter", "france", 11132, -20760 ) ;
	end
	
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "lordwinter" ) ;

	local enemyStartX = 12177 ;
	local enemyStartY = -21135 ;
	local enemyEndX = 11930 ;
	local enemyEndY = -20957 ;	
	local enemy1 = createMissionRochelle17Enemy( name, enemyStartX, enemyStartY, enemyEndX, enemyEndY ) ;
	local enemy2 = createMissionRochelle17Enemy( name, enemyStartX + 20, enemyStartY + 50, enemyEndX + 15, enemyEndY + 50) ;
	local enemy3 = createMissionRochelle17Enemy( name, enemyStartX - 10, enemyStartY + 100, enemyEndX + 20, enemyEndY + 100 ) ;
	local enemy4 = createMissionRochelle17Enemy( name, enemyStartX + 15, enemyStartY + 150, enemyEndX - 10, enemyEndY + 150 ) ;
	local enemy5 = createMissionRochelle17Enemy( name, enemyStartX + 10, enemyStartY + 200, enemyEndX + 10, enemyEndY + 200 ) ;

	waitForNoGoal( enemy1 ) ;
	waitForNoGoal( enemy2 ) ;
	waitForNoGoal( enemy3 ) ;
	waitForNoGoal( enemy4 ) ;
	waitForNoGoal( enemy5 ) ;

	sayAndWait( "porthos", getString( "mr17d1" ) ) ;
	sayAndWait( "lordwinter", getString( "mr17d2" ) ) ;

	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "lordwinter", false ) ;
	setIgnoreFreeze( enemy1, false ) ;
	setIgnoreFreeze( enemy2, false ) ;
	setIgnoreFreeze( enemy3, false ) ;
	setIgnoreFreeze( enemy4, false ) ;
	setIgnoreFreeze( enemy5, false ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	
	removeDriver( getCharacterOwnedHorseName( "porthos" ), "porthos" ) ;
	removeDriver( getCharacterOwnedHorseName( "aramis" ), "aramis" ) ;
	removeDriver( getCharacterOwnedHorseName( "lordwinter" ), "lordwinter" ) ;
	
	makeEnemies( "dartagnan", enemy1, enemy2, enemy3, enemy4, enemy5 ) ;
	makeEnemies( "porthos", enemy1, enemy2, enemy3, enemy4, enemy5 ) ;
	makeEnemies( "aramis", enemy1, enemy2, enemy3, enemy4, enemy5 ) ;
	makeEnemies( "lordwinter", enemy1, enemy2, enemy3, enemy4, enemy5 ) ;

	setMissionChatFunction( name, "aramis", "chat_fight" ) ;
	setMissionChatFunction( name, "porthos", "chat_fight" ) ;
	setMissionChatFunction( name, "lordwinter", "chat_fight" ) ;

	local marker1 = addMarkerCharacter( name, true, getString( "fight" ), enemy1 ) ;
	local marker2 = addMarkerCharacter( name, true, getString( "fight" ), enemy2 ) ;
	local marker3 = addMarkerCharacter( name, true, getString( "fight" ), enemy3 ) ;
	local marker4 = addMarkerCharacter( name, true, getString( "fight" ), enemy4 ) ;
	local marker5 = addMarkerCharacter( name, true, getString( "fight" ), enemy5 ) ;
	
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;
	waitUntilDead( enemy4 ) ;
	waitUntilDead( enemy5 ) ;

	setMissionChatString( name, "porthos", getString( "mr16d13" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr16d13" ) ) ;
	setMissionChatString( name, "lordwinter", getString( "mr16d13" ) ) ;
	
	reviveHelper3( "porthos", "aramis", "lordwinter", true ) ;

	addGoalDriveVehicle( "porthos", getCharacterOwnedHorseName( "porthos" ), true ) ;
	addGoalDriveVehicle( "aramis", getCharacterOwnedHorseName( "aramis" ), true ) ;
	addGoalDriveVehicle( "lordwinter", getCharacterOwnedHorseName( "lordwinter" ), true ) ;

	setMissionFaceCharacter( name, "porthos", "posthousekeeper" ) ;
	setMissionFaceCharacter( name, "aramis", "posthousekeeper" ) ;
	setMissionFaceCharacter( name, "lordwinter", "posthousekeeper" ) ;
	addGoalGetToPointInLevel( "porthos", 70, 212, "posthouse", false, true ) ;
	addGoalGetToPointInLevel( "aramis", 110, 212, "posthouse", false, true ) ;
	addGoalGetToPointInLevel( "lordwinter", 150, 212, "posthouse", false, true ) ;
	
	local marker = addMarkerCharacter( name, true, getString( "findmilady" ), "posthousekeeper" ) ;

	local triggerArea = addTriggerArea( name, "", false, "posthouse", { 3, 124, 168, 216 } ) ;

	while ( not getCharacterLevel( "dartagnan" ) == "posthouse" ) do
		coroutine.yield( ) ;
	end

	setMissionChatString( name, "porthos", getString( "mr16d14" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr16d14" ) ) ;
	setMissionChatString( name, "lordwinter", getString( "mr16d14" ) ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;	

	lockPlayerInPlace( ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "posthousekeeper" ) ;
	setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
	addGoalGetToPointInLevel( "dartagnan", 13, 153, "posthouse", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;

	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "lordwinter" ) ;
	
	-- athos walks up
	setMissionFaceCharacter( name, "athos", "posthousekeeper" ) ;
	placeCharacterInDoor( "athos", "posthousein", false ) ;
	addGoalGetToPointInLevel( "athos", 25, 189, "posthouse", false, true ) ;
	wait( 1 ) ;
	
	setMissionFaceCharacter( name, "executioner", "athos" ) ;
	placeCharacterInDoor( "executioner", "posthousein", false ) ;
	addGoalGetToPointInLevel( "executioner", 3, 241, "posthouse", false, true ) ;
	
	setMissionFaceCharacter( name, "posthousekeeper", "dartagnan" ) ;
	sayAndWait( "dartagnan", getString( "mr17d3" ) ) ;
	sayAndWait( "posthousekeeper", getString( "mr17d4" ) ) ;
	sayAndWait( "dartagnan", getString( "mr17d5" ) ) ;
	sayAndWait( "posthousekeeper", getString( "mr17d6" ) ) ;

	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "executioner" ) ;

	setMissionFaceCharacter( name, "porthos", "executioner" ) ;
	setMissionFaceCharacter( name, "athos", "porthos" ) ;
	setMissionFaceCharacter( name, "dartagnan", "executioner" ) ;
	setMissionFaceCharacter( name, "aramis", "executioner" ) ;
	setMissionFaceCharacter( name, "lordwinter", "executioner" ) ;
	sayAndWait( "porthos", getString( "mr17d7" ) ) ;
	sayAndWait( "athos", getString( "mr17d8" ) ) ;
	
	unlockPlayerInPlace( ) ;
	
	removeWeatherSpot( rainWeather ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
			
	giveHealth( "porthos", 200 ) ;
	giveHealth( "aramis", 200 ) ;
	giveHealth( "lordwinter", 200 ) ;
				
	removeLocalMusic( "france", tenseLocalMusicID1 ) ;
	removeLocalMusic( "posthouse", tenseLocalMusicID2 ) ;
					
	completeMission( name ) ;
	activateMission( "missionrochelle18" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function createMissionRochelle18Enemy( mission, startX, startY, endX, endY )
	local enemy	= createTempCharacter( getString( "assassin" ), "france", startX, startY ) ;
	setMissionFaceCharacter( mission, enemy, "dartagnan" ) ;
	setStatsCalculatorStatic( enemy, 48, 48, 48, 48 ) ; -- 40, 40, 40, 40
	randomDressRochellais( enemy, 0.5, randomInt( 0, 99999 ) ) ;
	setMeleeWeapon( enemy, "sword_1" ) ;
	setRangedWeapon( enemy, "musket_matchlock_1" ) ;
	loadRanged( enemy ) ;
	setIgnoreFreeze( enemy, true ) ;
	addGoalGetToPointInLevel( enemy, endX, endY, "france", false, true ) ;
	
	return enemy ;
end

function execute_missionrochelle18( name )
	-- head down to Milady's shack, get ambushed
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "athos", getString( "mr17d9" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr17d9" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr17d9" ) ) ;
	setMissionChatString( name, "lordwinter", getString( "mr17d9" ) ) ;

	local tenseLocalMusicID1 = addLocalMusicInner( "extratense", "france", 12400, -21445, 16822, -17251, 15 ) ;
	local tenseLocalMusicID2 = addLocalMusicInner( "tense", "posthouse", -100000, -100000, 100000, 100000, 15 ) ;

	local overrideSaveID = createOverrideSavePos( "posthouse", 6, 199) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 13032, -21026, 14137, -21159, 15422, -18409, 13562, -17450 } ) ;
	
	local thunderStormWeather = addWeatherSpot( "france", 15016, -19042, 3300.0 ) ;
	setWeatherSpotDark( thunderStormWeather, 0.0, 0.0, 0.0, 0.3 ) ;
	setRain( thunderStormWeather ) ;
	setLightning( thunderStormWeather ) ;
	
	
	local withinDist = 200.0 ;
	ensureCharacterAroundPoint( "athos", "posthouse", 25, 189, withinDist ) ;
	ensureCharacterAroundPoint( "porthos", "posthouse", 70, 212, withinDist ) ;
	ensureCharacterAroundPoint( "aramis", "posthouse", 110, 212, withinDist ) ;
	ensureCharacterAroundPoint( "lordwinter", "posthouse", 150, 212, withinDist ) ;
	ensureCharacterAroundPoint( "executioner", "posthouse", 3, 241, withinDist ) ;
	
	local horsePosX = 13594 ;
	local horsePosY = -20936 ;
	placeVehicle( getCharacterOwnedHorseName( "athos" ), "france", 13620, -20960 ) ;
	placeVehicle( getCharacterOwnedHorseName( "porthos" ), "france", 13526, -20853 ) ;
	placeVehicle( getCharacterOwnedHorseName( "aramis" ), "france", 13630, -20827 ) ;
	placeVehicle( getCharacterOwnedHorseName( "lordwinter" ), "france", 13414, -20842 ) ;
	placeVehicle( getCharacterOwnedHorseName( "executioner" ), "france", 13530, -20736 ) ;
	
	local muskPosX = 14029 ;
	local muskPosY = -19473 ;
	setMissionFaceDirection( name, "athos", 1, 1 ) ;
	addGoalGetToLevel( "athos", "france", false, true ) ;
	addGoalDriveVehicle( "athos", getCharacterOwnedHorseName( "athos" ), true ) ;
	addGoalGetToPointInLevel( "athos", muskPosX, muskPosY, "france", true, true ) ;

	setMissionFaceDirection( name, "porthos", 1, 1 ) ;
	addGoalGetToLevel( "porthos", "france", false, true ) ;
	addGoalDriveVehicle( "porthos", getCharacterOwnedHorseName( "porthos" ), true ) ;
	addGoalGetToPointInLevel( "porthos", muskPosX + 50, muskPosY - 20, "france", true, true ) ;

	setMissionFaceDirection( name, "aramis", 1, 1 ) ;
	addGoalGetToLevel( "aramis", "france", false, true ) ;
	addGoalDriveVehicle( "aramis", getCharacterOwnedHorseName( "aramis" ), true ) ;
	addGoalGetToPointInLevel( "aramis", muskPosX + 100, muskPosY - 40, "france", true, true ) ;

	setMissionFaceDirection( name, "lordwinter", 1, 1 ) ;
	addGoalGetToLevel( "lordwinter", "france", false, true ) ;
	addGoalDriveVehicle( "lordwinter", getCharacterOwnedHorseName( "lordwinter" ), true ) ;
	addGoalGetToPointInLevel( "lordwinter", muskPosX + 150, muskPosY - 60, "france", true, true ) ;

	setMissionFaceDirection( name, "executioner", 1, 1 ) ;
	addGoalGetToLevel( "executioner", "france", false, true ) ;
	addGoalDriveVehicle( "executioner", getCharacterOwnedHorseName( "executioner" ), true ) ;
	addGoalGetToPointInLevel( "executioner", 14036, -19627, "france", true, true ) ;

	local markerPosX = 14263 ;
	local markerPosY = -19386 ;
	local marker = addMarkerPosition( name, true, getString( "findmilady" ), "france", markerPosX, markerPosY ) ;

	local triggerArea = addTriggerArea( name, "", false, "france", { 13654, -19727, 14817, -19056 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "lordwinter", true ) ;
	setIgnoreFreeze( "executioner", true ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	setMissionFaceDirection( name, "dartagnan", 1, 1 ) ;
	addGoalGetToPointInLevel( "dartagnan", markerPosX, markerPosY, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "lordwinter" ) ;
	waitForNoGoal( "executioner" ) ;

	local enemy1 = createMissionRochelle18Enemy( name, 14738, -19305, 14588, -19327 ) ;
	local enemy2 = createMissionRochelle18Enemy( name, 14717, -19143, 14564, -19211) ;
	local enemy3 = createMissionRochelle18Enemy( name, 14560, -19016, 14514, -19150 ) ;
	local enemy4 = createMissionRochelle18Enemy( name, 14328, -19026, 14308, -19148 ) ;
	local enemy5 = createMissionRochelle18Enemy( name, 14097, -19038, 14114, -19137 ) ;
	local enemy6 = createMissionRochelle18Enemy( name, 13922, -19025, 13937, -19150 ) ;
	local enemy7 = createMissionRochelle18Enemy( name, 13819, -19280, 13929, -19304 ) ;

	waitForNoGoal( enemy1 ) ;
	waitForNoGoal( enemy2 ) ;
	waitForNoGoal( enemy3 ) ;
	waitForNoGoal( enemy4 ) ;
	waitForNoGoal( enemy5 ) ;
	waitForNoGoal( enemy6 ) ;
	waitForNoGoal( enemy7 ) ;

	sayAndWait( "porthos", getString( "mr18d1" ) ) ;

	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "lordwinter", false ) ;
	setIgnoreFreeze( "executioner", false ) ;
	setIgnoreFreeze( enemy1, false ) ;
	setIgnoreFreeze( enemy2, false ) ;
	setIgnoreFreeze( enemy3, false ) ;
	setIgnoreFreeze( enemy4, false ) ;
	setIgnoreFreeze( enemy5, false ) ;
	setIgnoreFreeze( enemy6, false ) ;
	setIgnoreFreeze( enemy7, false ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	
	removeDriver( getCharacterOwnedHorseName( "athos" ), "athos" ) ;
	removeDriver( getCharacterOwnedHorseName( "porthos" ), "porthos" ) ;
	removeDriver( getCharacterOwnedHorseName( "aramis" ), "aramis" ) ;
	removeDriver( getCharacterOwnedHorseName( "lordwinter" ), "lordwinter" ) ;
	
	makeEnemies( "dartagnan", enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7 ) ;
	makeEnemies( "athos", enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7 ) ;
	makeEnemies( "porthos", enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7 ) ;
	makeEnemies( "aramis", enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7 ) ;
	makeEnemies( "lordwinter", enemy1, enemy2, enemy3, enemy4, enemy5, enemy6, enemy7 ) ;

	setMissionChatFunction( name, "aramis", "chat_fight" ) ;
	setMissionChatFunction( name, "porthos", "chat_fight" ) ;
	setMissionChatFunction( name, "athos", "chat_fight" ) ;
	setMissionChatFunction( name, "lordwinter", "chat_fight" ) ;

	local marker1 = addMarkerCharacter( name, true, getString( "fight" ), enemy1 ) ;
	local marker2 = addMarkerCharacter( name, true, getString( "fight" ), enemy2 ) ;
	local marker3 = addMarkerCharacter( name, true, getString( "fight" ), enemy3 ) ;
	local marker4 = addMarkerCharacter( name, true, getString( "fight" ), enemy4 ) ;
	local marker5 = addMarkerCharacter( name, true, getString( "fight" ), enemy5 ) ;
	local marker6 = addMarkerCharacter( name, true, getString( "fight" ), enemy6 ) ;
	local marker7 = addMarkerCharacter( name, true, getString( "fight" ), enemy7 ) ;
	
	waitUntilDead( enemy1 ) ;
	waitUntilDead( enemy2 ) ;
	waitUntilDead( enemy3 ) ;
	waitUntilDead( enemy4 ) ;
	waitUntilDead( enemy5 ) ;
	waitUntilDead( enemy6 ) ;
	waitUntilDead( enemy7 ) ;

	reviveHelper4( "athos", "porthos", "aramis", "lordwinter" ) ;

	addGoalDriveVehicle( "athos", getCharacterOwnedHorseName( "athos" ), true ) ;
	addGoalDriveVehicle( "porthos", getCharacterOwnedHorseName( "porthos" ), true ) ;
	addGoalDriveVehicle( "aramis", getCharacterOwnedHorseName( "aramis" ), true ) ;
	addGoalDriveVehicle( "lordwinter", getCharacterOwnedHorseName( "lordwinter" ), true ) ;

	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "lordwinter" ) ;

	removeWeatherSpot( thunderStormWeather ) ;
		
	removeOverrideSavePos( overrideSaveID ) ;
	
	giveHealth( "athos", 200 ) ;
	giveHealth( "porthos", 200 ) ;
	giveHealth( "aramis", 200 ) ;
	giveHealth( "lordwinter", 200 ) ;

	removeLocalMusic( "france", tenseLocalMusicID1 ) ;
	removeLocalMusic( "posthouse", tenseLocalMusicID2 ) ;
					
	completeMission( name ) ;
	activateMission( "missionrochelle19" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function execute_missionrochelle19( name )
	-- go to Milady's shack
	DEBUG_OUTPUT( name .. " started" ) ;

	setMissionChatString( name, "athos", getString( "mr17d9" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr17d9" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr17d9" ) ) ;
	setMissionChatString( name, "lordwinter", getString( "mr17d9" ) ) ;

	setInventoryItem( "letter_carteblanche", 1 ) ;
	setInventoryItem( "letter_commision", 0 ) ;
		
	local overrideSaveID = createOverrideSavePos( "france", 14290, -19391 ) ;
	setOverrideSaveArea( overrideSaveID, "france", 
		{ 13573, -19401, 15710, -17341 } ) ;

	local thunderStormWeather = addWeatherSpot( "france", 15016, -19042, 3300.0 ) ;
	setWeatherSpotDark( thunderStormWeather, 0.0, 0.0, 0.0, 0.3 ) ;
	setRain( thunderStormWeather ) ;
	setLightning( thunderStormWeather ) ;
	
	local tenseLocalMusicID = addLocalMusicInner( "extratense", "france", 12400, -21445, 16822, -17251, 15 ) ;
	
	local withinDist = 800.0 ;
	local muskPosX = 14029 ;
	local muskPosY = -19473 ;
	ensureCharacterAroundPoint( "athos", "france", muskPosX, muskPosY, withinDist ) ;
	ensureCharacterAroundPoint( "porthos", "france", muskPosX + 50, muskPosY - 20, withinDist ) ;
	ensureCharacterAroundPoint( "aramis", "france", muskPosX + 100, muskPosY - 40, withinDist ) ;
	ensureCharacterAroundPoint( "lordwinter", "france", muskPosX + 150, muskPosY - 60, withinDist ) ;
	ensureCharacterAroundPoint( "executioner", "france", 14036, -19627, withinDist ) ;
	
	putCharacterInPlaceOnHorse( "athos" ) ;
	putCharacterInPlaceOnHorse( "porthos" ) ;
	putCharacterInPlaceOnHorse( "aramis" ) ;
	putCharacterInPlaceOnHorse( "lordwinter" ) ;
	putCharacterInPlaceOnHorse( "executioner" ) ;

	local athosPosX = 14676 ;
	local athosPosY = -18309 ;
	setMissionFaceDirection( name, "athos", 0, -1 ) ;
	setMissionFaceDirection( name, "porthos", 0, -1 ) ;
	setMissionFaceDirection( name, "aramis", 0, -1 ) ;
	setMissionFaceDirection( name, "lordwinter", 1, 0 ) ;
	setMissionFaceDirection( name, "executioner", -1, 0 ) ;
	addGoalGetToPointInLevel( "athos", athosPosX, athosPosY, "france", true, true ) ;
	addGoalGetToPointInLevel( "porthos", athosPosX - 50, athosPosY - 5, "france", true, true ) ;
	addGoalGetToPointInLevel( "aramis", athosPosX - 100, athosPosY + 5, "france", true, true ) ;
	addGoalGetToPointInLevel( "lordwinter", 14488, -18350, "france", true, true ) ;
	addGoalGetToPointInLevel( "executioner", 14796, -18385, "france", true, true ) ;

	local marker = addMarkerPosition( name, true, getString( "findmilady" ), "miladyhideouthouse", 0, 0 ) ;

	local triggerArea = addTriggerArea( name, "", false, "france", { 14379, -18663, 14889, -18227 } ) ;
	
	while ( not triggerAreaTriggered( triggerArea ) ) do
		coroutine.yield( ) ;
	end

	removeTriggerArea( triggerArea ) ;

	removeMarker( name, marker ) ;

	removeOverrideSavePos( overrideSaveID ) ;

	local overrideSaveID = createOverrideSavePos( "france", 14271, -19388 ) ;
	setOverrideSaveLevel( overrideSaveID, "france" ) ;
	setOverrideSaveLevel( overrideSaveID, "cardinalhouse" ) ;
	setOverrideSaveLevel( overrideSaveID, "pommedepinhouse" ) ;

	setMissionFreezeGame( name, true ) ;
	setIgnoreFreeze( "athos", true ) ;
	setIgnoreFreeze( "porthos", true ) ;
	setIgnoreFreeze( "aramis", true ) ;
	setIgnoreFreeze( "lordwinter", true ) ;
	setIgnoreFreeze( "executioner", true ) ;
	setIgnoreFreeze( "milady", true ) ;
	setIgnoreFreeze( "rochefort", true ) ;

	setStateMessageIdle( "dartagnan" ) ;
	setMissionFaceDirection( name, "dartagnan", 0, -1 ) ;
	addGoalGetToPointInLevel( "dartagnan", athosPosX + 50, athosPosY, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "lordwinter" ) ;
	waitForNoGoal( "executioner" ) ;

	sayAndWait( "athos", getString( "mr19d1" ) ) ;

	setMissionFaceDirection( name, "porthos", 1, 0 ) ;
	addGoalGetToPointInLevel( "porthos", 14463, -18491, "france", false, true ) ;

	setMissionFaceDirection( name, "aramis", -1, 0 ) ;
	addGoalGetToPointInLevel( "aramis", 14803, -18494, "france", false, true ) ;

	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;


	setMissionFreezeGame( name, false ) ;
	lockPlayerInPlace( ) ;
	removeDriver( getCharacterOwnedHorseName( "athos" ), "athos" ) ;
	coroutine.yield( ) ;
	unlockPlayerInPlace( ) ;
	setMissionFreezeGame( name, true ) ;

	addGoalGetToPointInLevel( "athos", 14682, -18409, "france", false, true ) ;
	waitForNoGoal( "athos" ) ;
		
	wait( 0.5 ) ;
	playSound( "knockdoor", 0.9 ) ;
	wait( 0.29 ) ;
	playSound( "knockdoor", 0.9 ) ;
	wait( 0.33 ) ;
	playSound( "knockdoor", 0.9 ) ;
	wait( 0.3 ) ;
	playSound( "knockdoor", 0.9 ) ;
	wait( 2 ) ;
	
	sayAndWait( "athos", getString( "mr19d2" ) ) ;
	sayAndWait( "athos", getString( "mr19d3" ) ) ;
	
	wait( 2 ) ;
	
	placeCharacterInDoor( "milady", "miladyhideouthouseout", false ) ;
	addGoalGetToPointInLevel( "milady", 14684, -18405, "france", false, true ) ;

	setMissionFaceCharacter( name, "athos", "milady" ) ;
	setMissionFaceCharacter( name, "milady", "athos" ) ;	
	addGoalGetToPointInLevel( "athos", 14630, -18402, "france", false, true ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "milady" ) ;
	
	sayAndWait( "milady", getString( "mr19d4" ) ) ;
	sayAndWait( "athos", getString( "mr19d5" ) ) ;
	
	
	setMissionFreezeGame( name, false ) ;
	lockPlayerInPlace( ) ;
	removeDriver( getCharacterOwnedHorseName( "athos" ), "athos" ) ;
	removeDriver( getCharacterOwnedHorseName( "porthos" ), "porthos" ) ;
	removeDriver( getCharacterOwnedHorseName( "aramis" ), "aramis" ) ;
	removeDriver( getCharacterOwnedHorseName( "lordwinter" ), "lordwinter" ) ;
	removeDriver( getCharacterOwnedHorseName( "executioner" ), "executioner" ) ;
	removeDriver( getCharacterOwnedHorseName( "dartagnan" ), "dartagnan" ) ;
	coroutine.yield( ) ;
	unlockPlayerInPlace( ) ;
	setMissionFreezeGame( name, true ) ;
	
	
	setMissionFaceCharacter( name, "athos", "milady" ) ;
	setMissionFaceCharacter( name, "porthos", "milady" ) ;
	setMissionFaceCharacter( name, "aramis", "milady" ) ;
	setMissionFaceCharacter( name, "lordwinter", "milady" ) ;
	setMissionFaceCharacter( name, "executioner", "milady" ) ;
	setMissionFaceCharacter( name, "dartagnan", "milady" ) ;
	setMissionFaceDirection( name, "milady", -1, 0 ) ;
	
	addGoalGetToPointInLevel( "athos", 16192, -17999, "france", false, true ) ;
	wait( 2 ) ;
	addGoalGetToPointInLevel( "milady", 16277, -18005, "france", false, true ) ;
	wait( 0.1 ) ;
	addGoalGetToPointInLevel( "porthos", 16129, -18027, "france", false, true ) ;
	wait( 0.1 ) ;
	addGoalGetToPointInLevel( "aramis", 16127, -17974, "france", false, true ) ;
	wait( 0.1 ) ;
	addGoalGetToPointInLevel( "lordwinter", 16202, -17961, "france", false, true ) ;
	wait( 0.1 ) ;
	addGoalGetToPointInLevel( "executioner", 16222, -18071, "france", false, true ) ;
	wait( 0.1 ) ;
	addGoalGetToPointInLevel( "dartagnan", 16197, -18027, "france", false, true ) ;

	-- slow dartagnan down temporarily
	local oldDartWalkSpeed = getWalkSpeed( "dartagnan" ) ;
	setWalkSpeed( "dartagnan", getDefaultWalkSpeed( ) ) ;
	
	waitForNoGoal( "athos" ) ;
	waitForNoGoal( "porthos" ) ;
	waitForNoGoal( "aramis" ) ;
	waitForNoGoal( "dartagnan" ) ;
	waitForNoGoal( "milady" ) ;
	waitForNoGoal( "lordwinter" ) ;
	waitForNoGoal( "executioner" ) ;
	
	setWalkSpeed( "dartagnan", oldDartWalkSpeed ) ;
	
	sayAndWait( "athos", getString( "mr19d6" ) ) ;
	sayAndWait( "milady", getString( "mr19d7" ) ) ;
	sayAndWait( "athos", getString( "mr19d8" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d9" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d10" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d11" ) ) ;
	
	setMissionFaceCharacter( name, "athos", "lordwinter" ) ;
	sayAndWait( "athos", getString( "mr19d12" ) ) ;

	setMissionFaceCharacter( name, "athos", "milady" ) ;
	sayAndWait( "lordwinter", getString( "mr19d13" ) ) ;
	sayAndWait( "lordwinter", getString( "mr19d14" ) ) ;

	sayAndWait( "athos", getString( "mr19d15" ) ) ;
	sayAndWait( "milady", getString( "mr19d16" ) ) ;
	
	setMissionFaceCharacter( name, "milady", "executioner" ) ;
	setMissionFaceCharacter( name, "athos", "executioner" ) ;
	setMissionFaceCharacter( name, "porthos", "executioner" ) ;
	setMissionFaceCharacter( name, "aramis", "executioner" ) ;
	setMissionFaceCharacter( name, "dartagnan", "executioner" ) ;
	setMissionFaceCharacter( name, "lordwinter", "executioner" ) ;
	sayAndWait( "executioner", getString( "mr19d17" ) ) ;
	sayAndWait( "milady", getString( "mr19d18" ) ) ;
	wait( 1 ) ;
	sayAndWait( "porthos", getString( "mr19d19" ) ) ;
	sayAndWait( "executioner", getString( "mr19d20" ) ) ;
	sayAndWait( "milady", getString( "mr19d21" ) ) ;
	sayAndWait( "executioner", getString( "mr19d22" ) ) ;
	sayAndWait( "executioner", getString( "mr19d23" ) ) ;
	sayAndWait( "executioner", getString( "mr19d24" ) ) ;
	sayAndWait( "executioner", getString( "mr19d25" ) ) ;
	sayAndWait( "executioner", getString( "mr19d26" ) ) ;
	sayAndWait( "executioner", getString( "mr19d27" ) ) ;
	sayAndWait( "executioner", getString( "mr19d28" ) ) ;
	sayAndWait( "executioner", getString( "mr19d29" ) ) ;
	sayAndWait( "executioner", getString( "mr19d30" ) ) ;
	sayAndWait( "executioner", getString( "mr19d31" ) ) ;
	sayAndWait( "executioner", getString( "mr19d32" ) ) ;
	sayAndWait( "executioner", getString( "mr19d33" ) ) ;
	
	setMissionFaceCharacter( name, "athos", "milady" ) ;
	setMissionFaceCharacter( name, "porthos", "milady" ) ;
	setMissionFaceCharacter( name, "aramis", "milady" ) ;
	setMissionFaceCharacter( name, "dartagnan", "milady" ) ;
	setMissionFaceCharacter( name, "lordwinter", "milady" ) ;
	setMissionFaceCharacter( name, "executioner", "milady" ) ;
	setMissionFaceDirection( name, "milady", -1, 0 ) ;

	sayAndWait( "athos", getString( "mr19d34" ) ) ;
	sayAndWait( "dartagnan", getString( "punishdeath" ) ) ;
	sayAndWait( "athos", getString( "mr19d35" ) ) ;
	sayAndWait( "lordwinter", getString( "punishdeath" ) ) ;
	sayAndWait( "athos", getString( "mr19d36" ) ) ;
	sayAndWait( "porthos", getString( "punishdeath" ) ) ;
	sayAndWait( "aramis", getString( "punishdeath" ) ) ;
	sayAndWait( "athos", getString( "mr19d37" ) ) ;
	sayAndWait( "athos", getString( "mr19d38" ) ) ;
	sayAndWait( "milady", getString( "mr19d38_1" ) ) ;
	sayAndWait( "athos", getString( "mr19d38_2" ) ) ;
	sayAndWait( "milady", getString( "mr19d38_3" ) ) ;
	
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", 16210, -18027, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	wait( 1 ) ;

	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	sayAndWait( "athos", getString( "mr19d38_4" ) ) ;

	setMissionFaceCharacter( name, "dartagnan", "milady" ) ;
	setMissionFaceCharacter( name, "athos", "milady" ) ;
	addGoalGetToPointInLevel( "dartagnan", 16197, -18027, "france", false, true ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	removeLocalMusic( "france", tenseLocalMusicID ) ;
	local churchMusicID = addMusic( "church", 15 ) ;
		
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	-- show comic
	local comic1 = createComic( "milady4" ) ;

	addText( comic1, getString( "milady4_d1" ), 106, 215, 230, 280 ) ;
	addText( comic1, getString( "milady4_d3" ), 618, 86, 686, 115 ) ;
	addText( comic1, getString( "milady4_d4" ), 229, 520, 284, 550 ) ;
	addText( comic1, getString( "milady4_d5" ), 349, 323, 508, 356 ) ;
	
	addMouseOver( comic1, getString( "lordwinter" ), 21, 36, 80, 139, 42, 39 ) ;
	addMouseOver( comic1, getString( "porthos" ), 83, 1, 185, 190, 118, 9 ) ;
	addMouseOver( comic1, getString( "executioner" ), 194, 50, 248, 187, 222, 52 ) ;
	addMouseOver( comic1, getString( "athos" ), 3, 37, 45, 195, 16, 42 ) ;
	addMouseOver( comic1, getString( "aramis" ), 52, 54, 124, 264, 78, 51 ) ;
	addMouseOver( comic1, getString( "milady" ), 154, 79, 221, 245, 175, 80 ) ;
	addMouseOver( comic1, getString( "dartagnan" ), 20, 129, 86, 286, 44, 134 ) ;

	addMouseOver( comic1, getString( "executioner" ), 259, 47, 369, 226, 299, 47 ) ;
	addMouseOver( comic1, getString( "milady" ), 417, 45, 496, 191, 449, 48 ) ;

	addMouseOver( comic1, getString( "executioner" ), 625, 8, 691, 75, 680, 8 ) ;
	addMouseOver( comic1, getString( "milady" ), 715, 33, 787, 191, 741, 37 ) ;

	addMouseOver( comic1, getString( "executioner" ), 105, 315, 143, 405, 119, 316 ) ;
	addMouseOver( comic1, getString( "milady" ), 142, 399, 326, 514, 299, 405 ) ;

	addMouseOver( comic1, getString( "executioner" ), 519, 247, 614, 494, 567, 288 ) ;
	addMouseOver( comic1, getString( "milady" ), 612, 414, 742, 570, 707, 423 ) ;

	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end
	
	-- put characters back in Paris
	place_lordwinterA( "lordwinter" ) ;
	place_executioner( "executioner" ) ;
	place_miladyA( "milady" ) ;
	
	sitCharacter( "athos", "pommechair1" ) ;
	sitCharacter( "aramis", "pommechair2" ) ;
	sitCharacter( "dartagnan", "pommechair3" ) ;
	sitCharacter( "porthos", "pommechair4" ) ;

	removeMusic( churchMusicID ) ;
	
	local noMusicID = addMusic( "none", 15 ) ;
	wait( 1 ) ;	
	playSound( "swordimpact", 1.0 ) ;
	wait( 2 ) ;
	removeMusic( noMusicID ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setCharacterOverrideName( "rochefort", true, getString( "rochefortunknown" ) ) ;

	sayAndWait( "porthos", getString( "mr19d39" ) ) ;
	
	setMissionFaceCharacter( name, "rochefort", "dartagnan" ) ;
	placeCharacterInDoor( "rochefort", "pommedepinin", false ) ;
	addGoalGetToPointInLevel( "rochefort", 86, 180, "pommedepinhouse", false, true ) ;
	waitForNoGoal( "rochefort" ) ;
	
	setStateMessageIdle( "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "rochefort" ) ;

	sayAndWait( "rochefort", getString( "mr19d40" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d41" ) ) ;
	sayAndWait( "rochefort", getString( "mr19d42" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d43" ) ) ;
	sayAndWait( "rochefort", getString( "mr19d44" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d45" ) ) ;
	
	setCharacterOverrideName( "rochefort", false, getString( "rochefortunknown" ) ) ;
		
	sayAndWait( "rochefort", getString( "mr19d46" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d47" ) ) ;
	
	setStateMessageIdle( "athos" ) ;
	setStateMessageIdle( "porthos" ) ;
	setStateMessageIdle( "aramis" ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	wait( 0.3 ) ;
	sayAndWait( "athos", getString( "mr19d48" ) ) ;
	
	addGoalGetToPointInLevel( "athos", 1257, 2475, "france", false, true ) ;
	wait( 0.1 ) ;
	addGoalGetToPointInLevel( "porthos", 1257, 2475, "france", false, true ) ;
	wait( 0.1 ) ;
	addGoalGetToPointInLevel( "aramis", 1257, 2475, "france", false, true ) ;
	wait( 0.1 ) ;
	addGoalGetToPointInLevel( "rochefort", 1257, 2475, "france", false, true ) ;
	wait( 0.1 ) ;
	addGoalGetToPointInLevel( "dartagnan", 1257, 2475, "france", false, true ) ;
	
	wait( 0.5 ) ;

	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	clearGoals( "dartagnan" ) ;
	clearGoals( "athos" ) ;
	clearGoals( "porthos" ) ;
	clearGoals( "aramis" ) ;
	clearGoals( "rochefort" ) ;
		
	setMissionFreezeGame( name, false ) ;
	setIgnoreFreeze( "athos", false ) ;
	setIgnoreFreeze( "porthos", false ) ;
	setIgnoreFreeze( "aramis", false ) ;
	setIgnoreFreeze( "lordwinter", false ) ;
	setIgnoreFreeze( "executioner", false ) ;
	setIgnoreFreeze( "milady", false ) ;
	setIgnoreFreeze( "rochefort", false ) ;

	lockPlayerInPlace( ) ;

	-- go to Palais cardinal
	setMissionFaceCharacter( name, "dartagnan", "rochefort" ) ;
	setMissionFaceCharacter( name, "athos", "rochefort" ) ;
	setMissionFaceCharacter( name, "porthos", "rochefort" ) ;
	setMissionFaceCharacter( name, "aramis", "rochefort" ) ;
	setMissionFaceDirection( name, "rochefort", 0, 1 ) ;
	placeCharacter( "athos", "cardinalhouse", -248, -60 ) ;
	placeCharacter( "porthos", "cardinalhouse", -208, -60 ) ;
	placeCharacter( "aramis", "cardinalhouse", -168, -60 ) ;
	placeCharacter( "dartagnan", "cardinalhouse", -288, -60 ) ;
	placeCharacter( "rochefort", "cardinalhouse", -240, -110 ) ;

	place_cardinalA( "cardinal" ) ;
	setMissionFaceDirection( name, "cardinal", 0, -1 ) ;

	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	sayAndWait( "rochefort", getString( "mr19d49" ) ) ;

	setMissionFaceDirection( name, "rochefort", 0, 1 ) ;
	addGoalGetToPointInLevel( "rochefort", -478, -852, "cardinalhouse", false, true ) ;
	wait( 1 ) ;
	setMissionFaceCharacter( name, "dartagnan", "cardinal" ) ;
	addGoalGetToPointInLevel( "dartagnan", -19, -924, "cardinalhouse", false, true ) ;

	local oldDartWalkSpeed = getWalkSpeed( "dartagnan" ) ;
	setWalkSpeed( "dartagnan", getDefaultWalkSpeed( ) ) ;
	
	waitForNoGoal( "rochefort" ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	setWalkSpeed( "dartagnan", oldDartWalkSpeed ) ;

	setMissionFaceCharacter( name, "cardinal", "dartagnan" ) ;

	sayAndWait( "cardinal", getString( "mr19d50" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d51" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d52" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d53" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d54" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d55" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d56" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d57" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d58" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d59" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d60" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d61" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d62" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d63" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d64" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d65" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d66" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d67" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d68" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d69" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d70" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d71" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d72" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d73" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	sayAndWait( "cardinal", getString( "mr19d74" ) ) ;
	setInventoryItem( "letter_carteblanche", 0 ) ;
	sayAndWait( "cardinal", getString( "mr19d75" ) ) ;

	setMissionFaceDirection( name, "cardinal", 0, 1 ) ;
	addGoalGetToPointInLevel( "cardinal", -113, -862, "cardinalhouse", false, true ) ;
	waitForNoGoal( "cardinal" ) ;

	wait( 1 ) ;
	sayAndWait( "cardinal", getString( "mr19d76" ) ) ;
	playSound( "writing", 1.0 ) ;
	wait( 2 ) ;

	setMissionFaceCharacter( name, "cardinal", "dartagnan" ) ;
	addGoalGetToPointInLevel( "cardinal", -72, -911, "cardinalhouse", false, true ) ;
	waitForNoGoal( "cardinal" ) ;

	sayAndWait( "cardinal", getString( "mr19d77" ) ) ;
	
	playSound( "paper", 1.0 ) ;
	
	setInventoryItem( "letter_commision", 1 ) ;
	
	sayAndWait( "dartagnan", getString( "mr19d78" ) ) ;
	sayAndWait( "cardinal", getString( "mr19d79" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d80" ) ) ;
	
	setMissionFaceCharacter( name, "cardinal", "rochefort" ) ;
	sayAndWait( "cardinal", getString( "mr19d81" ) ) ;
	
	setMissionFaceCharacter( name, "rochefort", "cardinal" ) ;
	addGoalGetToPointInLevel( "rochefort", -120, -945, "cardinalhouse", false, true ) ;
	waitForNoGoal( "rochefort" ) ;

	sayAndWait( "cardinal", getString( "mr19d82" ) ) ;
	
	local oldDartWalkSpeed = getWalkSpeed( "dartagnan" ) ;
	setWalkSpeed( "dartagnan", getDefaultWalkSpeed( ) ) ;
	
	setMissionFaceCharacter( name, "rochefort", "dartagnan" ) ;
	setMissionFaceCharacter( name, "dartagnan", "rochefort" ) ;
	addGoalGetToPointInLevel( "rochefort", -477, -851, "cardinalhouse", false, true ) ;
	addGoalGetToPointInLevel( "dartagnan", -517, -851, "cardinalhouse", false, true ) ;
	waitForNoGoal( "rochefort" ) ;
	waitForNoGoal( "dartagnan" ) ;
	
	setWalkSpeed( "dartagnan", oldDartWalkSpeed ) ;
	
	sayAndWait( "rochefort", getString( "mr19d83" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d84" ) ) ;
	sayAndWait( "rochefort", getString( "mr19d85" ) ) ;
			
	setMissionFaceDirection( name, "dartagnan", 0, 1 ) ;
	setMissionFaceCharacter( name, "athos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "porthos", "dartagnan" ) ;
	setMissionFaceCharacter( name, "aramis", "dartagnan" ) ;
	addGoalGetToPointInLevel( "dartagnan", -205, -118, "cardinalhouse", false, true ) ;

	wait( 5 ) ;
	local muskMusicID = addMusic( "waterflute", 15 ) ;
	
	waitForNoGoal( "dartagnan" ) ;

	sayAndWait( "dartagnan", getString( "mr19d86" ) ) ;
	
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mr19d87" ) ) ;
	waitForBubbleClosed( bubInd ) ;

	unlockPlayerInPlace( ) ;

	-- lock player in and make them talk to all three musketeers
	
	local doorLockA = addDoorLock( name, "missionrochelle19LockOut", true, "cardinalin" ) ;
	local triggerAreaA = addTriggerArea( name, "missionrochelle19LockOut", true, "cardinalhouse", 
		{ -548, -356, -341, 213 }, { 14, -386, 340, 251 } ) ;
	
	setMissionFaceNone( name, "dartagnan" ) ;
	
	local athosMarker = addMarkerCharacter( name, true, getString( "mr19m1" ), "athos" ) ;
	local porthosMarker = addMarkerCharacter( name, true, getString( "mr19m1" ), "porthos" ) ;
	local aramisMarker = addMarkerCharacter( name, true, getString( "mr19m1" ), "aramis" ) ;
	
	setMissionChatString( name, "athos", getString( "mr19d101" ) ) ;
	setMissionChatString( name, "porthos", getString( "mr19d99" ) ) ;
	setMissionChatString( name, "aramis", getString( "mr19d100" ) ) ;
		
	local athosWaitTalkNum = setWaitingForTalk( "dartagnan", "athos", false ) ;
	local porthosWaitTalkNum = setWaitingForTalk( "dartagnan", "porthos", false ) ;
	local aramisWaitTalkNum = setWaitingForTalk( "dartagnan", "aramis", false ) ;
	
	local doneAthosTalk = false ;
	local donePorthosTalk = false ;
	local doneAramisTalk = false ;
	
	while ( ( not doneAthosTalk ) or ( not donePorthosTalk ) or ( not doneAramisTalk ) ) do
		if ( not doneAthosTalk ) then
			if ( hasWaitingTalkOccured( athosWaitTalkNum ) ) then
				setDoneWaitingTalk( athosWaitTalkNum ) ;
				doneAthosTalk = true ;
				removeMarker( name, athosMarker ) ;
				
				lockPlayerInPlace( ) ;
				sayAndWait( "dartagnan", getString( "mr19d88" ) ) ;
				sayAndWait( "athos", getString( "mr19d89" ) ) ;
				unlockPlayerInPlace( ) ;
			end
		end
		
		if ( not donePorthosTalk ) then
			if ( hasWaitingTalkOccured( porthosWaitTalkNum ) ) then
				setDoneWaitingTalk( porthosWaitTalkNum ) ;
				donePorthosTalk = true ;
				removeMarker( name, porthosMarker ) ;
				
				lockPlayerInPlace( ) ;
				sayAndWait( "dartagnan", getString( "mr19d90" ) ) ;
				sayAndWait( "porthos", getString( "mr19d91" ) ) ;
				sayAndWait( "porthos", getString( "mr19d92" ) ) ;
				unlockPlayerInPlace( ) ;
			end
		end

		if ( not doneAramisTalk ) then
			if ( hasWaitingTalkOccured( aramisWaitTalkNum ) ) then
				setDoneWaitingTalk( aramisWaitTalkNum ) ;
				doneAramisTalk = true ;
				removeMarker( name, aramisMarker ) ;
				
				lockPlayerInPlace( ) ;
				sayAndWait( "dartagnan", getString( "mr19d93" ) ) ;
				sayAndWait( "aramis", getString( "mr19d94" ) ) ;
				sayAndWait( "aramis", getString( "mr19d95" ) ) ;
				unlockPlayerInPlace( ) ;
			end
		end

		coroutine.yield( ) ;
	end
	
	lockPlayerInPlace( ) ;
	setStateMessageIdle( "dartagnan" ) ;
	
	setMissionFaceCharacter( name, "dartagnan", "athos" ) ;
	
	sayAndWait( "athos", getString( "mr19d96" ) ) ;
	sayAndWait( "dartagnan", getString( "mr19d97" ) ) ;
	sayAndWait( "athos", getString( "mr19d98" ) ) ;
	
	-- unlock			
	removeDoorLock( doorLockA ) ;
	removeTriggerArea( triggerAreaA ) ;

	removeMusic( muskMusicID ) ;
	local titleMusicID = addMusic( "title", 15 ) ;
	
	-- show end game comic
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	-- show comic
	local comic1 = createComic( "epilogue1" ) ;
	
	addText( comic1, getString( "epilogue1_d1" ), 3, 4, 269, 40 ) ;
	addText( comic1, getString( "epilogue1_d2" ), 27, 47, 269, 113 ) ;
	addText( comic1, getString( "epilogue1_d3" ), 3, 241, 269, 293 ) ;
	addText( comic1, getString( "epilogue1_d4" ), 285, 7, 516, 58 ) ;
	addText( comic1, getString( "epilogue1_d5" ), 558, 7, 794, 67 ) ;
	addText( comic1, getString( "epilogue1_d6" ), 558, 239, 780, 291 ) ;
	addText( comic1, getString( "epilogue1_d7" ), 3, 304, 268, 337 ) ;
	addText( comic1, getString( "epilogue1_d8" ), 3, 529, 270, 595 ) ;
	addText( comic1, getString( "epilogue1_d9" ), 283, 308, 541, 358 ) ;
	addText( comic1, getString( "epilogue1_d10" ), 283, 537, 541, 595 ) ;
	addText( comic1, getString( "epilogue1_d11" ), 558, 304, 796, 406 ) ;
	
	addMouseOver( comic1, getString( "cardinal" ), 89, 139, 123, 202, 104, 142 ) ;
	addMouseOver( comic1, getString( "louisxiii" ), 143, 138, 172, 187, 154, 142 ) ;
	
	addMouseOver( comic1, getString( "dartagnan" ), 381, 62, 542, 293, 452, 70 ) ;
	
	addMouseOver( comic1, getString( "porthos" ), 575, 63, 730, 250, 658, 66 ) ;
	addMouseOver( comic1, getString( "madamecoquenard" ), 717, 145, 798, 267, 758, 153 ) ;
	
	addMouseOver( comic1, getString( "aramis" ), 120, 344, 266, 538, 181, 342 ) ;
	addMouseOver( comic1, getString( "athos" ), 354, 364, 482, 541, 414, 371 ) ;
	
	addMouseOver( comic1, getString( "mousqueton" ), 575, 440, 634, 571, 609, 445 ) ;
	addMouseOver( comic1, getString( "bazin" ), 660, 438, 707, 566, 678, 444 ) ;
	addMouseOver( comic1, getString( "grimaud" ), 739, 451, 793, 566, 770, 457 ) ;

	
	local comic2 = createComic( "epilogue2" ) ;
	
	addText( comic2, getString( "epilogue2_d1" ), 10, 4, 260, 58 ) ;
	addText( comic2, getString( "epilogue2_d2" ), 284, 4, 544, 70 ) ;
	addText( comic2, getString( "epilogue2_d3" ), 557, 4, 794, 98 ) ;
	addText( comic2, getString( "epilogue2_d4" ), 6, 307, 398, 358 ) ;
	addText( comic2, getString( "epilogue2_d5" ), 6, 531, 398, 585 ) ;
	addText( comic2, getString( "epilogue2_d6" ), 412, 305, 794, 364 ) ;
	addText( comic2, getString( "epilogue2_d7" ), 412, 533, 599, 585 ) ;
	
	addMouseOver( comic2, getString( "dartagnan" ), 147, 84, 273, 285, 190, 88 ) ;
	addMouseOver( comic2, getString( "rochefort" ), 76, 74, 168, 296, 114, 78 ) ;
	
	addMouseOver( comic2, getString( "planchet" ), 365, 66, 541, 284, 445, 77 ) ;
	
	addMouseOver( comic2, getString( "bonacieux" ), 641, 104, 765, 229, 702, 107 ) ;
	
	addMouseOver( comic2, getString( "louisxiii" ), 196, 388, 284, 531, 239, 393 ) ;
	addMouseOver( comic2, getString( "cardinal" ), 291, 387, 356, 532, 324, 388 ) ;
	addMouseOver( comic2, getString( "bonacieux" ), 21, 383, 170, 530, 127, 389 ) ;

	addMouseOver( comic2, getString( "bonacieux" ), 658, 375, 706, 491, 678, 377 ) ;
	addMouseOver( comic2, getString( "louisxiii" ), 737, 375, 797, 570, 771, 386 ) ;
	addMouseOver( comic2, getString( "cardinal" ), 463, 378, 601, 538, 537, 383 ) ;
	
	setComicFadeFrom( 0.0, 0.0, 0.0 ) ;
	setComicFadeTo( 0.0, 0.0, 0.0 ) ;
			
	while ( isComicShowing( ) ) do
		coroutine.yield( ) ;
	end

	-- put characters back to their normal places
	place_rochefortA( "rochefort" ) ;
	place_athosA( "athos" ) ;
	place_porthosA( "porthos" ) ;
	place_aramisA( "aramis" ) ;
	place_cardinalB( "cardinal" ) ;
	
	placeCharacter( "dartagnan", "france", 1766, 2794 ) ;
	
	stopCameraFollowCharacter( ) ;
	setActiveLevelMessage( "blacklevel", 400, 300 ) ;
	
	setPauseButtonVisible( false ) ;
	setWeaponToggleOverrideNotVisible( true ) ;
	setHealthBarVisible( false ) ;
	setOintmentButtonVisible( false ) ;
	setMapButtonVisible( false ) ;
	setInventoryButtonVisible( false ) ;
	
	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
	
	--removeMusic( muskMusicID ) ;
	--local titleMusicID = addMusic( "title", 15 ) ;
	
	
	-- show credits
	
	-- play title music
	--local titleMusicID = addMusic( "title", 15 ) ;
	showCredits( ) ;
	wait( 2 ) ;
	removeMusic( titleMusicID ) ;
	
	-- fade to black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeToColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end

	setPauseButtonVisible( true ) ;
	setWeaponToggleOverrideNotVisible( false ) ;
	setHealthBarVisible( true ) ;
	setOintmentButtonVisible( true ) ;
	setMapButtonVisible( true ) ;
	setInventoryButtonVisible( true ) ;	
	
	setCameraFollowCharacter( "dartagnan", true ) ;

	-- fade from black
	local fadeTime = 0.5 ;
	setFadeColour( 0.0, 0.0, 0.0, 1.0 ) ;
	fadeFromColour( fadeTime ) ;
	while ( isFading( ) ) do
		coroutine.yield( ) ;
	end
		
	unlockPlayerInPlace( ) ;

	removeWeatherSpot( thunderStormWeather ) ;

	removeOverrideSavePos( overrideSaveID ) ;

	placeVehicle( getCharacterOwnedHorseName( "athos" ), "france", -30000, 0 ) ;
	placeVehicle( getCharacterOwnedHorseName( "porthos" ), "france", -30000, 0 ) ;
	placeVehicle( getCharacterOwnedHorseName( "aramis" ), "france", -30000, 0 ) ;
	placeVehicle( getCharacterOwnedHorseName( "lordwinter" ), "france", -30000, 0 ) ;
	placeVehicle( getCharacterOwnedHorseName( "executioner" ), "france", -30000, 0 ) ;

	setInventoryItem( "letter_commision", 0 ) ;

	completeMission( name ) ;
	activateMission( "missiondone1" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end

function showCredits( )
	showCredit( getString( "credits1" ), getString( "credits2" ), 4.0 ) ;
	wait( 1 ) ;
	showCredit( getString( "credits3" ), getString( "credits4" ), 4.0 ) ;
	wait( 1 ) ;
	showCredit( getString( "credits5" ), getString( "credits6" ), 4.0 ) ;
	wait( 1 ) ;
	showCredit( getString( "credits7" ), "", 4.0 ) ;
	wait( 1 ) ;
	showCredit( getString( "credits8" ), "", 4.0 ) ;
	wait( 1 ) ;
	showCredit( getString( "credits9" ), getString( "credits10" ), 4.0 ) ;
	wait( 1 ) ;
	showCredit( getString( "credits9" ), getString( "credits11" ), 4.0 ) ;
	wait( 1 ) ;
	showCredit( getString( "credits9" ), getString( "credits12" ), 4.0 ) ;
	wait( 1 ) ;
end

function showCredit( creditDescription, creditName, holdTime )
	local startY = -70 ;
	local posY = startY ;

	local hasDescription = false ;	
	if ( not ( creditDescription == "" ) ) then
		hasDescription = true ;
	end
	
	local hasName = false ;
	if ( not ( creditName == "" ) ) then
		hasName = true ;
	end
	
	local credits1Label = addLabel( ) ;
	if ( hasDescription ) then
		setLabelText( credits1Label, creditDescription ) ;
		setLabelFont( credits1Label, "normal" ) ;
		setLabelColour( credits1Label, gLightTextR, gLightTextG, gLightTextB, gLightTextA ) ;
		setLabelShadow( credits1Label, true, 2, 2 ) ;
		setLabelShadowColour( credits1Label, gLightTextShadowR, gLightTextShadowG, gLightTextShadowB, gLightTextShadowA ) ;
		setWindowAlign( credits1Label, "center", "top" ) ;
		setWindowPos( credits1Label, 0, posY ) ;
	else
		setWindowPos( credits1Label, 10000, 10000 ) ;
	end
	
	local credits2Label = addLabel( ) ;
	if ( hasName ) then
		setLabelText( credits2Label, creditName ) ;
		setLabelFont( credits2Label, "title_font" ) ;
		setLabelColour( credits2Label, gLightTextR, gLightTextG, gLightTextB, gLightTextA ) ;
		setLabelShadow( credits2Label, true, 2, 2 ) ;
		setLabelShadowColour( credits2Label, gLightTextShadowR, gLightTextShadowG, gLightTextShadowB, gLightTextShadowA ) ;
		setWindowAlign( credits2Label, "center", "bottom" ) ;
		setWindowPos( credits2Label, 0, posY ) ;
	else
		setWindowPos( credits2Label, 10000, 10000 ) ;
	end

	local maxPos = 270.0 ;
	local posYRange = maxPos - startY ;
	local finalDiffFromMax = 400.0 ;
	local vel = 300 ;
		
	local count = 0.0 ;
	local inTime = 0.6 ;
	local outTime = 0.6 ;
	local totalTime = inTime + holdTime + outTime ;
	while ( count < totalTime ) do
		count = count + getDeltaT( ) ;
		
		if ( count < inTime ) then
			posY = startY + posYRange * ( count / inTime ) ;
		elseif ( count < ( inTime + holdTime ) ) then
			posY = maxPos ;
		elseif ( count < totalTime ) then
			local timeIntoOut = count - ( inTime + holdTime ) ;
			local ratioIn = timeIntoOut / outTime ;
			posY = maxPos + finalDiffFromMax * ( timeIntoOut / outTime ) ;
			--posY = startY + posYRange * ( 1.0 - ratioIn ) ;
		end
		
		if ( hasDescription ) then
			setWindowPos( credits1Label, 0, posY ) ;
		end
		
		if ( hasName ) then
			setWindowPos( credits2Label, 0, posY ) ;
		end
		
		coroutine.yield( ) ;
	end
	
	credits1Label = safeRemoveWindow( credits1Label ) ;
	credits2Label = safeRemoveWindow( credits2Label ) ;
end

function missionrochelle19LockOut( )
	lockPlayerInPlace( ) ;

	local centerX = -205 ;
	local centerY = -104 ;

	local playerX, playerY = getCharacterPos( "dartagnan" ) ;

	local diffX = centerX - playerX ;
	local diffY = centerY - playerY ;	
	
	-- normalize
	local hyp = math.sqrt( diffX * diffX + diffY * diffY ) ;
	local directionX = diffX / hyp ;
	local directionY = diffY / hyp ;
	
	local distanceMoveInward = 50.0 ;
	local offsetX = directionX * distanceMoveInward ;
	local offsetY = directionY * distanceMoveInward ;
	
	local newPlayerX = playerX + offsetX ;
	local newPlayerY = playerY + offsetY ;
	
	--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "mr19d87" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mr19d87" ) ) ;
	
	addGoalGetToPointInLevel( "dartagnan", newPlayerX, newPlayerY, "cardinalhouse", false ) ;
	waitForNoGoal( "dartagnan" ) ;

	waitForBubbleClosed( bubInd ) ;
	
	unlockPlayerInPlace( ) ;
end


function execute_missiondone1( name )
	-- 
	DEBUG_OUTPUT( name .. " started" ) ;
	
	wait( 100000000 ) ;

	completeMission( name ) ;
	--activateMission( "missionrochelle18" ) ;
	DEBUG_OUTPUT( name .. " done" ) ;
end
