BUBBLE_PROX_N = 100.0 ;
gBuyingHorseRunning = false ;
gBlockGoalWalkToPoint = false ;
gCalaisHouseCManDartLeft = true ;
gLondonGuardDartLeft = true ;
gTarbescmanDontMumble = false ;

function chat_nothing( name, chatWith )
	-- say nothing
end

function chat_fight( name, chatWith )
	-- say something if fighting, otherwise say nothing
	chatBusy( name, chatWith ) ;
end

function chat_hearts_mp23d16( name, chatWith )
	addTimedHeartMaker( "dartagnan", 4.0 ) ;
	--autoDeleteFaceChat( name, chatWith, getString( "mp23d16" ) ) ;
	sayAndWait( name, getString( "mp23d16" ) ) ;
end

function chat_hearts_mp24d15( name, chatWith )
	addTimedHeartMaker( "dartagnan", 4.0 ) ;
	--autoDeleteFaceChat( name, chatWith, getString( "mp24d15" ) ) ;
	sayAndWait( name, getString( "mp24d15" ) ) ;
end

function chat_hearts_mp34d18( name, chatWith )
	addTimedHeartMaker( "constance", 4.0 ) ;
	--autoDeleteFaceChat( name, chatWith, getString( "mp34d18" ) ) ;
	sayAndWait( name, getString( "mp34d18" ) ) ;
end

function chat_hearts_mpb20d15( name, chatWith )
	addTimedHeartMaker( "kitty", 4.0 ) ;
	--autoDeleteFaceChat( name, chatWith, getString( "mpb20d15" ) ) ;
	sayAndWait( name, getString( "mpb20d15" ) ) ;
end

function chat_mr4d28( name, chatWith )
	--local bubInd = characterSay( name, true, -1, BUBBLE_PROX_N, true, text ) ;
	--setBubbleChatWith( bubInd, chatWith ) ;
	--autoDeleteBubble( bubInd ) ;

	--autoDeleteFaceChat( chatWith, name, getString( "mr4d28" ) ) ;
	sayAndWait( name, getString( "mr4d28" ) ) ;
end

function dress_missionparis18lady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "d6bd65" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "d6bd65" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "d6bd65" ) ;
	addCharacterPiece( name, "w_hair_curly", "221206" ) ;
	addCharacterPiece( name, "w_stripe_torso", "897f5e" ) ;
	addCharacterPiece( name, "w_stripe_legs", "897f5e" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "897f5e" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "897f5e" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "99b980" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "99b980" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "99b980" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "99b980" ) ;
end

function dress_randladyinsultlady( name )
	clearCharacterPieces( name ) ;
	
	local randDressNum = randomInt( 0, 2 ) ;
	local dressColour = "000000" ;
	if ( randDressNum == 0 ) then
		dressColour = "c6b062" ;
	else
		dressColour = "6986c1" ;
	end
	
	local randHairNum = randomInt( 0, 3 ) ;
	local hairColour = "000000" ;
	if ( randHairNum == 0 ) then
		hairColour = "916827" ;
	elseif ( randHairNum == 1 ) then
		hairColour = "d5c964" ;
	else
		hairColour = "26211c" ;
	end
	
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "b3ac94" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "b3ac94" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "b3ac94" ) ;
	addCharacterPiece( name, "w_hair_short", hairColour ) ;
	addCharacterPiece( name, "w_stripe_torso", "e7d08e" ) ;
	addCharacterPiece( name, "w_stripe_legs", "e7d08e" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", dressColour ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", dressColour ) ;
	addCharacterPiece( name, "w_dress_plain_torso", dressColour ) ;
	addCharacterPiece( name, "w_dress_plain_legs", dressColour ) ;
end

function dress_randdistressedwoman( name )
	local randDressTopNum = randomInt( 0, 2 ) ;
	local dressColourTop = "000000" ;
	if ( randDressTopNum == 0 ) then
		dressColourTop = "ada382" ;
	else
		dressColourTop = "b5b4b4" ;
	end
	
	local randDressBottomNum = randomInt( 0, 2 ) ;
	local dressColourBottom = "000000" ;
	if ( randDressBottomNum == 0 ) then
		dressColourBottom = "655b3b" ;
	else
		dressColourBottom = "6d6b6b" ;
	end
	
	local randHairNum = randomInt( 0, 3 ) ;
	local hairColour = "000000" ;
	if ( randHairNum == 0 ) then
		hairColour = "916827" ;
	elseif ( randHairNum == 1 ) then
		hairColour = "d5c964" ;
	else
		hairColour = "26211c" ;
	end

	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "ebe6d4" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "c7def3" ) ;
	addCharacterPiece( name, "w_hair_pinned", hairColour ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", dressColourTop ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", dressColourTop ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", dressColourTop ) ;
	addCharacterPiece( name, "w_dress_plain_legs", dressColourBottom ) ;
	addCharacterPiece( name, "w_hat_cap", "ebe6d4" ) ;

end

function dress_randseamstress( name )
	local randDressNum = randomInt( 0, 2 ) ;
	local dressColour = "000000" ;
	if ( randDressNum == 0 ) then
		dressColour = "39782e" ;
	else
		dressColour = "dc983f" ;
	end
	
	local randStripeNum = randomInt( 0, 2 ) ;
	local stripeColour = "000000" ;
	if ( randStripeNum == 0 ) then
		stripeColour = "dfc430" ;
	else
		stripeColour = "7d674b" ;
	end
	
	local randHairNum = randomInt( 0, 3 ) ;
	local hairColour = "000000" ;
	if ( randHairNum == 0 ) then
		hairColour = "916827" ;
	elseif ( randHairNum == 1 ) then
		hairColour = "d5c964" ;
	else
		hairColour = "26211c" ;
	end

	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "edead9" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_plain", hairColour ) ;
	addCharacterPiece( name, "w_stripe_torso", stripeColour ) ;
	addCharacterPiece( name, "w_stripe_legs", stripeColour ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", dressColour ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", dressColour ) ;
	addCharacterPiece( name, "w_dress_plain_torso", dressColour ) ;
	addCharacterPiece( name, "w_dress_plain_legs", dressColour ) ;

end

function dress_randbaker( name )
	clearCharacterPieces( name ) ;
	
	local randShirtNum = randomInt( 0, 2 ) ;
	local shirtColour = "000000" ;
	if ( randShirtNum == 0 ) then
		shirtColour = "8c7d45" ;
	else
		shirtColour = "d3cbad" ;
	end
	
	local randPantsNum = randomInt( 0, 2 ) ;
	local pantsColour = "000000" ;
	if ( randPantsNum == 0 ) then
		pantsColour = "675d39" ;
	else
		pantsColour = "232323" ;
	end
	
	local randHairNum = randomInt( 0, 3 ) ;
	local hairColour = "000000" ;
	if ( randHairNum == 0 ) then
		hairColour = "2f210a" ;
	elseif ( randHairNum == 1 ) then
		hairColour = "7d7c75" ;
	else
		hairColour = "735a2d" ;
	end

	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", hairColour ) ;
	addCharacterPiece( name, "belt", "504230" ) ;
	addCharacterPiece( name, "beret", "8f7552" ) ;
	addCharacterPiece( name, "boot_plain_right", "474747" ) ;
	addCharacterPiece( name, "boot_plain_left", "474747" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "hair_long", hairColour ) ;
	addCharacterPiece( name, "pant_musketeer_right", pantsColour ) ;
	addCharacterPiece( name, "pant_musketeer_left", pantsColour ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", shirtColour ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", shirtColour ) ;
	addCharacterPiece( name, "shirt_plain_torso", shirtColour ) ;
end

function dress_randtailor( name )
	clearCharacterPieces( name ) ;

	local randOverNum = randomInt( 0, 2 ) ;
	local overColour = "000000" ;
	if ( randOverNum == 0 ) then
		overColour = "915f94" ;
	else
		overColour = "9b3a4f" ;
	end
	
	local randUnderNum = randomInt( 0, 2 ) ;
	local underColour = "000000" ;
	if ( randUnderNum == 0 ) then
		underColour = "deb740" ;
	else
		underColour = "757678" ;
	end

	local randHairNum = randomInt( 0, 3 ) ;
	local hairColour = "000000" ;
	if ( randHairNum == 0 ) then
		hairColour = "2f210a" ;
	elseif ( randHairNum == 1 ) then
		hairColour = "7d7c75" ;
	else
		hairColour = "735a2d" ;
	end

	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", hairColour  ) ;
	addCharacterPiece( name, "sashbelt", "e7ce23" ) ;
	addCharacterPiece( name, "boot_fancy_right", "7c7c7c"  ) ;
	addCharacterPiece( name, "boot_fancy_left", "7c7c7c" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "hair_curly", hairColour ) ;
	addCharacterPiece( name, "mustache_b", hairColour ) ;
	addCharacterPiece( name, "pant_baggy_right", underColour ) ;
	addCharacterPiece( name, "pant_baggy_left", underColour ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", overColour ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", overColour ) ;
	addCharacterPiece( name, "shirt_fancy_torso", overColour ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", underColour ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", underColour ) ;
	addCharacterPiece( name, "shirt_plain_torso", underColour ) ;
end

function dress_randarmorer( name )
	clearCharacterPieces( name ) ;
	
	local randLeatherNum = randomInt( 0, 2 ) ;
	local leatherColour = "000000" ;
	if ( randLeatherNum == 0 ) then
		leatherColour = "2f281f" ;
	else
		leatherColour = "686156" ;
	end
	
	local randDoubletNum = randomInt( 0, 2 ) ;
	local doubletColour = "000000" ;
	if ( randDoubletNum == 0 ) then
		doubletColour = "5d8b64" ;
	else
		doubletColour = "ce9647" ;
	end

	local randHairNum = randomInt( 0, 3 ) ;
	local hairColour = "000000" ;
	if ( randHairNum == 0 ) then
		hairColour = "2f210a" ;
	elseif ( randHairNum == 1 ) then
		hairColour = "7d7c75" ;
	else
		hairColour = "735a2d" ;
	end

	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beardmus", hairColour ) ;
	addCharacterPiece( name, "belt", "543d1c" ) ;
	addCharacterPiece( name, "boot_plain_right", leatherColour ) ;
	addCharacterPiece( name, "boot_plain_left", leatherColour ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_torso", doubletColour ) ;
	addCharacterPiece( name, "glove_plain_right", leatherColour ) ;
	addCharacterPiece( name, "glove_plain_left", leatherColour ) ;
	addCharacterPiece( name, "hair_short", hairColour ) ;
	addCharacterPiece( name, "pant_musketeer_right", "775c36" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "775c36" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d3d3d3" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d3d3d3" ) ;
end

function dress_randjeweller( name )
	clearCharacterPieces( name ) ;
	
	local randPantsNum = randomInt( 0, 2 ) ;
	local pantsColour = "000000" ;
	if ( randPantsNum == 0 ) then
		pantsColour = "84817c" ;
	else
		pantsColour = "392f1c" ;
	end
	
	local randDoubletNum = randomInt( 0, 2 ) ;
	local doubletColour = "000000" ;
	if ( randDoubletNum == 0 ) then
		doubletColour = "ceb739" ;
	else
		doubletColour = "334786" ;
	end

	local randHairNum = randomInt( 0, 3 ) ;
	local hairColour = "000000" ;
	if ( randHairNum == 0 ) then
		hairColour = "2f210a" ;
	elseif ( randHairNum == 1 ) then
		hairColour = "7d7c75" ;
	else
		hairColour = "735a2d" ;
	end
	
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", hairColour ) ;
	addCharacterPiece( name, "belt", "84642d" ) ;
	addCharacterPiece( name, "boot_sock_right", "d0c7b4" ) ;
	addCharacterPiece( name, "boot_sock_left", "d0c7b4" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", doubletColour ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", doubletColour ) ;
	addCharacterPiece( name, "doublet_plain_torso", doubletColour ) ;
	addCharacterPiece( name, "feather_hat_small", "d72c2c" ) ;
	addCharacterPiece( name, "hat_simple", "9d8d63" ) ;
	addCharacterPiece( name, "hair_medium", hairColour ) ;
	addCharacterPiece( name, "mustache_a", hairColour ) ;
	addCharacterPiece( name, "pant_baggy_right", pantsColour ) ;
	addCharacterPiece( name, "pant_baggy_left", pantsColour ) ;	
	addCharacterPiece( name, "stripe_plain_leg_right", doubletColour ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", doubletColour ) ;
end



-- D'Artagnan
function init_dartagnan( name )
	setAllowPermanentDeath( name, false ) ;
	setIgnoreFreeze( name, true ) ;
	--setWalkSpeed( name, 108 ) ; -- 108
	setRangedAttackDist( name, 800 ) ; -- shoot anyone visible
	setHasLootDrop( name, false ) ;
end

function place_dartagnanA( name )
end

function dress_dartagnanA( name )	
end

function dress_dartagnanLady( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	local pinkR = 1.0 ;
	local pinkG = 0.5 ;
	local pinkB = 0.75 ;
	
	addCharacterPiece( name, "hat_simple", pinkR, pinkG, pinkB ) ;
		
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "pant_monk_legs", pinkR, pinkG, pinkB ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", pinkR, pinkG, pinkB ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", pinkR, pinkG, pinkB ) ;
	addCharacterPiece( name, "shirt_plain_torso", pinkR, pinkG, pinkB ) ;

	addCharacterPiece( name, "hair_long", 0.6, 0.4, 0.3, 1.0 ) ;
end

function tempDress( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "feather_hat_small", 0.83, 0.77, 0.43 ) ;
	addCharacterPiece( name, "beret", 0.38, 0.47, 0.6 ) ;
	addCharacterPiece( name, "boot_plain_right", 0.51, 0.51, 0.51 ) ;
	addCharacterPiece( name, "boot_plain_left", 0.51, 0.51, 0.51 ) ;
	addCharacterPiece( name, "hair_long", "a58468") ;
	addCharacterPiece( name, "collar_plain") ;
	addCharacterPiece( name, "glove_plain_right", "7c7c7c" ) ;
	addCharacterPiece( name, "glove_plain_left", "7c7c7c" ) ;
	addCharacterPiece( name, "sashbelt", 0.58, 0.49, 0.38 ) ;
	addCharacterPiece( name, "pant_musketeer_right", 0.64, 0.48, 0.29 ) ;
	addCharacterPiece( name, "pant_musketeer_left", 0.64, 0.48, 0.29 ) ;
	addCharacterPiece( name, "doublet_plain_torso", 0.63, 0.69, 0.76 ) ;
	addCharacterPiece( name, "shirt_plain_arm_right",  0.63, 0.69, 0.76 ) ;
	addCharacterPiece( name, "shirt_plain_arm_left",  0.63, 0.69, 0.76 ) ;
	
end

function runAI_dartagnan( name )
	setCameraFollowCharacter( name, false )
end

function chat_dartagnan( name, chatWith )
end

--Planchet clothing
function init_planchet( name )
end

function getPlanchetALevel( )
	return "bonacieuxhouse2" ;
end

function getPlanchetAPosX( )
	return -163 ;
end

function getPlanchetAPosY( )
	return 84 ;
end

function place_planchetA( name )
	placeCharacter( name, getPlanchetALevel( ), getPlanchetAPosX( ), getPlanchetAPosY( ) ) ;
end

function place_planchetB( name )
	placeCharacter( name, "france", -7632, 9111 ) ;
end

function dress_planchetA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;

	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "8ba473" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "8ba473" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "8ba473" ) ;
	addCharacterPiece( name, "boot_plain_right", "7e6d4e" ) ;
	addCharacterPiece( name, "boot_plain_left", "7e6d4e" );
	addCharacterPiece( name, "pant_musketeer_right", "787469" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "787469" ) ;
	addCharacterPiece( name, "belt", "eadab6" ) ;
	addCharacterPiece( name, "beret", "e2c66e" ) ;
	addCharacterPiece( name, "mustache_b", "93866f" ) ;
end

function setownedhorse_planchetA( name )
	removeOwnedHorse( name ) ;
end

function setownedhorse_planchetB( name )
	setOwnedHorse( name, "planchethorse" ) ;
end

function runAI_planchet( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceCharacter( name, "dartagnan" ) ;
		wait( 1 ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_planchet( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "planchet_d" .. randomInt( 1, 4 ) ) ) ;
	sayAndWait( name, getString( "planchet_d" .. randomInt( 1, 4 ) ) ) ;
end

-- mother
function init_mother( name )
end

function place_mother( name )
	placeCharacter( name, "dartelderhouse", -400, -210 ) ;
end

function dress_mother( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", 0.78, 0.55, 0.55 ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", 0.78, 0.55, 0.55 ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", 0.78, 0.55, 0.55 ) ;
	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", 0.64, 0.48, 0.29 ) ;
	addCharacterPiece( name, "w_hat_cap"  ) ;
	addCharacterPiece( name, "w_hair_pinned", 0.74, 0.68, 0.60  ) ;
	
end

function runAI_mother( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		if ( isMissionActive( "missiontarbes3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 1 ) ;
		else
			local destX = -394 ;
			local destY = -254 ;
			addGoalGetToPointInLevel( name, destX, destY, "dartelderhouse", false ) ;
			setBaseFaceDirection( name, 0, -1 ) ;
			waitForNoGoal( name ) ;
			
			wait( 2 ) ;
			
			destX = -467 ;
			destY = -229 ;
			addGoalGetToPointInLevel( name, destX, destY, "dartelderhouse", false ) ;
			setBaseFaceDirection( name, -1, 0 ) ;
			waitForNoGoal( name ) ;
			
			wait( 8 ) ;
		end
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_mother( name, chatWith )
	if ( isMissionActive( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mother_d2" ) ) ;
		sayAndWait( name, getString( "mother_d2" ) ) ;
	elseif ( isMissionComplete( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mother_d3" ) ) ;
		sayAndWait( name, getString( "mother_d3" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "mother_d1" ) ) ;
		sayAndWait( name, getString( "mother_d1" ) ) ;
	end
end

-- father
function init_father( name )
end

function place_father( name )
	placeCharacter( name, "dartelderhouse", 284, -253 ) ;
end

function dress_father( name )
	clearCharacterPieces( name ) ;
	local darkness = 0.80 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a", 0.52, 0.49, 0.44 ) ;
	addCharacterPiece( name, "belt", 0.64, 0.57, 0.49 ) ;
	addCharacterPiece( name, "boot_plain_right", 0.49, 0.33, 0.19 ) ;
	addCharacterPiece( name, "boot_plain_left", 0.49, 0.33, 0.19 ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "hair_short", 0.52, 0.49, 0.44 ) ;
	addCharacterPiece( name, "mustache_b", 0.52, 0.49, 0.44 ) ;
	addCharacterPiece( name, "pant_baggy_right", 0.51, 0.52, 0.44 ) ;
	addCharacterPiece( name, "pant_baggy_left", 0.51, 0.52, 0.44 ) ;
	addCharacterPiece( name, "doublet_plain_torso", 0.64, 0.57, 0.49 ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", 0.64, 0.57, 0.49 ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", 0.64, 0.57, 0.49 ) ;
end

function runAI_father( name )
	while ( true ) do
		if ( isMissionActive( "missiontarbes3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 1 ) ;
		else
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
		
		coroutine.yield( ) ;
	end
end

function chat_father( name, chatWith )
	if ( isMissionActive( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "father_d2" ) ) ;
		sayAndWait( name, getString( "father_d2" ) ) ;
	elseif ( isMissionComplete( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "father_d3" ) ) ;
		sayAndWait( name, getString( "father_d3" ) ) ;	
	else
		--autoDeleteFaceChat( name, chatWith, getString( "father_d1" ) ) ;
		sayAndWait( name, getString( "father_d1" ) ) ;	
	end
end

-- familyservant1
function init_familyservant1( name )
end

function place_familyservant1( name )
	placeCharacter( name, "france", -9947, 16756 ) ;
end

function dress_familyservant1( name )
	clearCharacterPieces( name ) ;
	local darkness = 0.70 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", 0.85, 0.83, 0.52 ) ;
	addCharacterPiece( name, "belt",0.52, 0.45, 0.39 ) ;
	addCharacterPiece( name, "boot_plain_right" ) ;
	addCharacterPiece( name, "boot_plain_left" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "hair_short", 0.85, 0.83, 0.52 ) ;
	addCharacterPiece( name, "hat_simple", 0.71, 0.60, 0.5 ) ;
	addCharacterPiece( name, "pant_musketeer_right", 0.52, 0.59, 0.43 ) ;
	addCharacterPiece( name, "pant_musketeer_left", 0.52, 0.59, 0.43 ) ;
	addCharacterPiece( name, "shirt_plain_torso", 0.82, 0.76, 0.61 ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", 0.82, 0.76, 0.61  ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", 0.82, 0.76, 0.61  ) ;
end

function runAI_familyservant1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		if ( isMissionActive( "missiontarbes3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 1 ) ;
		elseif ( isMissionComplete( "missiontarbes1" ) ) then
			while ( true ) do
				local destX = -9947 ;
				local destY = 16756 ;
				pathfindToPos( name, destX, destY ) ;
				coroutine.yield( ) ; -- takes one frame to start pathfinding
				
				while ( isPathfinding( name ) ) do
					coroutine.yield( ) ;
				end
				
				wait( 2 ) ;
				
				destX = -9980 ;
				destY = 16867 ;
				pathfindToPos( name, destX, destY ) ;
				coroutine.yield( ) ; -- takes one frame to start pathfinding
				
				while ( isPathfinding( name ) ) do
					coroutine.yield( ) ;
				end
				
				wait( 2 ) ;
				
				destX = -9982 ;
				destY = 17017 ;
				pathfindToPos( name, destX, destY ) ;
				coroutine.yield( ) ; -- takes one frame to start pathfinding
				
				while ( isPathfinding( name ) ) do
					coroutine.yield( ) ;
				end
				
				wait( 2 ) ;
				
				destX = -9714 ;
				destY = 17021 ;
				pathfindToPos( name, destX, destY ) ;
				coroutine.yield( ) ; -- takes one frame to start pathfinding
				
				while ( isPathfinding( name ) ) do
					coroutine.yield( ) ;
				end
				
				wait( 2 ) ;
				
				destX = -9716 ;
				destY = 16876 ;
				pathfindToPos( name, destX, destY ) ;
				coroutine.yield( ) ; -- takes one frame to start pathfinding
				
				while ( isPathfinding( name ) ) do
					coroutine.yield( ) ;
				end
				
				wait( 2 ) ;
				
				destX = -9738 ;
				destY = 16721 ;
				pathfindToPos( name, destX, destY ) ;
				coroutine.yield( ) ; -- takes one frame to start pathfinding
				
				while ( isPathfinding( name ) ) do
					coroutine.yield( ) ;
				end
				
				wait( 2 ) ;
			end
		end
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_familyservant1( name, chatWith )
	if ( isMissionActive( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "familyservant_d2" ) ) ;
		sayAndWait( name, getString( "familyservant_d2" ) ) ;
	elseif ( isMissionComplete( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "familyservant_d3" ) ) ;
		sayAndWait( name, getString( "familyservant_d3" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "familyservant_d1" ) ) ;
		sayAndWait( name, getString( "familyservant_d1" ) ) ;
	end
end

-- tarbesalady
function init_tarbesalady( name )
	setWoman( name, true ) ;
end

function place_tarbesalady( name )
	placeCharacter( name, "tarbeshousea", 176, -152 ) ;
end

function dress_tarbesalady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", 0.8, 0.69, 0.82 ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", 0.8, 0.69, 0.82 ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", 0.8, 0.69, 0.82 ) ;
	addCharacterPiece( name, "w_apron", 0.87, 0.92, 0.94 ) ;
	addCharacterPiece( name, "w_dress_plain_legs", 0.86, 0.75, 0.94 ) ;
	addCharacterPiece( name, "w_hair_plain", 0.92, 0.75, 0.52  ) ;
end

function runAI_tarbesalady( name )
	while ( true ) do
		if ( isMissionActive( "missiontarbes3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 1 ) ;
		else
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
	
		coroutine.yield( ) ;	
	end
end

function chat_tarbesalady( name, chatWith )
	if ( isMissionActive( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "tarbesalady_d6" ) ) ;
		sayAndWait( name, getString( "tarbesalady_d6" ) ) ;
	elseif ( isMissionComplete( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "tarbesalady_d7" ) ) ;
		sayAndWait( name, getString( "tarbesalady_d7" ) ) ;
	else
		--setBaseFaceCharacter( name, "dartagnan" ) ;
		local bubInd = characterSay( name, true, -1, -1, true, getString( "tarbesalady_d1" ) ) ;
		waitForBubbleClosed( bubInd ) ;
		bubInd = characterSay( chatWith, true, -1, -1, true, getString( "tarbesalady_d2" ) ) ;
		waitForBubbleClosed( bubInd ) ;
		bubInd = characterSay( name, true, -1, -1, true, getString( "tarbesalady_d3" ) ) ;
		waitForBubbleClosed( bubInd ) ;
		bubInd = characterSay( chatWith, true, -1, -1, true, getString( "tarbesalady_d4" ) ) ;
		waitForBubbleClosed( bubInd ) ;
		bubInd = characterSay( name, true, -1, -1, true, getString( "tarbesalady_d5" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	end
end

-- tarbesaman
function init_tarbesaman( name )
end

function place_tarbesaman( name )
	placeCharacter( name, "france", -8278, 17076 ) ;
end

function dress_tarbesaman( name )
	clearCharacterPieces( name ) ;
	local darkness = 0.80 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "beret", 0.76, 0.35, 0.28 ) ;
	addCharacterPiece( name, "boot_sock_right" ) ;
	addCharacterPiece( name, "boot_sock_left" ) ;
	addCharacterPiece( name, "glove_plain_right", 0.64, 0.52, 0.50 ) ;
	addCharacterPiece( name, "glove_plain_left", 0.64, 0.52, 0.50 ) ;
	addCharacterPiece( name, "doublet_plain_torso", 0.75, 0.50, 0.47 ) ;
	addCharacterPiece( name, "doublet_plain_arm_right",  0.75, 0.50, 0.47 ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", 0.75, 0.50, 0.47 ) ;
	addCharacterPiece( name, "feather_hat_small", 0.29, 0.41, 0.67 ) ;
	addCharacterPiece( name, "mustache_b", 0.85, 0.74, 0.42 ) ;
	addCharacterPiece( name, "hair_curly", 0.85, 0.74, 0.42  ) ;
	addCharacterPiece( name, "pant_baggy_right", 0.73, 0.65, 0.40 ) ;
	addCharacterPiece( name, "pant_baggy_left", 0.73, 0.65, 0.40 ) ;

end

function runAI_tarbesaman( name )
	while ( true ) do
		if ( isMissionActive( "missiontarbes3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 1 ) ;
		else
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	
		coroutine.yield( ) ;	
	end
end

function chat_tarbesaman( name, chatWith )
	if ( isMissionActive( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "tarbesaman_d2" ) ) ;
		sayAndWait( name, getString( "tarbesaman_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "tarbesaman_d1" ) ) ;
		sayAndWait( name, getString( "tarbesaman_d1" ) ) ;
	end
end

-- tarbesblady
function init_tarbesblady( name )
	setWoman( name, true ) ;
end

function place_tarbesblady( name )
	placeCharacter( name, "france", -9771, 17626) ;
end

function dress_tarbesblady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", 0.91, 0.89, 0.58 ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", 0.91, 0.89, 0.58 ) ;
	addCharacterPiece( name, "w_dress_plain_torso", 0.91, 0.89, 0.58 ) ;
	addCharacterPiece( name, "w_apron"  ) ;
	addCharacterPiece( name, "w_hat_plain", 0.79, 0.71, 0.56  ) ;
	addCharacterPiece( name, "w_hair_pinned", 0.28, 0.18, 0.04  ) ;
	addCharacterPiece( name, "w_dress_plain_legs", 0.46, 0.45, 0.31 ) ;
end

function runAI_tarbesblady( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		if ( isMissionActive( "missiontarbes3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 1 ) ;
		else
			local destX = -9887 ;
			local destY = 17596 ;
			pathfindToPos( name, destX, destY ) ;
			coroutine.yield( ) ; -- takes one frame to start pathfinding
			
			setBaseFaceDirection( name, -1, 0 ) ;
						
			while ( isPathfinding( name ) ) do
				coroutine.yield( ) ;
			end
			
			wait( 1 ) ;
			
			destX = randomInt( -9900, -9682 ) ;
			destY = randomInt( 17645, 17711 ) ;
			pathfindToPos( name, destX, destY ) ;
			coroutine.yield( ) ; -- takes one frame to start pathfinding

			setBaseFaceNone( name ) ;
			
			while ( isPathfinding( name ) ) do
				coroutine.yield( ) ;
			end
			
			wait( 2 ) ;
		end
		
		coroutine.yield( ) ;	
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_tarbesblady( name, chatWith )
	if ( isMissionActive( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "tarbesblady_d2" ) ) ;
		sayAndWait( name, getString( "tarbesblady_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "tarbesblady_d1" ) ) ;
		sayAndWait( name, getString( "tarbesblady_d1" ) ) ;
	end
end

-- tarbesbman
function init_tarbesbman( name )
end

function place_tarbesbman( name )
	placeCharacter( name, "tarbeshouseb", -270, -120 ) ;
end

function dress_tarbesbman( name )
	clearCharacterPieces( name ) ;
	local skinR = 0.85 ;
	local skinG = 0.8 ;
	local skinB = 0.8 ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "beard_a", 0.49, 0.41, 0.34 ) ;
	addCharacterPiece( name, "mustache_a", 0.49, 0.41, 0.34 ) ;
	addCharacterPiece( name, "boot_plain_right", 0.53, 0.58, 0.66 ) ;
	addCharacterPiece( name, "boot_plain_left", 0.53, 0.58, 0.66 ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "shirt_plain_torso", 0.85, 0.84, 0.71 ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", 0.85, 0.84, 0.71 ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", 0.85, 0.84, 0.71 ) ;
	addCharacterPiece( name, "pant_baggy_right", 0.66, 0.65, 0.59 ) ;
	addCharacterPiece( name, "pant_baggy_left", 0.66, 0.65, 0.59 ) ;
	
	
end

function runAI_tarbesbman( name )
	while ( true ) do
		if ( isMissionActive( "missiontarbes3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 1 ) ;
		else
			local destX = -330 ;
			local destY = -135 ;
			pathfindToPos( name, destX, destY ) ;
			coroutine.yield( ) ; -- takes one frame to start pathfinding
			
			while ( isPathfinding( name ) ) do
				coroutine.yield( ) ;
			end
			
			destX = -230 ;
			destY = -136 ;
			pathfindToPos( name, destX, destY ) ;
			coroutine.yield( ) ; -- takes one frame to start pathfinding
			
			while ( isPathfinding( name ) ) do
				coroutine.yield( ) ;
			end
		end
		
		coroutine.yield( ) ;
	end
end

function chat_tarbesbman( name, chatWith )
	if ( isMissionActive( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "tarbesbman_d2" ) ) ;
		sayAndWait( name, getString( "tarbesbman_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "tarbesbman_d1" ) ) ;
		sayAndWait( name, getString( "tarbesbman_d1" ) ) ;
	end
end

-- tarbesclady
function init_tarbesclady( name )
	setWoman( name, true ) ;
end

function place_tarbesclady( name )
	placeCharacter( name, "tarbeshousec", -276, 41 ) ;
	setBaseFaceDirection( name, 0, -1 ) ; -- face bookshelf
end

function dress_tarbesclady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_stripe_torso", 0.87, 0.81, 0.68  ) ;
	addCharacterPiece( name, "w_stripe_legs", 0.87, 0.81, 0.68  ) ;
	addCharacterPiece( name, "w_dress_plain_legs", 0.55, 0.49, 0.37 ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", 0.55, 0.49, 0.37 ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", 0.55, 0.49, 0.379 ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", 0.55, 0.49, 0.37 ) ;
	addCharacterPiece( name, "w_hair_pinned", 0.73, 0.71, 0.64  ) ;
end

function runAI_tarbesclady( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		if ( isMissionActive( "missiontarbes3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 1 ) ;
		else
			local destX = -488 ;
			local destY = 35 ;
			pathfindToPos( name, destX, destY ) ;
			coroutine.yield( ) ; -- takes one frame to start pathfinding

			setBaseFaceDirection( name, 0, -10 ) ;
			
			while ( isPathfinding( name ) ) do
				coroutine.yield( ) ;
			end
			
			wait( 5 ) ;
			
			destX = -276 ;
			destY = 41 ;
			pathfindToPos( name, destX, destY ) ;
			coroutine.yield( ) ; -- takes one frame to start pathfinding

			setBaseFaceDirection( name, 0, -10 ) ;
			
			while ( isPathfinding( name ) ) do
				coroutine.yield( ) ;
			end
			
			wait( 5 ) ;
		end
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_tarbesclady( name, chatWith )
	if ( isMissionActive( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "tarbesclady_d2" ) ) ;
		sayAndWait( name, getString( "tarbesclady_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "tarbesclady_d1" ) ) ;
		sayAndWait( name, getString( "tarbesclady_d1" ) ) ;
	end
end

-- tarbescman
function init_tarbescman( name )
end

function place_tarbescmanA( name )
	sitCharacter( name, "tarbescchair" ) ;
end

function place_tarbescmanB( name )
	placeCharacter( name, "france", -8665, 17350 ) ;
end

function dress_tarbescmanBurn( name, burn )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	addCharacterPiece( name, "nm_head", skinR * burn, skinG * burn, skinB * burn ) ;
	addCharacterPiece( name, "nm_hand_left", skinR * burn, skinG * burn, skinB * burn ) ;
	addCharacterPiece( name, "nm_hand_right", skinR * burn, skinG * burn, skinB * burn ) ;
	addCharacterPiece( name, "collar_big", 1 * burn, 1 * burn, 1 * burn, .9 ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1 * burn, 1 * burn, 1 * burn, .9 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1 * burn, 1 * burn, 1 * burn, .9 ) ;
	addCharacterPiece( name, "hair_medium", 0.75 * burn, 0.75 * burn, 0.75 * burn ) ;
	addCharacterPiece( name, "mustache_b", 0.75 * burn, 0.75 * burn, 0.75 * burn ) ;
	addCharacterPiece( name, "boot_fancy_right", 0.72 * burn, 0.66 * burn, 0.29 * burn ) ;
	addCharacterPiece( name, "boot_fancy_left", 0.72 * burn, 0.66 * burn, 0.29 * burn ) ;
	addCharacterPiece( name, "sashbelt", 0.84 * burn, 0.74 * burn, 0.64 * burn ) ;
	addCharacterPiece( name, "pant_musketeer_right", 0.40 * burn, 0.55 * burn, 0.73 * burn ) ;
	addCharacterPiece( name, "pant_musketeer_left", 0.40 * burn, 0.55 * burn, 0.73 * burn ) ;
	addCharacterPiece( name, "shirt_fancy_torso", 0.95 * burn, 0.87 * burn, 0.45 * burn ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", 0.95 * burn, 0.87 * burn, 0.45 * burn ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", 0.95 * burn, 0.87 * burn, 0.45 * burn ) ;
	addCharacterPiece( name, "shirt_plain_torso", 0.95 * burn, 0.87 * burn, 0.45 * burn ) ;
end

function dress_tarbescmanA( name )
	dress_tarbescmanBurn( name, 1.0 ) ;
end

function dress_tarbescmanB( name )
	dress_tarbescmanBurn( name, 0.3 ) ;
end

function runAI_tarbescman( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		if ( isMissionActive( "missiontarbes3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 1 ) ;
		else
			wait( 2 ) ;
			-- make sure mumble doesn't happen during conversation
			if ( ( not gTarbescmanDontMumble ) and ( not characterHasOpenBubble( name ) ) ) then
				local bubInd = characterSay( name, false, 6.0, 150.0, true, getString( "mumbles" ) ) ;
				autoDeleteBubble( bubInd ) ;
			end
			wait( 30 ) ;
		end
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_tarbescman( name, chatWith )
	local split1 = gameIsSplit( ) and getGameSplitPart( ) == 1 ;

	if ( isMissionComplete( "missioninventor2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "minventor2d8" ) ) ;
		sayAndWait( name, getString( "minventor2d8" ) ) ;
	elseif ( isMissionComplete( "missionmeung2" ) ) then
		gTarbescmanDontMumble = true ;
		sayAndWait( name, getString( "minventor0d1" ) ) ;
		sayAndWait( "dartagnan", getString( "minventor0d2" ) ) ;
		
		if ( split1 ) then
			sayAndWait( name, getString( "minventor0d3" ) ) ;
			gTarbescmanDontMumble = false ;
			return ;
		end
		
		local requireHonour = 10 ;
		if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
			sayAndWait( name, getString( "minventor0d3" ) ) ;
			setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
		elseif ( getTooManyActiveMissions( ) ) then
			sayAndWait( name, getString( "minventor0d3" ) ) ;
			setQuickInfoTag( getString( "toomanymissions" ) ) ;
		else
			sayAndWait( name, getString( "minventor0d5" ) ) ;
			sayAndWait( name, getString( "minventor0d6" ) ) ;
			
			local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "minventor0d7" ), getString( "minventor0d8" ) ) ;
			local option = waitForBubbleOption( bubInd ) ;
			
			sayAndWait( name, getString( "minventor0d9" ) ) ;
			sayAndWait( name, getString( "minventor0d10" ) ) ;
			
			local bubInd = characterSay( name, true, -1, -1, false, getString( "minventor0d11" ) ) ;
			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( name, getString( "minventor0d12" ) ) ;
				
				activateMission( "missioninventor1" ) ;
			else
				-- no
			end
		end
		gTarbescmanDontMumble = false ;
	elseif ( isMissionActive( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "minventor0d4" ) ) ;
		sayAndWait( name, getString( "minventor0d4" ) ) ;
	else
		gTarbescmanDontMumble = true ;
		local bubInd = characterSay( name, true, -1, -1, true, getString( "minventor0d1" ) ) ;
		waitForBubbleClosed( bubInd ) ;
		bubInd = characterSay( chatWith, true, -1, -1, true, getString( "minventor0d2" ) ) ;
		waitForBubbleClosed( bubInd ) ;
		bubInd = characterSay( name, true, -1, -1, true, getString( "minventor0d3" ) ) ;
		waitForBubbleClosed( bubInd ) ;
		gTarbescmanDontMumble = false ;
	end
end

-- tarbescservant
function init_tarbescservant( name )
end

function place_tarbescservant( name )
	placeCharacter( name, "tarbeshousec", -13, -224 ) ;
end

function dress_tarbescservant( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;	
	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", 0.68, 0.72, 0.72 ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", 0.68, 0.72, 0.72 ) ;
	addCharacterPiece( name, "w_dress_plain_torso", 0.68, 0.72, 0.72 ) ;
	addCharacterPiece( name, "w_dress_plain_legs", 0.53, 0.38, 0.37 ) ;
	addCharacterPiece( name, "w_hat_cap" ) ;
	addCharacterPiece( name, "w_hair_plain", 0.90, 0.78, 0.53 ) ;
end

function runAI_tarbescservant( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		if ( isMissionActive( "missiontarbes3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 1 ) ;
		else
			local destX = -81 ;
			local destY = -252 ;
			pathfindToPos( name, destX, destY ) ;
			coroutine.yield( ) ; -- takes one frame to start pathfinding

			setBaseFaceDirection( name, 0, -1 ) ;
			
			while ( isPathfinding( name ) ) do
				coroutine.yield( ) ;
			end
			
			wait( 10 ) ;
			
			destX = -66 ;
			destY = -220 ;
			pathfindToPos( name, destX, destY ) ;
			coroutine.yield( ) ; -- takes one frame to start pathfinding

			setBaseFaceDirection( name, 1, 0 ) ;
			
			while ( isPathfinding( name ) ) do
				coroutine.yield( ) ;
			end
			
			wait( 1 ) ;
		end
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_tarbescservant( name, chatWith )
	if ( isMissionActive( "missiontarbes3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "tarbescservant_d2" ) ) ;
		sayAndWait( name, getString( "tarbescservant_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "tarbescservant_d1" ) ) ;
		sayAndWait( name, getString( "tarbescservant_d1" ) ) ;
	end
end

-- roadhousebman
function init_roadhousebman( name )
end

function place_roadhousebman( name )
	placeCharacter( name, "france", -3263, 9971 ) ;
end

function dress_roadhousebman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "tabbard_overlay", 0.3, 0.24, 0.09 ) ;
	addCharacterPiece( name, "tabbard", 0.64, 0.55, 0.38 ) ;
	addCharacterPiece( name, "pant_monk_legs", 0.3, 0.24, 0.09 ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", 0.3, 0.24, 0.09 ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", 0.3, 0.24, 0.09 ) ;
	addCharacterPiece( name, "shirt_plain_torso", 0.3, 0.24, 0.09 ) ;
end

function runAI_roadhousebman( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;
	
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;

		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_roadhousebman( name, chatWith )
	if ( isMissionActive( "missiontarbes7" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "roadhousebman_d1" ) ) ;
		sayAndWait( name, getString( "roadhousebman_d1" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "roadhousebman_d2" ) ) ;
		sayAndWait( name, getString( "roadhousebman_d2" ) ) ;
	end
end

-- meungaman
function init_meungaman( name )
end

function place_meungaman( name )
	sitCharacter( name, "meungachair1" ) ;
end

function dress_meungaman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "collar_plain", 1, 1, 1 ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1, 1, 1 ) ;
	addCharacterPiece( name, "hair_curly", 0.39, 0.35, 0.27 ) ;
	addCharacterPiece( name, "beard_a", 0.39, 0.35, 0.27 ) ;
	addCharacterPiece( name, "belt", .81, .77, .68 ) ;
	addCharacterPiece( name, "boot_sock_right", .81, .77, .68 ) ;
	addCharacterPiece( name, "boot_sock_left", .81, .77, .68 ) ;
	addCharacterPiece( name, "pant_baggy_right", 0.91, 0.71, 0.34 ) ;
	addCharacterPiece( name, "pant_baggy_left", 0.91, 0.71, 0.34 ) ;
	addCharacterPiece( name, "doublet_plain_torso", 0.73, 0.51, 0.75 ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", 0.8, 0.78, 0.71 ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", 0.8, 0.78, 0.71 ) ;
end

function runAI_meungaman( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungaman( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "meungaman_d1" ) ) ;
	sayAndWait( name, getString( "meungaman_d1" ) ) ;
end

-- meungalady
function init_meungalady( name )
	setWoman( name, true ) ;
end

function place_meungalady( name )
	placeCharacter( name, "meunghousea", 128, -13 ) ;
end

function dress_meungalady( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_hair_pinned", 0.88, 0.74, 0.28 ) ;
	addCharacterPiece( name, "w_hat_cap", 0.90, 0.89, 0.85 ) ;
	addCharacterPiece( name, "w_apron", 0.90, 0.89, 0.85 ) ;
	addCharacterPiece( name, "w_dress_plain_legs", 0.53, 0.53, 0.53 ) ;
	addCharacterPiece( name, "w_dress_plain_torso", 0.59, 0.71, 0.86 ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", 0.59, 0.71, 0.86 ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", 0.59, 0.71, 0.86 ) ;
end

function runAI_meungalady( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungalady( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "meungalady_d1" ) ) ;
	sayAndWait( name, getString( "meungalady_d1" ) ) ;
end

-- meungbservant1
function init_meungbservant1( name )
	setWoman( name, true ) ;
end

function place_meungbservant1( name )
	placeCharacter( name, "meunghouseb", 42, -80 ) ;
end

function dress_meungbservant1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_hair_short", 0.73, 0.62, 0.55 ) ;
	addCharacterPiece( name, "w_apron", 0.87, 0.80, 0.75 ) ;
	addCharacterPiece( name, "w_dress_plain_legs", 0.44, 0.36, 0.30 ) ;
	addCharacterPiece( name, "w_dress_plain_torso", 0.68, 0649, 0.53 ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", 0.68, 0649, 0.53 ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", 0.68, 0649, 0.53 ) ;
end

function runAI_meungbservant1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		local destX = 78 ;
		local destY = -94 ;
		addGoalGetToPointInLevel( name, destX, destY, "meunghouseb", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		
		wait( 2 ) ;
		
		destX = 19 ;
		destY = -79 ;
		addGoalGetToPointInLevel( name, destX, destY, "meunghouseb", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		
		wait( 8 ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungbservant1( name, chatWith )
	genericGreeting( name, chatWith, 0.65 ) ;
end

-- meungbservant2
function init_meungbservant2( name )
end

function place_meungbservant2( name )
	placeCharacter( name, "france", -2353, 7679 ) ;
end

function dress_meungbservant2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1, 1, 1 ) ;
	addCharacterPiece( name, "hair_long", 0.28, 0.26, 0.21 ) ;
	addCharacterPiece( name, "beardmus", 0.28, 0.26, 0.21 ) ;
	addCharacterPiece( name, "hat_simple", 0.91, 0.83, 0.58 ) ;
	addCharacterPiece( name, "feather_hat_small", 0.88, 0.21, 0.10 ) ;
	addCharacterPiece( name, "belt", 0.38, 0.32, 0.12 ) ;
	addCharacterPiece( name, "boot_plain_right", 0.38, 0.32, 0.12 ) ;
	addCharacterPiece( name, "boot_plain_left", 0.38, 0.32, 0.12 ) ;
	addCharacterPiece( name, "doublet_plain_torso", 0.85, 0.69, 0.40 ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", 0.85, 0.69, 0.40 ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", 0.85, 0.69, 0.40 ) ;
	addCharacterPiece( name, "pant_musketeer_right", 0.38, 0.27, 0.09 ) ;
	addCharacterPiece( name, "pant_musketeer_left", 0.38, 0.27, 0.09 ) ;
	
end

function runAI_meungbservant2( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		local destX = -1890 ;
		local destY = 7680 ;
		pathfindToPos( name, destX, destY ) ;
		coroutine.yield( ) ; -- takes one frame to start pathfinding
		
		while ( isPathfinding( name ) ) do
			coroutine.yield( ) ;
		end
				
		destX = -1885 ;
		destY = 7700 ;
		pathfindToPos( name, destX, destY ) ;
		coroutine.yield( ) ; -- takes one frame to start pathfinding
		
		while ( isPathfinding( name ) ) do
			coroutine.yield( ) ;
		end
		
		destX = -2353 ;
		destY = 7699 ;
		pathfindToPos( name, destX, destY ) ;
		coroutine.yield( ) ; -- takes one frame to start pathfinding
		
		while ( isPathfinding( name ) ) do
			coroutine.yield( ) ;
		end
		
		destX = -2355 ;
		destY = 7721 ;
		pathfindToPos( name, destX, destY ) ;
		coroutine.yield( ) ; -- takes one frame to start pathfinding
		
		while ( isPathfinding( name ) ) do
			coroutine.yield( ) ;
		end
		
		destX = -1890 ;
		destY = 7719 ;
		pathfindToPos( name, destX, destY ) ;
		coroutine.yield( ) ; -- takes one frame to start pathfinding
		
		while ( isPathfinding( name ) ) do
			coroutine.yield( ) ;
		end
		
		destX = -2359 ;
		destY = 7678 ;
		pathfindToPos( name, destX, destY ) ;
		coroutine.yield( ) ; -- takes one frame to start pathfinding
		
		while ( isPathfinding( name ) ) do
			coroutine.yield( ) ;
		end
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungbservant2( name, chatWith )
	genericGreeting( name, chatWith, 0.9 ) ;
end

-- meungbman
function init_meungbman( name )
end

function place_meungbman( name )
	sitCharacter( name, "meungbchair1" ) ;
end

function dress_meungbman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "hair_medium", 0.72, 0.63, 0.36 ) ;
	addCharacterPiece( name, "beard_b", 0.72, 0.63, 0.36 ) ;
	addCharacterPiece( name, "mustache_b", 0.72, 0.63, 0.36 ) ;
	addCharacterPiece( name, "sashbelt", 0.95, 0.78, 0.26 ) ;
	addCharacterPiece( name, "boot_fancy_right", 0.82, 0.43, 0.27 ) ;
	addCharacterPiece( name, "boot_fancy_left", 0.82, 0.43, 0.27 ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", 0.82, 0.43, 0.27 ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", 0.82, 0.43, 0.27 ) ;
	addCharacterPiece( name, "shirt_fancy_torso", 0.82, 0.43, 0.27 ) ;
	addCharacterPiece( name, "pant_baggy_right", 0.58, 0.71, 0.86) ;
	addCharacterPiece( name, "pant_baggy_left", 0.58, 0.71, 0.86 ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", 0.58, 0.71, 0.86 ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", 0.58, 0.71, 0.86 ) ;
	addCharacterPiece( name, "stripe_plain_torso", 0.58, 0.71, 0.86 ) ;
end

function runAI_meungbman( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungbman( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "meungbman_d1" ) ) ;
	sayAndWait( name, getString( "meungbman_d1" ) ) ;
end

-- meungblady
function init_meungblady( name )
	setWoman( name, true ) ;
end

function place_meungblady( name )
	sitCharacter( name, "meungbchair2" ) ;
end

function dress_meungblady( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_collar_big", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_hair_curly", 0.58, 0.48, 0.35 ) ;
	addCharacterPiece( name, "w_stripe_legs", 0.82, 0.46, 0.43 ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", 0.70, 0.74, 0.88 ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", 0.70, 0.74, 0.88 ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", 0.70, 0.74, 0.88 ) ;
	addCharacterPiece( name, "w_bow_arm_left", 0.82, 0.46, 0.43 ) ;
	addCharacterPiece( name, "w_bow_arm_right", 0.82, 0.46, 0.43 ) ;
	addCharacterPiece( name, "w_bow_torso", 0.82, 0.46, 0.43 ) ;
	addCharacterPiece( name, "w_dress_plain_legs", 0.82, 0.46, 0.43 ) ;
end

function runAI_meungblady( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;


	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungblady( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "meungblady_d1" ) ) ;
	sayAndWait( name, getString( "meungblady_d1" ) ) ;
end

-- meungcman
function init_meungcman( name )
end

function place_meungcman( name )
	placeCharacter( name, "france", -2722, 8108 ) ;
end

function dress_meungcman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "collar_plain", 1, 1, 1 ) ;
	addCharacterPiece( name, "glove_plain_right", 0.79, 0.74, 0.63 ) ;
	addCharacterPiece( name, "glove_plain_left", 0.79, 0.74, 0.63 ) ;
	addCharacterPiece( name, "hair_curly", 0.78, 0.76, 0.46 ) ;
	addCharacterPiece( name, "beard_c", 0.78, 0.76, 0.46 ) ;
	addCharacterPiece( name, "mustache_a", 0.78, 0.76, 0.46 ) ;
	addCharacterPiece( name, "boot_sock_right", 0.90, 0.90, 0.90 ) ;
	addCharacterPiece( name, "boot_sock_left", 0.90, 0.90, 0.90 ) ;
	addCharacterPiece( name, "belt", 0.63, 0.53, 0.39 ) ;
	addCharacterPiece( name, "hat_simple", 0.63, 0.53, 0.39 ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "f2eb92" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "f2eb92" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "95ac71" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "95ac71" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "b19f8f" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "b19f8f" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "b19f8f" ) ;
end

function runAI_meungcman( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		local destX = -1181 ;
		local destY = 8097 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		waitForNoGoal( name ) ;
		
		destX = -1178 ;
		destY = 8574 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		waitForNoGoal( name ) ;
	
		destX = -2719 ;
		destY = 8573 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		waitForNoGoal( name ) ;
	
		destX = -2722 ;
		destY = 8108 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		waitForNoGoal( name ) ;
				
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungcman( name, chatWith )
	genericGreeting( name, chatWith, 1.0 ) ;
end

-- meungclady
function init_meungclady( name )
	setWoman( name, true ) ;
end

function place_meungclady( name )
	placeCharacter( name, "meunghousec", 81, -85 ) ;
end

function dress_meungclady( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hair_plain", "ed9e58" ) ;
	addCharacterPiece( name, "w_stripe_torso", "f2d481" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "f2d481" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "b29f6b" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "b29f6b" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "b29f6b" ) ;
end

function runAI_meungclady( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		-- to barrel
		local destX = 160 ;
		local destY = -94 ;
		pathfindToPos( name, destX, destY ) ;
		coroutine.yield( ) ; -- takes one frame to start pathfinding

		setBaseFaceDirection( name, 0, -1 ) ;
		
		while ( isPathfinding( name ) ) do
			coroutine.yield( ) ;
		end
		
		wait( 2 ) ;
		
		-- right table
		destX = 108 ;
		destY = 1 ;
		pathfindToPos( name, destX, destY ) ;
		coroutine.yield( ) ; -- takes one frame to start pathfinding

		setBaseFaceDirection( name, 1, 0 ) ;
		
		while ( isPathfinding( name ) ) do
			coroutine.yield( ) ;
		end
	
		wait( 2 ) ;
		
		destX = -19 ;
		destY = -51 ;
		pathfindToPos( name, destX, destY ) ;
		coroutine.yield( ) ; -- takes one frame to start pathfinding

		setBaseFaceDirection( name, 0, -1 ) ;
		
		while ( isPathfinding( name ) ) do
			coroutine.yield( ) ;
		end
		
		wait( 2 ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungclady( name, chatWith )
	genericGreeting( name, chatWith, 0.75 ) ;
end

-- meunginnkeeper
function init_meunginnkeeper( name )
end

function place_meunginnkeeper( name )
	placeCharacter( name, "francmeunierhouse", -10, 78 ) ;
end

function dress_meunginnkeeper( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1 ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1, 1, 1 ) ;
	addCharacterPiece( name, "hair_medium", 0.83, 0.80, 0.74 ) ;
	addCharacterPiece( name, "beardmus", 0.83, 0.80, 0.74 ) ;
	addCharacterPiece( name, "boot_sock_right", 0.88, 0.83, 0.70 ) ;
	addCharacterPiece( name, "boot_sock_left", 0.88, 0.83, 0.70 ) ;
	addCharacterPiece( name, "belt", 0.87, 0.76, 0.50 ) ;
	addCharacterPiece( name, "pant_baggy_right", 0.53, 0.56, 0.60 ) ;
	addCharacterPiece( name, "pant_baggy_left", 0.53, 0.56, 0.60 ) ;
	addCharacterPiece( name, "doublet_plain_torso", 0.42, 0.59, 0.33 ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", 0.70, 0.70, 0.70 ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", 0.70, 0.70, 0.70 ) ;
end

function runAI_meunginnkeeper( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meunginnkeeper( name, chatWith )
	if ( isMissionComplete( "missionparis1" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "meunginnkeeper_d4" ) ) ;
		--local bubInd = characterSay( name, true, -1, -1, true, "meunginnkeeper_d4" ) ;
		--waitForBubbleClosed( bubInd ) ;
		
		--sayAndWait( name, getString( "meunginnkeeper_d4" ) ) ;
		
		local items = { 
			"ointment", 
			"beret_1", 
			"hat_simple_poor_1",
			"hat_simple_ok_1",
			"belt_poor_1",
			"belt_ok_1" } ;
		
		chat_vendorCustom( name, chatWith, items, getString( "meunginnkeeper_d4" ), getString( "meunginnkeeper_d5" ), getString( "meunginnkeeper_d5" ) ) ;
		
	elseif ( isMissionComplete( "missionmeung2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "meunginnkeeper_d3" ) ) ;
		sayAndWait( name, getString( "meunginnkeeper_d3" ) ) ;
	else
		local bubInd = characterSay( chatWith, true, -1, -1, true, getString( "meunginnkeeper_d1" ) ) ;
		waitForBubbleClosed( bubInd ) ;
		bubInd = characterSay( name, true, -1, -1, true, getString( "meunginnkeeper_d2" ) ) ;
		waitForBubbleClosed( bubInd ) ;	
	end
end

-- francmeunierman1
function init_francmeunierman1( name )
end

function place_francmeunierman1( name )
	sitCharacter( name, "francmeunierbench1" ) ;
end

function dress_francmeunierman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "feather_hat_small", "dece17" ) ;
	addCharacterPiece( name, "belt", "a0835d" ) ;
	addCharacterPiece( name, "beret", "cf3e2f" ) ;
	addCharacterPiece( name, "boot_fancy_right", "644523" ) ;
	addCharacterPiece( name, "boot_fancy_left", "644523" ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1 ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "4172d5" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "4172d5" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "4172d5" ) ;
	addCharacterPiece( name, "hair_curly", "a97755" ) ;
	addCharacterPiece( name, "mustache_b", "a97755" ) ;
	addCharacterPiece( name, "pant_baggy_right", "8d7463" ) ;
	addCharacterPiece( name, "pant_baggy_left", "8d7463" ) ;
	addCharacterPiece( name, "shirt_plain_torso", 1, 1, 1 ) ;

	
end

function runAI_francmeunierman1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_francmeunierman1( name, chatWith )
	if ( isMissionComplete( "missionparis1" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "francmeunierman1_d3" ) ) ;
		sayAndWait( name, getString( "francmeunierman1_d3" ) ) ;
	elseif ( isMissionComplete( "missionmeung2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "francmeunierman1_d2" ) ) ;
		sayAndWait( name, getString( "francmeunierman1_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "francmeunierman1_d1" ) ) ;
		sayAndWait( name, getString( "francmeunierman1_d1" ) ) ;
	end
end

-- francmeunierman2
function init_francmeunierman2( name )
end

function place_francmeunierman2( name )
	sitCharacter( name, "francmeunierbench2" ) ;
end

function dress_francmeunierman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "beard_c", "d9ca72" ) ;
	addCharacterPiece( name, "mustache_a", "d9ca72" ) ;
	addCharacterPiece( name, "hair_medium", "d9ca72" ) ;
	addCharacterPiece( name, "sashbelt", "785c43" ) ;
	addCharacterPiece( name, "boot_plain_right", "785c43" ) ;
	addCharacterPiece( name, "boot_plain_left", "785c43" ) ;
	addCharacterPiece( name, "glove_plain_right","a65730" ) ;
	addCharacterPiece( name, "glove_plain_left", "a65730" ) ;
	addCharacterPiece( name, "hat_plain", "a65730" ) ;
	addCharacterPiece( name, "belt", "a08375" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "998143" ) ;
	addCharacterPiece( name, "pant_musketeer_left","998143" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "429992" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", 1, 1, 1 ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", 1, 1, 1 ) ;
end

function runAI_francmeunierman2( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_francmeunierman2( name, chatWith )
	if ( isMissionComplete( "missionparis1" ) ) then
		genericGreeting( name, chatWith, 0.8 ) ;
	elseif ( isMissionComplete( "missionmeung2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "francmeunierman2_d2" ) ) ;
		sayAndWait( name, getString( "francmeunierman2_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "francmeunierman2_d1" ) ) ;
		sayAndWait( name, getString( "francmeunierman2_d1" ) ) ;
	end
end

-- francmeunierman3
function init_francmeunierman3( name )
end

function place_francmeunierman3( name )
	sitCharacter( name, "francmeunierbench3" ) ;
end

function dress_francmeunierman3( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "collar_plain", 1, 1, 1 ) ;
	addCharacterPiece( name, "beard_b", "8b847d" ) ;
	addCharacterPiece( name, "hair_long", "8b847d" ) ;
	addCharacterPiece( name, "boot_sock_right", "f6efe8" ) ;
	addCharacterPiece( name, "boot_sock_left", "f6efe8" ) ;
	addCharacterPiece( name, "sashbelt", "cfcfcf" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "cfcfcf" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "cfcfcf" ) ;
	addCharacterPiece( name, "pant_baggy_right","9dc2d8" ) ;
	addCharacterPiece( name, "pant_baggy_left", "9dc2d8" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "e3dd96" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e3dd96" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e3dd96" ) ;
end

function runAI_francmeunierman3( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_francmeunierman3( name, chatWith )
	if ( isMissionComplete( "missionparis1" ) ) then
		genericGreeting( name, chatWith, 0.92 ) ;
	elseif ( isMissionComplete( "missionmeung2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "francmeunierman1_d2" ) ) ;
		sayAndWait( name, getString( "francmeunierman1_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "francmeunierman1_d1" ) ) ;
		sayAndWait( name, getString( "francmeunierman1_d1" ) ) ;
	end
end

-- francmeunierman4
function init_francmeunierman4( name )
end

function place_francmeunierman4( name )
	placeCharacter( name, "francmeunierhouse2", 39, 201 ) ;
end

function dress_francmeunierman4( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "hair_short", "e3dd96" ) ;
	addCharacterPiece( name, "beardmus", "e3dd96" ) ;
	addCharacterPiece( name, "boot_sock_right", "d8ebef" ) ;
	addCharacterPiece( name, "boot_sock_left", "d8ebef" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "76694f" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "76694f" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "c0daa4" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "c0daa4" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "c0daa4" ) ;
end

function runAI_francmeunierman4( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_francmeunierman4( name, chatWith )
	if ( isMissionComplete( "missionmeung2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "francmeunierman1_d2" ) ) ;
		sayAndWait( name, getString( "francmeunierman1_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "francmeunierman1_d1" ) ) ;
		sayAndWait( name, getString( "francmeunierman1_d1" ) ) ;
	end
end

-- francmeunierservant1
function init_francmeunierservant1( name )
	setWoman( name, true ) ;
end

function place_francmeunierservant1( name )
	placeCharacter( name, "francmeunierhouse", 219, -67 ) ;
end

function dress_francmeunierservant1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_hair_pinned","76694f" ) ;
	addCharacterPiece( name, "w_hat_cap", "cccac6" ) ;
	addCharacterPiece( name, "w_apron","cccac6" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a09a8b" ) ;
	addCharacterPiece( name, "w_dress_plain_torso","c6ad72" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "c6ad72" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "c6ad72" ) ;
end

function runAI_francmeunierservant1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		-- to fire
		local destX = 169 ;
		local destY = -94 ;
		pathfindToPos( name, destX, destY ) ;
		coroutine.yield( ) ; -- takes one frame to start pathfinding
		
		setBaseFaceDirection( name, 0, -1 ) ;
		
		while ( isPathfinding( name ) ) do
			coroutine.yield( ) ;
		end
		
		wait( 2 ) ;
		
		-- to table
		destX = 192 ;
		destY = -34 ;
		pathfindToPos( name, destX, destY ) ;
		coroutine.yield( ) ; -- takes one frame to start pathfinding
		
		setBaseFaceDirection( name, -1, 0 ) ;

		while ( isPathfinding( name ) ) do
			coroutine.yield( ) ;
		end
		
		wait( 2 ) ;
	end


	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_francmeunierservant1( name, chatWith )
	genericGreeting( name, chatWith, 0.62 ) ;
end

-- meungdman
function init_meungdman( name )
end

function place_meungdman( name )
	placeCharacter( name, "france", -2434, 8442 ) ;
end

function dress_meungdman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_leg_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_leg_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "hat_simple", "d3b263" ) ;
	addCharacterPiece( name, "mustache_b","8d8b85" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "6a6a6a" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "6a6a6a" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "c3bdae" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "c3bdae" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "c3bdae" ) ;
end

function runAI_meungdman( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungdman( name, chatWith )
	if ( isMissionComplete( "missioncheese2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mcheese2d5" ) ) ;
		sayAndWait( name, getString( "mcheese2d5" ) ) ;
	else
		local requireHonour = 10 ;
		if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
			sayAndWait( name, getString( "mcheese0d1" ) ) ;
			setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
		elseif ( getTooManyActiveMissions( ) ) then
			sayAndWait( name, getString( "mcheese0d1" ) ) ;
			setQuickInfoTag( getString( "toomanymissions" ) ) ;
		else
			-- meets minimum requirements
			sayAndWait( name, getString( "mcheese0d2" ) ) ;
			sayAndWait( name, getString( "mcheese0d3" ) ) ;
			sayAndWait( name, getString( "mcheese0d4" ) ) ;
	
			local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mcheese0d5" ), getString( "mcheese0d6" ), getString( "mcheese0d7" ) ) ;
			local option = waitForBubbleOption( bubInd ) ;
			if ( option == 0 ) then
				-- accept
			elseif ( option == 1 ) then
				-- ask about pay
				sayAndWait( name, getString( "mcheese0d8" ) ) ;
			else
				-- reject
				return ;
			end
			
			sayAndWait( name, getString( "mcheese0d9" ) ) ;
			sayAndWait( name, getString( "mcheese0d10" ) ) ;
			sayAndWait( name, getString( "mcheese0d11" ) ) ;

			activateMission( "missioncheese1" ) ;
		end
	end
end

-- meungdlady
function init_meungdlady( name )
	setWoman( name, true ) ;
end

function place_meungdlady( name )
	placeCharacter( name, "meunghoused", 135, -170 ) ;
end

function dress_meungdlady( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hair_pinned", "564e3b" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "969287" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "e4d9bc" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "e4d9bc" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "e4d9bc" ) ;
end

function runAI_meungdlady( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, -1, -1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungdlady( name, chatWith )
	if ( isMissionComplete( "missioncheese2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mcheese2d6" ) ) ;
		sayAndWait( name, getString( "mcheese2d6" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "mcheese0d12" ) ) ;
		sayAndWait( name, getString( "mcheese0d12" ) ) ;
	end
end

-- meungeman
function init_meungeman( name )
end

function place_meungeman( name )
	placeCharacter( name, "france", -1896, 8136 ) ;
end

function dress_meungeman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "collar_plain", 1, 1, 1 ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1, 1, 1 ) ;
	addCharacterPiece( name, "hair_medium", "826f5c" ) ;
	addCharacterPiece( name, "beard_c", "826f5c" ) ;
	addCharacterPiece( name, "mustache_b", "826f5c" ) ;
	addCharacterPiece( name, "boot_plain_right", "9e968f" ) ;
	addCharacterPiece( name, "boot_plain_left", "9e968f" ) ;
	addCharacterPiece( name, "belt", "7c6752" ) ;
	addCharacterPiece( name, "pant_baggy_right", "b83f2f" ) ;
	addCharacterPiece( name, "pant_baggy_left", "b83f2f" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "e6422c" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "e6422c" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "e6422c" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "b7a29f" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "b7a29f" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "b7a29f" ) ;
end

function runAI_meungeman( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		local destX = -1918 ;
		local destY = 8560 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		waitForNoGoal( name ) ;
		
		destX = -1198 ;
		destY = 8563 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		waitForNoGoal( name ) ;
	
		destX = -1193 ;
		destY = 8114 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		waitForNoGoal( name ) ;
	
		destX = -1917 ;
		destY = 8116 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		waitForNoGoal( name ) ;
				
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungeman( name, chatWith )
	genericGreeting( name, chatWith, 0.3 ) ;
end

-- meungelady
function init_meungelady( name )
	setWoman( name, true ) ;
end

function place_meungelady( name )
	placeCharacter( name, "meunghousee", -314, -133 ) ;
end

function dress_meungelady( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1 ) ;
	addCharacterPiece( name, "hair_curly", "d4cd83" ) ;
	addCharacterPiece( name, "w_hat_plain", "82a26e" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "82a26e" ) ;
	addCharacterPiece( name, "w_stripe_torso", "82a26e" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", 0.42, 0.59, 0.33 ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "b1bc85" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "b1bc85" ) ;
end

function runAI_meungelady( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungelady( name, chatWith )
	genericGreeting( name, chatWith, 0.0 ) ;
end

-- clothesdealer1
function init_clothesdealer1( name )
end

function place_clothesdealer1( name )
	placeCharacter( name, "meungstore", -139, -34 ) ;
end

function dress_clothesdealer1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1 ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1, 1, 1 ) ;
	addCharacterPiece( name, "hair_long", "b36c2e" ) ;
	addCharacterPiece( name, "beard_c", "b36c2e" ) ;
	addCharacterPiece( name, "mustache_a", "b36c2e" ) ;
	addCharacterPiece( name, "boot_sock_right", "e2dad2" ) ;
	addCharacterPiece( name, "boot_sock_left", "e2dad2" ) ;
	addCharacterPiece( name, "belt", "684f38" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e2d942" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e2d942" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "414f79" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "414f79" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "414f79" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "e2d942" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d9e0c5" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d9e0c5" ) ;
end

function runAI_clothesdealer1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 1, 1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_clothesdealer1( name, chatWith )
	--chat_clothesdealer2( name, chatWith ) ;
	
	local items = { 
		"ointment", 
		"beret_1",
		"beret_2",
		"beret_4",
		"beret_5",
		"hat_simple_poor_1",
		"hat_simple_ok_1",
		"hat_simple_ok_2",
		"hat_simple_best_1",
		"boot_plain_poor_1", 
		"boot_plain_ok_1",
		"boot_sock_poor_1",
		"belt_poor_1", 
		"belt_ok_1",
		"gloves_poor_1", 
		"cuff_plain_1",
		"collar_plain_1",
		"pants_musk_poor_1",
		"pants_musk_ok_1",
		"shirt_plain_poor_1", 
		"shirt_plain_poor_2", 
		"shirt_plain_poor_3", 
		"doublet_poor_1", 
		"doublet_poor_2",
		"shirt_plain_ok_1",
		"doublet_plain_ok_1" } ;
		
	chat_vendor( name, chatWith, items ) ;
end

-- clothesdealer2
function init_clothesdealer2( name )
	setWoman( name, true ) ;
end

function place_clothesdealer2( name )
	placeCharacter( name, "parisstorec", -167, -8 ) ;
end

function dress_clothesdealer2( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1, 1 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, 1 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1, 1 ) ;
	addCharacterPiece( name, "w_hair_curly", "998970" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "93b185" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "93b185" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "93b185" ) ;
	addCharacterPiece( name, "w_bow_torso", "93b185" ) ;
	addCharacterPiece( name, "w_apron", "f0eed8" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "d8e9a8" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "d8e9a8" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "d8e9a8" ) ;
end

function runAI_clothesdealer2( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_clothesdealer2( name, chatWith )
	local items = { 
		"ointment", 
		"beret_3", 
		"beret_4", 
		"beret_5", 
		"hat_simple_ok_2",  
		"hat_simple_best_1", 
		"hat_simple_best_2",
		"hat_plain_poor_1", 
		"hat_plain_poor_2",
		"boot_plain_poor_1", 
		"boot_plain_ok_1", 
		"boot_plain_best_1", 
		"boot_sock_poor_1", 
		"boot_sock_ok_1",
		"belt_poor_1", 
		"belt_ok_1", 
		"sashbelt_poor_1",
		"gloves_poor_1", 
		"gloves_ok_1", 
		"cuff_plain_1",
		"collar_plain_1",
		"pants_musk_ok_1", 
		"pants_musk_ok_2", 
		"pants_baggy_poor_1", 
		"pants_baggy_ok_1",
		"doublet_poor_1", 
		"doublet_poor_2", 
		"shirt_fancy_poor_3",
		"doublet_plain_ok_1", 
		"doublet_plain_ok_2", 
		"doublet_best_1", 
		 } ;
		
	chat_vendor( name, chatWith, items ) ;
end

function chat_vendor( name, chatWith, items )
	chat_vendorCustom( name, chatWith, items, getString( "vendor_d1" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

function chat_vendorCustom( name, chatWith, items, intro, possiblyDidBusiness, saidNevermind )
	local bubInd = characterSay( name, true, -1, -1, true, intro ) ;
	waitForBubbleClosed( bubInd ) ;
	
	bubInd = characterSay( chatWith, false, -1, -1, true, getString( "vendor_d2" ), getString( "vendor_d3" ), getString( "vendor_d4" ), getString( "vendor_d5" ) ) ;
	
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 0 ) then
		-- buy goods	
		activateBuyScreen( items ) ;
		while ( isBuyScreenShowing( ) ) do
			coroutine.yield( ) ;
		end
		
		--local bubInd = characterSay( name, true, -1, BUBBLE_PROX_N, true, possiblyDidBusiness ) ;
		--autoDeleteBubble( bubInd ) ;
		
		local bubInd = characterSay( name, true, -1, -1, true, possiblyDidBusiness ) ;
		waitForBubbleClosed( bubInd ) ;
		
	elseif ( option == 1 ) then
		-- sell goods
		activateSellScreen( ) ;
		while ( isSellScreenShowing( ) ) do
			coroutine.yield( ) ;
		end
		
		--local bubInd = characterSay( name, true, -1, BUBBLE_PROX_N, true, possiblyDidBusiness ) ;
		--autoDeleteBubble( bubInd ) ;
		
		local bubInd = characterSay( name, true, -1, -1, true, possiblyDidBusiness ) ;
		waitForBubbleClosed( bubInd ) ;
	else
		-- leave
		--local bubInd = characterSay( name, true, -1, BUBBLE_PROX_N, true, saidNevermind ) ;
		--autoDeleteBubble( bubInd ) ;

		local bubInd = characterSay( name, true, -1, -1, true, saidNevermind ) ;
		waitForBubbleClosed( bubInd ) ;
	end	
end

-- meungfman
function init_meungfman( name )
end

function place_meungfman( name )
	placeCharacter( name, "meunghousef2", -225, -88 ) ;
end

function dress_meungfman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "collar_plain", 1, 1, 1 ) ;
	addCharacterPiece( name, "hair_short", "9b8568" ) ;
	addCharacterPiece( name, "beard_a", "9b8568" ) ;
	addCharacterPiece( name, "mustache_a", "9b8568" ) ;
	addCharacterPiece( name, "boot_plain_right", "9b8568" ) ;
	addCharacterPiece( name, "boot_plain_left", "9b8568" ) ;
	addCharacterPiece( name, "belt", "9b8568" ) ;
	addCharacterPiece( name, "hat_plain", "97786c" ) ;
	addCharacterPiece( name, "pant_baggy_right", "97786c" ) ;
	addCharacterPiece( name, "pant_baggy_left", "97786c" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "ce5d30" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "ce5d30" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "ce5d30" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "bba955" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "bba955" ) ;
end

function runAI_meungfman( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 1, -1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
	
	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungfman( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "meungfman_d1" ) ) ;
	sayAndWait( name, getString( "meungfman_d1" ) ) ;
end

-- meungflady
function init_meungflady( name )
	setWoman( name, true ) ;
end

function place_meungflady( name )
	placeCharacter( name, "france", -1481, 8520 ) ;
end

function dress_meungflady( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_collar_big", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_hair_plain", "7a603a" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6178cb" ) ;
	addCharacterPiece( name, "w_bow_torso", "6178cb" ) ;
	addCharacterPiece( name, "w_stripe_legs", "e7ebf7" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "cbbe92" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "cbbe92" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "cbbe92" ) ;
end

function runAI_meungflady( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		local destX = -1790 ;
		local destY = 8488 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		waitForNoGoal( name ) ;
		
		wait( 4 ) ;
		
		destX = -1480 ;
		destY = 8517 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		waitForNoGoal( name ) ;
	
		wait( 2 ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meungflady( name, chatWith )
	if ( isMissionComplete( "missionsinglepuppy1" ) ) then
		-- puppy that player found in Meung was her puppy
		--autoDeleteFaceChat( name, chatWith, getString( "meungflady_d2" ) ) ;
		sayAndWait( name, getString( "meungflady_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "meungflady_d1" ) ) ;
		sayAndWait( name, getString( "meungflady_d1" ) ) ;
	end
end

-- meunggman
function init_meunggman( name )
end

function place_meunggman( name )
	sitCharacter( name, "meungg2chair1" ) ;
end

function dress_meunggman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "hair_long", "ddb838" ) ;
	addCharacterPiece( name, "hat_plain", "908b49" ) ;
	addCharacterPiece( name, "beard_b", "ddb838" ) ;
	addCharacterPiece( name, "boot_sock_right", "f8f6ed" ) ;
	addCharacterPiece( name, "boot_sock_left", "f8f6ed" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "f8f6ed" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "aaa48d" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "aaa48d" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "d9cf65" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "d9cf65" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "d9cf65" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "f8f6ed" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "f8f6ed" ) ;
end

function runAI_meunggman( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meunggman( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "meunggman_d1" ) ) ;
	sayAndWait( name, getString( "meunggman_d1" ) ) ;
end

-- meunggservant1
function init_meunggservant1( name )
	setWoman( name, true ) ;
end

function place_meunggservant1( name )
	placeCharacter( name, "meunghouseg", -317, -19 ) ;
end

function dress_meunggservant1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_hair_plain", "c9af34" ) ;
	addCharacterPiece( name, "w_apron", "f5f0db" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "637f75" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "637f75" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "637f75" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "99958c" ) ;
	
end

function runAI_meunggservant1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		-- fireplace
		local destX = -283 ;
		local destY = -57 ;
		addGoalGetToPointInLevel( name, destX, destY, "meunghouseg", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		
		wait( 2 ) ;
		
		destX = -296 ;
		destY = 29 ;
		addGoalGetToPointInLevel( name, destX, destY, "meunghouseg", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
	
		wait( 4 ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meunggservant1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "meunggservant1_d1" ) ) ;
	sayAndWait( name, getString( "meunggservant1_d1" ) ) ;
end

-- meunggservant2
function init_meunggservant2( name )
	setWoman( name, true ) ;
end

function place_meunggservant2( name )
	placeCharacter( name, "meunghouseg", -321, -55 ) ;
end

function dress_meunggservant2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hat_cap", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_hair_pinned", "886e54" ) ;
	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "8b738f" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "8b738f" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "8b738f" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6d5d52" ) ;
	
end

function runAI_meunggservant2( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		-- table
		local destX = -292 ;
		local destY = 167 ;
		addGoalGetToPointInLevel( name, destX, destY, "meunghouseg", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		
		wait( 4 ) ;
		
		-- fireplace
		destX = -323 ;
		destY = -56 ;
		addGoalGetToPointInLevel( name, destX, destY, "meunghouseg", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
	
		wait( 2 ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meunggservant2( name, chatWith )
	genericGreeting( name, chatWith, 0.85 ) ;
end

-- meunggservant3
function init_meunggservant3( name )
	setWoman( name, true ) ;
end

function place_meunggservant3( name )
	placeCharacter( name, "meunghouseg", 119, -56 ) ;
end

function dress_meunggservant3( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1 ) ;
	addCharacterPiece( name, "w_hair_pinned", "7f6a4b" ) ;
	addCharacterPiece( name, "w_apron", "dad0c9" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "7f765f" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "7f765f" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "7f765f" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "d2b0b0" ) ;
end

function runAI_meunggservant3( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		local destX = 171 ;
		local destY = 166 ;
		addGoalGetToPointInLevel( name, destX, destY, "meunghouseg", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		
		wait( 4 ) ;
		
		-- fireplace
		destX = 121 ;
		destY = -54 ;
		addGoalGetToPointInLevel( name, destX, destY, "meunghouseg", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
	
		wait( 2 ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_meunggservant3( name, chatWith )
	genericGreeting( name, chatWith, 0.8 ) ;
end

-- roadhousefman
function init_roadhousefman( name )
end

function place_roadhousefman( name )
	placeCharacter( name, "roadhousef", -25, -14 ) ;
end

function dress_roadhousefman( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt" ) ;
	addCharacterPiece( name, "boot_sock_right", "e6dbc6" ) ;
	addCharacterPiece( name, "boot_sock_left", "e6dbc6" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_long", "98793c" ) ;
	addCharacterPiece( name, "mustache_b", "98793c" ) ;
	addCharacterPiece( name, "pant_baggy_right", "7c766b" ) ;
	addCharacterPiece( name, "pant_baggy_left", "7c766b" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "bea980" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "bea980" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "bea980" ) ;
	end

function runAI_roadhousefman( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_roadhousefman( name, chatWith )
	--local bubInd = characterSay( name, true, -1, BUBBLE_PROX_N, true, getString( "roadhouseflady_d1" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	sayAndWait( name, getString( "roadhouseflady_d1" ) ) ;
end

-- roadhouseflady
function init_roadhouseflady( name )
	setWoman( name, true ) ;
end

function place_roadhouseflady( name )
	placeCharacter( name, "roadhousef", 5, -14 ) ;
end

function dress_roadhouseflady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_curly", "e0d986" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "c99124" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "c99124" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "c99124" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "938363" ) ;
end

function runAI_roadhouseflady( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_roadhouseflady( name, chatWith )
	--local bubInd = characterSay( name, true, -1, BUBBLE_PROX_N, true, getString( "roadhouseflady_d1" ) ) ;
	--autoDeleteBubble( bubInd ) ;
	sayAndWait( name, getString( "roadhouseflady_d1" ) ) ;
end

-- colombierman1
function init_colombierman1( name )
end

function place_colombierman1( name )
	placeCharacter( name, "colombierrougehouse", 48, 151 ) ;
end

function dress_colombierman1( name )
clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "sashbelt", "cbc55d" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "boot_plain_right", "463724" ) ;
	addCharacterPiece( name, "boot_plain_left", "463724" );
	addCharacterPiece( name, "beard_c", "e1c923" ) ;
	addCharacterPiece( name, "hair_curly", "e1c923" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "d2432c" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "d2432c" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "d2432c" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "pant_baggy_right", "8f7a5f" ) ;
	addCharacterPiece( name, "pant_baggy_left", "8f7a5f" ) ;
end

function runAI_colombierman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_colombierman1( name, chatWith )
	local items = { 
		"ointment", 
		"beret_1", 
		"boot_plain_poor_1",
		"boot_plain_ok_1",
		"boot_plain_best_1" } ;
		
	chat_vendor( name, chatWith, items ) ;
end

-- colombierlady1
function init_colombierlady1( name )
	setWoman( name, true ) ;
end

function place_colombierlady1( name )
	placeCharacter( name, "colombierrougehouse", 120, -22 ) ;
end

function dress_colombierlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "e1decd" ) ;
	addCharacterPiece( name, "w_collar_plain", "e1decd" ) ;
	addCharacterPiece( name, "w_hair_pinned", "9f8463" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "8a807c" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "8a807c" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "8a807c" ) ;
	addCharacterPiece( name, "w_stripe_torso", "d2432c" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6b562d" ) ;
	addCharacterPiece( name, "w_hat_cap", "e1decd" ) ;

end

function runAI_colombierlady1( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_colombierlady1( name, chatWith )
	genericGreeting( name, chatWith, 0.57 ) ;
end

-- rochelleman1
function init_rochelleman1( name )
end

function place_rochelleman1A( name )
	placeCharacter( name, "france", -9374, 10708 ) ;
end

function dress_rochelleman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", "696969" ) ;
	addCharacterPiece( name, "boot_plain_right", "c3b69e" ) ;
	addCharacterPiece( name, "boot_plain_left", "c3b69e" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "89795a" ) ;
	addCharacterPiece( name, "glove_plain_right", "6c5833" ) ;
	addCharacterPiece( name, "glove_plain_left", "6c5833" ) ;
	addCharacterPiece( name, "hat_simple", "392c12" ) ;
	addCharacterPiece( name, "hair_long", "696969" ) ;
	addCharacterPiece( name, "mustache_a", "696969" ) ;
	addCharacterPiece( name, "pant_baggy_right", "392c12" ) ;
	addCharacterPiece( name, "pant_baggy_left", "392c12" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "e2d8c4" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e2d8c4" ) ;
	end

function runAI_rochelleman1( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_rochelleman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "rochelle_d1" ) ) ;
	sayAndWait( name, getString( "rochelle_d1" ) ) ;
end

-- rochelleman2
function init_rochelleman2( name )
end

function place_rochelleman2A( name )
	placeCharacter( name, "france", -10300, 12598 ) ;
end

function dress_rochelleman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "86693b" ) ;
	addCharacterPiece( name, "boot_sock_right"  ) ;
	addCharacterPiece( name, "boot_sock_left" ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, .9 ) ;	
	addCharacterPiece( name, "feather_hat_fancy" ) ;
	addCharacterPiece( name, "hat_plain", "c9a873" ) ;
	addCharacterPiece( name, "hair_medium", "86693b" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "c9a873" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "c9a873" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "678872" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "eadcc6" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "eadcc6" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "eadcc6" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "eadcc6" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "eadcc6" ) ;	
	
end

function runAI_rochelleman2( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_rochelleman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "rochelle_d2" ) ) ;
	sayAndWait( name, getString( "rochelle_d2" ) ) ;
end

-- rochellelady1
function init_rochellelady1( name )
	setWoman( name, true ) ;
end

function place_rochellelady1A( name )
	placeCharacter( name, "france", -10270, 12598 ) ;
end

function dress_rochellelady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_bow_arm_right", "d2b381" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "d2b381" ) ;
	addCharacterPiece( name, "w_hair_plain", "36210b" ) ;
	addCharacterPiece( name, "w_stripe_legs", "d2b381" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "d281a7" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "d281a7" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "d281a7" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "d281a7" ) ;
end

function runAI_rochellelady1( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_rochellelady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "rochelle_d3" ) ) ;
	sayAndWait( name, getString( "rochelle_d3" ) ) ;
end

-- rochelleman3
function init_rochelleman3( name )
end

function place_rochelleman3A( name )
	placeCharacter( name, "france", -12078, 8053 ) ;
end

function dress_rochelleman3( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "987f3a" ) ;
	addCharacterPiece( name, "belt", "58452c" ) ;
	addCharacterPiece( name, "sashbelt", "bab592" ) ;
	addCharacterPiece( name, "beret", "bd935d" ) ;
	addCharacterPiece( name, "boot_fancy_right", "58452c" ) ;
	addCharacterPiece( name, "boot_fancy_left", "58452c" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "728c56" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "728c56" ) ;
	addCharacterPiece( name, "feather_hat_small", "d9c627" ) ;
	addCharacterPiece( name, "hair_short", "987f3a" ) ;
	addCharacterPiece( name, "mustache_a", "987f3a" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "987f3a" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "987f3a" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "728c56" ) ;
	
end

function runAI_rochelleman3( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_rochelleman3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "rochelle_d2" ) ) ;
	sayAndWait( name, getString( "rochelle_d2" ) ) ;
end

-- rochellemerchant1
function init_rochellemerchant1( name )
end

function place_rochellemerchant1A( name )
	placeCharacter( name, "france", -8702, 9433 ) ;
end

function dress_rochellemerchant1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	

	addCharacterPiece( name, "sashbelt", "8e744c" ) ;
	addCharacterPiece( name, "boot_plain_right", "a88a63" ) ;
	addCharacterPiece( name, "boot_plain_left", "a88a63" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hat_plain", "a88a63" ) ;
	addCharacterPiece( name, "hair_curly", "4b3d11" ) ;
	addCharacterPiece( name, "mustache_b", "4b3d11" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "a88828" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "a88828" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "eac914" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "eac914" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "eac914" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
	end

function runAI_rochellemerchant1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	setBaseFaceDirection( name, 0, 1 ) ;

	while ( true ) do
		wait( 1 ) ;
		if ( ( not characterHasOpenBubble( "dartagnan" ) ) and ( not characterHasOpenBubble( name ) ) ) then
			wait( randomDouble( 2.0, 5.0 ) ) ;
			local cameraX, cameraY = getCameraPos( ) ;
			if ( ( not characterHasOpenBubble( "dartagnan" ) ) and ( not characterHasOpenBubble( name ) )
				and ( distanceToPoint( name, getActiveLevel( ), cameraX, cameraY ) < 200.0 ) ) then
				local shoutText = "" ;
				local randomNumber = randomInt( 0, 3 ) ;
				if ( randomNumber == 0 ) then
					shoutText = getString( "rochellemerchant1_d1" ) ;
				elseif ( randomNumber == 1 ) then
					shoutText = getString( "rochellemerchant1_d2" ) ;
				elseif ( randomNumber == 2 ) then
					shoutText = getString( "rochellemerchant1_d3" ) ;
				end
				
				--local bubInd = characterSay( name, true, -1, 150.0, true, shoutText ) ;
				--autoDeleteBubble( bubInd ) ;
				sayAndWait( name, shoutText ) ;
			end
		end
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_rochellemerchant1( name, chatWith )
	local items = { "ointment" } ;
	chat_vendorCustom( name, chatWith, items, getString( "rochellemerchant1_d4" ), getString( "rochellemerchant1_d5" ), getString( "rochellemerchant1_d6" ) ) ;
end

-- roadhousecman1
function init_roadhousecman1( name )
end

function place_roadhousecman1( name )
	placeCharacter( name, "roadhousec", -98, -52 ) ;
end

function dress_roadhousecman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "8d8167" ) ;
	addCharacterPiece( name, "belt", "c9a65b" ) ;
	addCharacterPiece( name, "boot_sock_right", "eadcbf"  ) ;
	addCharacterPiece( name, "boot_sock_left", "eadcbf" ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "372621" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "372621" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "372621" ) ;
	addCharacterPiece( name, "hat_simple", "0b0705" ) ;
	addCharacterPiece( name, "hair_medium", "8d8167" ) ;
	addCharacterPiece( name, "mustache_a", "8d8167" ) ;
	addCharacterPiece( name, "pant_baggy_right", "0b0705") ;
	addCharacterPiece( name, "pant_baggy_left", "0b0705" ) ;	
	addCharacterPiece( name, "stripe_plain_leg_right", "c9a65b" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "c9a65b" ) ;

end

function runAI_roadhousecman1( name )
	setBaseFaceDirection( name, -1, -1 ) ;
end

function chat_roadhousecman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "roadhousecman1_d1" ) ) ;
	sayAndWait( name, getString( "roadhousecman1_d1" ) ) ;
end

-- roadhouseeman1
function init_roadhouseeman1( name )
end

function place_roadhouseeman1( name )
	placeCharacter( name, "france", 101, 5058 ) ;
end

function dress_roadhouseeman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", "a07d41" ) ;
	addCharacterPiece( name, "belt" ) ;
	addCharacterPiece( name, "boot_plain_right", "a0a0a0"  ) ;
	addCharacterPiece( name, "boot_plain_left", "a0a0a0" ) ;
	addCharacterPiece( name, "feather_hat_small", "c5763b" ) ;
	addCharacterPiece( name, "hat_simple", "826a41" ) ;
	addCharacterPiece( name, "hair_medium", "a07d41" ) ;
	addCharacterPiece( name, "mustache_a", "a07d41" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "516e38" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "516e38" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "c9c792" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "c9c792" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "c9c792" ) ;	
end

function runAI_roadhouseeman1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		goalWalkToPoint( name, "france", 28, 5112 ) ;
		wait( 1 ) ;
		goalWalkToPoint( name, "france", 316, 5112 ) ;
		goalWalkToPoint( name, "france", 316, 5140 ) ;
		wait( 1 ) ;
		goalWalkToPoint( name, "france", 28, 5140 ) ;
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_roadhouseeman1( name, chatWith )
	genericGreeting( name, chatWith, 0.62 ) ;
end

-- roadhouseelady1
function init_roadhouseelady1( name )
	setWoman( name, true ) ;
end

function place_roadhouseelady1( name )
	placeCharacter( name, "france", 153, 5172 ) ;
end

function dress_roadhouseelady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "e0d2bb" ) ;
	addCharacterPiece( name, "w_hair_pinned", "f0e39e" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "7485b6" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "7485b6" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "7485b6" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "79623e" ) ;
	addCharacterPiece( name, "w_hat_plain", "a07d41" ) ;
end


function runAI_roadhouseelady1( name )
	setBaseFaceCharacter( name, "roadhouseeman1" ) ;
end

function chat_roadhouseelady1( name, chatWith )
	genericGreeting( name, chatWith, 0.4 ) ;
end

-- roadhousedman1
function init_roadhousedman1( name )
end

function place_roadhousedman1( name )
	placeCharacter( name, "france", -1208, 4869 ) ;
end

function dress_roadhousedman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a", "c9a65b" ) ;
	addCharacterPiece( name, "beret", "a16953" ) ;
	addCharacterPiece( name, "boot_fancy_right", "8b827f"  ) ;
	addCharacterPiece( name, "boot_fancy_left", "8b827f" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "af9cc0" ) ;
	addCharacterPiece( name, "feather_hat_small", "d8c91f" ) ;	
	addCharacterPiece( name, "hair_curly", "c9a65b" ) ;
	addCharacterPiece( name, "mustache_b", "c9a65b" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "836b4b" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "836b4b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "af9cc0" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "af9cc0" ) ;
	
	end

function runAI_roadhousedman1( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_roadhousedman1( name, chatWith )
	genericGreeting( name, chatWith, 0.7 ) ;
end

-- roadhousedman2
function init_roadhousedman2( name )
end

function place_roadhousedman2( name )
	placeCharacter( name, "france", -1173, 4869 ) ;
end

function dress_roadhousedman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "292018" ) ;
	addCharacterPiece( name, "belt", "776049" ) ;
	addCharacterPiece( name, "boot_plain_right", "9d8f81"  ) ;
	addCharacterPiece( name, "boot_plain_left", "9d8f81" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left", "c2b195" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", "c2b195" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "c2b195" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "c2b195" ) ;
	addCharacterPiece( name, "hair_short", "292018" ) ;
	addCharacterPiece( name, "pant_baggy_right", "b6c075" ) ;
	addCharacterPiece( name, "pant_baggy_left", "b6c075" ) ;	
	addCharacterPiece( name, "shirt_plain_torso", "c2b195" ) ;
	
	end

function runAI_roadhousedman2( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_roadhousedman2( name, chatWith )
	genericGreeting( name, chatWith, 0.9 ) ;
end

-- stcloudpriest
function init_stcloudpriest( name )
end

function place_stcloudpriest( name )
	placeCharacter( name, "france", -4553, 3024 ) ;
end

function dress_stcloudpriest( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "cloak_holy", "65512f" ) ;
	addCharacterPiece( name, "hair_short", "dfc379") ;
	addCharacterPiece( name, "pant_monk_legs", "65512f" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "65512f" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "65512f" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "65512f" ) ;
	end

function runAI_stcloudpriest( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_stcloudpriest( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "stcloudpriest_d1" ) ) ;
	sayAndWait( name, getString( "stcloudpriest_d1" ) ) ;
end

-- stgermaindlady1
function init_stgermaindlady1( name )
	setWoman( name, true ) ;
end

function place_stgermaindlady1( name )
	placeCharacter( name, "stgermainhoused", 141, 108 ) ;
end

function dress_stgermaindlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	
	addCharacterPiece( name, "w_collar_big", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_bow_torso", "7ea557" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "7ea557" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "7ea557" ) ;
	addCharacterPiece( name, "w_hair_curly", "6e6037" ) ;
	addCharacterPiece( name, "w_stripe_torso", "e2c773" ) ;
	addCharacterPiece( name, "w_stripe_legs", "7ea557" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "e2c773" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "e2c773" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "a8cbdd" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "a8cbdd" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "a8cbdd" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e2c773" ) ;
end

function runAI_stgermaindlady1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		goalWalkToPoint( name, "stgermainhoused", -40, 69 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
		goalWalkToPoint( name, "stgermainhoused", 318, 69 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "stgermainhoused", 239, 266 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_stgermaindlady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "stgermaindlady1_d1" ) ) ;
	sayAndWait( name, getString( "stgermaindlady1_d1" ) ) ;
end

-- stgermainblady1
function init_stgermainblady1( name )
	setWoman( name, true ) ;
end

function place_stgermainblady1( name )
	placeCharacter( name, "stgermainhouseb", 252, 88 ) ;
end

function dress_stgermainblady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_apron", "f2ecdb" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_plain", "acacac" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "81a5d6" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "81a5d6" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "81a5d6" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a4a194" ) ;
end

function runAI_stgermainblady1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		goalWalkToPoint( name, "stgermainhouseb", 258, 69 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "stgermainhouseb", 256, 112 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_stgermainblady1( name, chatWith )
	genericGreeting( name, chatWith, 0.63 ) ;
end

-- stgermainblady2
function init_stgermainblady2( name )
	setWoman( name, true ) ;
end

function place_stgermainblady2( name )
	placeCharacter( name, "stgermainhouseb2", 82, 69 ) ;
end

function dress_stgermainblady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_short", "999a95" ) ;
	addCharacterPiece( name, "w_stripe_torso", "e6f0c6" ) ;
	addCharacterPiece( name, "w_stripe_legs", "e6f0c6" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "e33056" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "e33056" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "e33056" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e33056" ) ;
end

function runAI_stgermainblady2( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_stgermainblady2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "stgermainblady2_d1" ) ) ;
	sayAndWait( name, getString( "stgermainblady2_d1" ) ) ;
end

-- stgermainbman1
function init_stgermainbman1( name )
end

function place_stgermainbman1( name )
	placeCharacter( name, "stgermainhouseb", -12, 34 ) ;
end

function dress_stgermainbman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "332a1d" ) ;	
	addCharacterPiece( name, "belt", "d2c857" ) ;
	addCharacterPiece( name, "boot_fancy_right", "a0a0a0" ) ;
	addCharacterPiece( name, "boot_fancy_left", "a0a0a0" ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "e9e73a" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "e9e73a" ) ;
	addCharacterPiece( name, "hair_short", "332a1d" ) ;
	addCharacterPiece( name, "mustache_b", "332a1d" ) ;
	addCharacterPiece( name, "pant_baggy_right", "8ec678" ) ;
	addCharacterPiece( name, "pant_baggy_left", "8ec678" ) ;	
	addCharacterPiece( name, "shirt_fancy_torso", "e9e73a" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "8ec678" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "8ec678" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "8ec678" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e9e73a" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e9e73a" ) ;
end

function runAI_stgermainbman1( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_stgermainbman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "stgermainbman1_d1" ) ) ;
	sayAndWait( name, getString( "stgermainbman1_d1" ) ) ;
end

-- stgermainman1
function init_stgermainman1( name )
end

function place_stgermainman1( name )
	placeCharacter( name, "france", -6457, 209 ) ;
end

function dress_stgermainman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "e1cf86" ) ;
	addCharacterPiece( name, "sashbelt", "e6d67c" ) ;
	addCharacterPiece( name, "boot_sock_right", "efdbf5" ) ;
	addCharacterPiece( name, "boot_sock_left", "efdbf5" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "ede7a5" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "ede7a5" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "ede7a5" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "efdbf5" ) ;
	addCharacterPiece( name, "hat_plain", "776244" ) ;
	addCharacterPiece( name, "hair_medium", "e1cf86" ) ;
	addCharacterPiece( name, "mustache_a", "e1cf86" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "bd82c2" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "bd82c2" ) ;
end


function runAI_stgermainman1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		goalWalkToPoint( name, "france", -6500, 169 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		goalWalkToPoint( name, "france", -6395, 166 ) ;
		wait( randomDouble( 4.0, 15.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_stgermainman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "stgermainman1_d1" ) ) ;
	sayAndWait( name, getString( "stgermainman1_d1" ) ) ;
end

-- stgermainman2
function init_stgermainman2( name )
end

function place_stgermainman2( name )
	placeCharacter( name, "france", -7606, 873 ) ;
end

function dress_stgermainman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "b88f4f" ) ;
	addCharacterPiece( name, "belt", "5d4f38" ) ;
	addCharacterPiece( name, "boot_plain_right", "937d6e" ) ;
	addCharacterPiece( name, "boot_plain_left", "937d6e" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "feather_hat_small", "d03636" ) ;
	addCharacterPiece( name, "glove_plain_right", "856f59" ) ;
	addCharacterPiece( name, "glove_plain_left", "856f59" ) ;
	addCharacterPiece( name, "hat_simple", "856f59" ) ;
	addCharacterPiece( name, "hair_long", "b88f4f" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "b2b7d0" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "b2b7d0" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "354cc0" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "354cc0" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "354cc0" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "b2b7d0" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "b2b7d0" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "b2b7d0" ) ;
end

function runAI_stgermainman2( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		goalWalkToPoint( name, "france", -7599, 659 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		goalWalkToPoint( name, "france", -7666, 824 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		goalWalkToPoint( name, "france", -7474, 930 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_stgermainman2( name, chatWith )
	genericGreeting( name, chatWith, 0.99 ) ;
end

-- stgermainman3
function init_stgermainman3( name )
end

function place_stgermainman3( name )
	placeCharacter( name, "france", -6704, 882 ) ;
end

function dress_stgermainman3( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "belt", "988960" ) ;
	addCharacterPiece( name, "sashbelt", "988960" ) ;
	addCharacterPiece( name, "boot_sock_right", "ede6d4" ) ;
	addCharacterPiece( name, "boot_sock_left", "ede6d4" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "6dc28b" ) ;
	addCharacterPiece( name, "hair_curly", "857e70" ) ;
	addCharacterPiece( name, "mustache_b", "857e70" ) ;
	addCharacterPiece( name, "pant_baggy_right", "7b6a30" ) ;
	addCharacterPiece( name, "pant_baggy_left", "7b6a30" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "eeda94" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "eeda94" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "6dc28b" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "6dc28b" ) ;
	end

function runAI_stgermainman3( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_stgermainman3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "stgermainman3_d1" ) ) ;
	sayAndWait( name, getString( "stgermainman3_d1" ) ) ;
end

-- stgermainlady1
function init_stgermainlady1( name )
	setWoman( name, true ) ;
end

function place_stgermainlady1( name )
	placeCharacter( name, "france", -7527, 96 ) ;
end

function dress_stgermainlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_big", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_collar_fancy", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1,.9 ) ;
	addCharacterPiece( name, "w_bow_torso", "a6cdef" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "a6cdef" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "a6cdef" ) ;
	addCharacterPiece( name, "w_hair_short", "84694c" ) ;
	addCharacterPiece( name, "w_stripe_torso", "f1d3dd" ) ;
	addCharacterPiece( name, "w_stripe_legs", "f1d3dd" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "f3f9ff" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "f3f9ff" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "ba5274" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "ba5274" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "ba5274" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "ba5274" ) ;
end

function runAI_stgermainlady1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		goalWalkToPoint( name, "france", -7554, -25 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		goalWalkToPoint( name, "france", -7445, 102 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		goalWalkToPoint( name, "france", -7540, 276 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		goalWalkToPoint( name, "france", -7643, 118 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_stgermainlady1( name, chatWith )
	genericGreeting( name, chatWith, 0.74 ) ;
end

-- stgermainlady2
function init_stgermainlady2( name )
	setWoman( name, true ) ;
end

function place_stgermainlady2( name )
	placeCharacter( name, "france", -6045, 549 ) ;
end

function dress_stgermainlady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_hair_curly", "b2822f" ) ;
	addCharacterPiece( name, "w_stripe_torso", "ba97db" ) ;
	addCharacterPiece( name, "w_stripe_legs", "ba97db" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "ba97db" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "ba97db" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "6e399f" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "6e399f" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "6e399f" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6e399f" ) ;
end

function runAI_stgermainlady2( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "france", -6106, 553 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		goalWalkToPoint( name, "france", -6025, 605 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		goalWalkToPoint( name, "france", -6102, 648 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		goalWalkToPoint( name, "france", -6192, 603 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_stgermainlady2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "likefountains" ) ) ;
	sayAndWait( name, getString( "likefountains" ) ) ;
end

-- stgermainlady3
function init_stgermainlady3( name )
	setWoman( name, true ) ;
end

function place_stgermainlady3( name )
	placeCharacter( name, "france", -6811, -10 ) ;
end

function dress_stgermainlady3( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "f3e692" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "f3e692" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "f3e692" ) ;
	addCharacterPiece( name, "w_hair_plain", "e0d270" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "9c9985" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "9c9985" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "9c9985" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e0d270" ) ;
end

function runAI_stgermainlady3( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		goalWalkToPoint( name, "france", -7115, -40 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		goalWalkToPoint( name, "france", -6510, -28 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_stgermainlady3( name, chatWith )
	if ( isMissionComplete( "missionfencers3" ) ) then
		sayAndWait( name, getString( "stgermainlady3_d2" ) ) ;
	else
		sayAndWait( name, getString( "stgermainlady3_d1" ) ) ;
	end
end

-- jeweller1
function init_jeweller1( name )
end

function place_jeweller1( name )
	placeCharacter( name, "france", 1914, -161 ) ;
end

function dress_jeweller1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "feather_hat_small", "d94d4d" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "739059" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "739059" ) ;
	addCharacterPiece( name, "beret", "596a90" ) ;
	addCharacterPiece( name, "boot_fancy_right", "c9bc72" ) ;
	addCharacterPiece( name, "boot_fancy_left", "c9bc72" ) ;
	addCharacterPiece( name, "belt", "856533" ) ;
	addCharacterPiece( name, "hair_curly", "856533" ) ;
	addCharacterPiece( name, "beard_c", "856533" ) ;
	addCharacterPiece( name, "mustache_b", "856533" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1, 1, 1, 0.9) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "50669c" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "919399" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "919399" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "919399" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "919399" ) ;
end

function runAI_jeweller1( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_jeweller1( name, chatWith )
	local items = {
		"ointment",
		"diamond1",
		"diamond2",
		"diamond3",
		"diamond4",
		"diamond5",
		"ruby1",
		"ruby2",
		"ruby3",
		"ruby4",
		"ruby5",
		"emerald1",
		"emerald2",
		"emerald3",
		"emerald4",
		"emerald5",
		"sapphire1",
		"sapphire2",
		"sapphire3",
		"sapphire4",
		"sapphire5",
		"goldring",
		"diamondring1",
		"diamondring2",
		"diamondring3",
		"diamondring4",
		"diamondring5",
		"rubyring1",
		"rubyring2",
		"rubyring3",
		"rubyring4",
		"rubyring5",
		"emeraldring1",
		"emeraldring2",
		"emeraldring3",
		"emeraldring4",
		"emeraldring5",
		"sapphirering1",
		"sapphirering2",
		"sapphirering3",
		"sapphirering4",
		"sapphirering5" } ;
		
	chat_vendor( name, chatWith, items ) ;
end

-- rochefort
function init_rochefort( name )
	setAllowPermanentDeath( name, false ) ;
	--setHasLootDrop( name, false ) ;
	
	setStatsCalculatorDynamic( name, 2, 2, 1, 100, 0.5 ) ;
end

function getRochefortBLevel( )
	return "cardinalhouse" ;
end

function getRochefortBPosX( )
	return -103 ;
end

function getRochefortBPosY( )
	return -963 ;
end

function place_rochefortA( name )
	placeDead( name ) ;
end

function place_rochefortB( name )
	placeCharacter( name, getRochefortBLevel( ), getRochefortBPosX( ), getRochefortBPosY( ) ) ;
end

function dress_rochefort( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "feather_hat_plain", 0.56, 0.42, 0.51 ) ;
	addCharacterPiece( name, "pant_musketeer_right", 0.56, 0.42, 0.51 ) ;
	addCharacterPiece( name, "pant_musketeer_left", 0.56, 0.42, 0.51 ) ;
	addCharacterPiece( name, "hat_plain", 0.31, 0.32, 0.12 ) ;
	addCharacterPiece( name, "boot_fancy_right", 0.31, 0.32, 0.12 ) ;
	addCharacterPiece( name, "boot_fancy_left", 0.31, 0.32, 0.12 ) ;
	addCharacterPiece( name, "belt", 0.31, 0.32, 0.12 ) ;
	addCharacterPiece( name, "hair_long", 0, 0, 0 ) ;
	addCharacterPiece( name, "beard_a", 0, 0, 0 ) ;
	addCharacterPiece( name, "mustache_b", 0, 0, 0 ) ;
	addCharacterPiece( name, "sashbelt", 0.54, 0.44, 0.31 ) ;
	addCharacterPiece( name, "glove_plain_right", 0.54, 0.44, 0.31 ) ;
	addCharacterPiece( name, "glove_plain_left", 0.54, 0.44, 0.31 ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "doublet_plain_torso", 0.51, 0.42, 0.56 ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", 0.51, 0.42, 0.56 ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", 0.51, 0.42, 0.56 ) ;
	
	setMeleeWeapon( name, "sword_1" ) ;
end

function runAI_rochefort( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	if ( isMissionComplete( "missionrochelle19" ) ) then
		setBaseFaceDirection( name, 1, -1 ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_rochefort( name, chatWith )
	if ( isMissionComplete( "missionrochelle19" ) ) then
		-- game is over
		if ( isMissionComplete( "missionrochefort1" ) ) then
			-- already dualed rochefort
			--autoDeleteFaceChat( name, chatWith, getString( "mrochefort1d2" ) ) ;
			sayAndWait( name, getString( "mrochefort1d2" ) ) ;
		elseif ( not isMissionActive( "missionrochefort1" ) ) then
			-- haven't dualed rochefort yet
			sayAndWait( name, getString( "mrochefort0d1" ) ) ;
			
			if ( getTooManyActiveMissions( ) ) then
				setQuickInfoTag( getString( "toomanymissions" ) ) ;
			else
				sayAndWait( name, getString( "mrochefort0d2" ) ) ;
				
				local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mrochefort0d3" ), getString( "mrochefort0d4" ) ) ;
				local option = waitForBubbleOption( bubInd ) ;
				if ( option == 0 ) then
					-- dual now
					activateMission( "missionrochefort1" ) ;
				else
					-- reject
					return ;
				end
			end	
		end
	end
end

-- rochefortservant1
function dress_rochefortservant1( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "hair_long", "af9179" ) ;
	addCharacterPiece( name, "beard_a", "af9179" ) ;
	addCharacterPiece( name, "belt", "857466" ) ;
	addCharacterPiece( name, "boot_plain_right", "857466") ;
	addCharacterPiece( name, "boot_plain_left", "857466") ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "glove_plain_right", "8e7763" ) ;
	addCharacterPiece( name, "glove_plain_left", "8e7763" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "aa7f86" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "aa7f86" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "aa7f86" ) ;
	addCharacterPiece( name, "feather_hat_small", "ae5bb6" ) ;
	addCharacterPiece( name, "hat_simple", "a89568" ) ;
	addCharacterPiece( name, "pant_baggy_right", "717171" ) ;
	addCharacterPiece( name, "pant_baggy_left", "717171" ) ;

end

-- rochefortservant2
function dress_rochefortservant2( name )

	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "hair_short", "ac996b" ) ;
	addCharacterPiece( name, "beard_a", "ac996b" ) ;
	addCharacterPiece( name, "mustache_a", "ac996b" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "boot_sock_right", "e5e0d3") ;
	addCharacterPiece( name, "boot_sock_left", "e5e0d3") ;
	addCharacterPiece( name, "pant_musketeer_right", "6f557f" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "6f557f" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "97826f" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "97826f" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "97806c" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "dfbfb9" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "dfbfb9" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "dfbfb9" ) ;

end


-- musketeer1
function init_musketeer1( name )
end

function getMusketeer1Level( )
	return "trevillehouse" ;
end

function getMusketeer1PosX( )
	return -14 ;
end

function getMusketeer1PosY( )
	return 165 ;
end

function place_musketeer1( name )
	placeCharacter( name, getMusketeer1Level( ), getMusketeer1PosX( ), getMusketeer1PosY( ) ) ;
end

function dress_musketeer1( name )
	randomDressMusketeer( name, 0.0, 5239 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer1( name )
	while ( true ) do
		if ( isMissionActive( "missionparis7" ) ) then
			setBaseFaceCharacter( name, "aramis" ) ;
			wait( 1 ) ;
		else
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
		coroutine.yield( ) ;
	end
end

function chat_musketeer1( name, chatWith )
	local comment = "" ;
	
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d7" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d1" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer2
function init_musketeer2( name )
end

function getMusketeer2Level( )
	return "trevillehouse" ;
end

function getMusketeer2PosX( )
	return 45 ;
end

function getMusketeer2PosY( )
	return 165 ;
end

function place_musketeer2( name )
	placeCharacter( name, getMusketeer2Level( ), getMusketeer2PosX( ), getMusketeer2PosY( ) ) ;
end

function dress_musketeer2( name )
	randomDressMusketeer( name, 0.0, 4125 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer2( name )
	while ( true ) do
		if ( isMissionActive( "missionparis7" ) ) then
			setBaseFaceCharacter( name, "aramis" ) ;
			wait( 1 ) ;
		else
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
		coroutine.yield( ) ;
	end
end

function chat_musketeer2( name, chatWith )
	local comment = "" ;

	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "hellodartagnan" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d2" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer3
function init_musketeer3( name )
end

function place_musketeer3( name )
	placeCharacter( name, "trevillehouse", 344, -195 ) ;
end

function dress_musketeer3( name )
	randomDressMusketeer( name, 0.0, 14982 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer3( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer3( name, chatWith )
	local comment = "" ;

	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d11" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d5" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer4
function init_musketeer4( name )
end

function place_musketeer4( name )
	placeCharacter( name, "trevillehouse", 402, -200 ) ;
end

function dress_musketeer4( name )
	randomDressMusketeer( name, 0.0, 5231 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer4( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer4( name, chatWith )
	local comment = "" ;

	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d11" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d5" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer5
function init_musketeer5( name )
end

function place_musketeer5( name )
	placeCharacter( name, "trevillehouse", 373, -172 ) ;
end

function dress_musketeer5( name )
	randomDressMusketeer( name, 0.0, 2567 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer5( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer5( name, chatWith )
	local comment = "" ;

	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d12" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d6" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer6
function init_musketeer6( name )
end

function place_musketeer6( name )
	placeCharacter( name, "trevillehouse", -515, -201 ) ;
end

function dress_musketeer6( name )
	randomDressMusketeer( name, 0.0, 36442 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer6( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, -1 ) ;
		wait( 1 ) ;

		coroutine.yield( ) ;
	end
end

function chat_musketeer6( name, chatWith )
	local comment = "" ;

	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "hellodartagnan" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d2" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer7
function init_musketeer7( name )
end

function place_musketeer7( name )
	placeCharacter( name, "trevillehouse", -451, -115 ) ;
end

function dress_musketeer7( name )
	randomDressMusketeer( name, 0.0, 16743 ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer7( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer7( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d4" ) ) ;
	sayAndWait( name, getString( "musketeer_d4" ) ) ;	
end

-- musketeer8
function init_musketeer8( name )
end

function place_musketeer8( name )
	placeCharacter( name, "trevillehouse", -394, -40 ) ;
end

function dress_musketeer8( name )
	randomDressMusketeer( name, 0.0, 31237 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_musketeer8( name )
	while ( true ) do
		local destX = -404 ;
		local destY = -33 ;
		addGoalGetToPointInLevel( name, destX, destY, "trevillehouse", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		
		wait( 1 ) ;
				
		destX = -448 ;
		destY = -1 ;
		addGoalGetToPointInLevel( name, destX, destY, "trevillehouse", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		
		wait( 1 ) ;
	end
end

function chat_musketeer8( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d3" ) ) ;
	sayAndWait( name, getString( "musketeer_d3" ) ) ;	
end

-- musketeer9
function init_musketeer9( name )
end

function place_musketeer9( name )
	--placeCharacter( name, "trevillehouse", 0, 0 ) ;
	sitCharacter( name, "trevillehousechair1" ) ;
end

function dress_musketeer9( name )
	randomDressMusketeer( name, 0.0, 3513 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer9( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, -1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer9( name, chatWith )
	chatPlayCards( name, chatWith ) ;
	--chat_guy4( name, chatWith ) ;
end

-- musketeer10
function init_musketeer10( name )
end

function place_musketeer10( name )
	placeCharacter( name, "trevillehouse", 125, -51 ) ;
end

function dress_musketeer10( name )
	randomDressMusketeer( name, 0.0, 11567 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_musketeer10( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer10( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "hellodartagnan" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d2" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer11
function init_musketeer11( name )
end

function place_musketeer11( name )
	placeCharacter( name, "trevillehouse", 155, -27 ) ;
end

function dress_musketeer11( name )
	randomDressMusketeer( name, 0.0, 14446 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_musketeer11( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, -1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer11( name, chatWith )
	local comment = "" ;

	if ( dartIsMusketeer( ) ) then
		comment = getString( "musketeer_d15" ) ;
	elseif ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d14" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d13" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer12
function init_musketeer12( name )
end

function place_musketeer12( name )
	--placeCharacter( name, "trevillehouse", 155, -27 ) ;
	sitCharacter( name, "trevillehousechair2" ) ;
end

function dress_musketeer12( name )
	randomDressMusketeer( name, 0.0, 113216 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer12( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, -1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer12( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d4" ) ) ;
	sayAndWait( name, getString( "musketeer_d4" ) ) ;	
end

-- musketeer13
function init_musketeer13( name )
end

function place_musketeer13( name )
	--placeCharacter( name, "trevillehouse", 155, -27 ) ;
	sitCharacter( name, "trevillehousechair3" ) ;
end

function dress_musketeer13( name )
	randomDressMusketeer( name, 0.0, 112336 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_musketeer13( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, -1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer13( name, chatWith )
	chatPlayDice( name, chatWith ) ;
	--chat_guy5( name, chatWith ) ;
end

-- musketeer14
function init_musketeer14( name )
end

function place_musketeer14( name )
	placeCharacter( name, "trevillehouse", -250, -100 ) ;
end

function dress_musketeer14( name )
	randomDressMusketeer( name, 0.0, 119836 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer14( name )
	while ( true ) do
		setBaseFaceCharacter( name, "musketeer15" ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer14( name, chatWith )
	local comment = "" ;

	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d12" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d6" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer15
function init_musketeer15( name )
end

function place_musketeer15( name )
	placeCharacter( name, "trevillehouse", -300, -100 ) ;
end

function dress_musketeer15( name )
	randomDressMusketeer( name, 0.0, 122436 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer15( name )
	while ( true ) do
		local destX = -300 ;
		local destY = -150 ;
		addGoalGetToPointInLevel( name, destX, destY, "trevillehouse", false ) ;
		waitForNoGoal( name ) ;
		
		destX = -200 ;
		destY = -150 ;
		addGoalGetToPointInLevel( name, destX, destY, "trevillehouse", false ) ;
		waitForNoGoal( name ) ;

		destX = -200 ;
		destY = -50 ;
		addGoalGetToPointInLevel( name, destX, destY, "trevillehouse", false ) ;
		waitForNoGoal( name ) ;

		destX = -300 ;
		destY = -50 ;
		addGoalGetToPointInLevel( name, destX, destY, "trevillehouse", false ) ;
		waitForNoGoal( name ) ;
	
		coroutine.yield( ) ;
	end
end

function chat_musketeer15( name, chatWith )
	local comment = "" ;

	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d12" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d6" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer16
function init_musketeer16( name )
end

function place_musketeer16( name )
	placeCharacter( name, "trevillehouse", -91, 49 ) ;
end

function dress_musketeer16( name )
	randomDressMusketeer( name, 0.0, 113336 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer16( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer16( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d7" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d9" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer17
function init_musketeer17( name )
end

function place_musketeer17( name )
	placeCharacter( name, "trevillehouse", -150, 49 ) ;
end

function dress_musketeer17( name )
	randomDressMusketeer( name, 0.0, 115411 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer17( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer17( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "hellodartagnan" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d2" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer18
function init_musketeer18( name )
end

function place_musketeer18( name )
	placeCharacter( name, "trevillehouse", 319, -112 ) ;
end

function dress_musketeer18( name )
	randomDressMusketeer( name, 0.0, 115001 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer18( name )
	while ( true ) do
		local destX = 319 ;
		local destY = -104 ;
		addGoalGetToPointInLevel( name, destX, destY, "trevillehouse", false ) ;
		waitForNoGoal( name ) ;
		
		wait( randomDouble( 4.0, 8.0 ) ) ;
		
		destX = 319 ;
		destY = -150 ;
		addGoalGetToPointInLevel( name, destX, destY, "trevillehouse", false ) ;
		waitForNoGoal( name ) ;

		coroutine.yield( ) ;
	end
end

function chat_musketeer18( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d3" ) ) ;
	sayAndWait( name, getString( "musketeer_d3" ) ) ;	
end

-- musketeer19
function init_musketeer19( name )
end

function place_musketeer19( name )
	placeCharacter( name, "trevillehouse2", -311, -137 ) ;
end

function dress_musketeer19( name )
	randomDressMusketeer( name, 0.0, 35411 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer19( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer19( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d7" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d1" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;	
end

-- musketeer20
function init_musketeer20( name )
end

function place_musketeer20( name )
	placeCharacter( name, "trevillehouse2", -256, -137 ) ;
end

function dress_musketeer20( name )
	randomDressMusketeer( name, 0.0, 354411 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_musketeer20( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer20( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d8" ) ) ;
	sayAndWait( name, getString( "musketeer_d8" ) ) ;		
end

-- musketeer21
function init_musketeer21( name )
end

function place_musketeer21( name )
	placeCharacter( name, "trevillehouse2", 209, -68 ) ;
end

function dress_musketeer21( name )
	randomDressMusketeer( name, 0.0, 354321 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer21( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer21( name, chatWith )
	local comment = "" ;

	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d11" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d5" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- musketeer22
function init_musketeer22( name )
end

function place_musketeer22( name )
	placeCharacter( name, "trevillehouse2", 267, -69 ) ;
end

function dress_musketeer22( name )
	randomDressMusketeer( name, 0.0, 98411 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer22( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer22( name, chatWith )
	local comment = "" ;

	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d12" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d6" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- musketeer23
function init_musketeer23( name )
end

function place_musketeer23( name )
	placeCharacter( name, "trevillehouse2", 242, -33 ) ;
end

function dress_musketeer23( name )
	randomDressMusketeer( name, 0.0, 75411 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer23( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer23( name, chatWith )
	local comment = "" ;

	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d11" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d5" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- musketeer24
function init_musketeer24( name )
end

function place_musketeer24( name )
	placeCharacter( name, "trevillehouse2", -470, 6 ) ;
end

function dress_musketeer24( name )
	randomDressMusketeer( name, 0.0, 75771 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_musketeer24( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer24( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "hellodartagnan" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d2" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- musketeer25
function init_musketeer25( name )
end

function place_musketeer25( name )
	placeCharacter( name, "trevillehouse2", -436, 34 ) ;
end

function dress_musketeer25( name )
	randomDressMusketeer( name, 0.0, 74456 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer25( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, -1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_musketeer25( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d7" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d9" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- musketeer26
function init_musketeer26( name )
end

function place_musketeer26( name )
	placeCharacter( name, "trevillehouse2", -124, 156 ) ;
end

function dress_musketeer26( name )
	randomDressMusketeer( name, 0.0, 12456 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeer26( name )
	while ( true ) do
		setBaseFaceCharacter( name, "musketeer27" ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer26( name, chatWith )
	local comment = "" ;

	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d11" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d5" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- musketeer27
function init_musketeer27( name )
end

function place_musketeer27( name )
	placeCharacter( name, "trevillehouse2", -92, 179 ) ;
end

function dress_musketeer27( name )
	randomDressMusketeer( name, 0.0, 31156 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_musketeer27( name )
	while ( true ) do
		setBaseFaceCharacter( name, "musketeer26" ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer27( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d16" ) ) ;
	sayAndWait( name, getString( "musketeer_d16" ) ) ;
end

-- musketeer28
function init_musketeer28( name )
end

function place_musketeer28( name )
	placeCharacter( name, "trevillehouse2", -108, -210 ) ;
end

function dress_musketeer28( name )
	randomDressMusketeer( name, 0.0, 383216 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_musketeer28( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer28( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d17" ) ) ;
	sayAndWait( name, getString( "musketeer_d17" ) ) ;
end

-- musketeer29
function init_musketeer29( name )
end

function place_musketeer29( name )
	placeCharacter( name, "trevillehouse2", -10, -210 ) ;
end

function dress_musketeer29( name )
	randomDressMusketeer( name, 0.0, 387756 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_musketeer29( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer29( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d17" ) ) ;
	sayAndWait( name, getString( "musketeer_d17" ) ) ;
end

-- musketeer30
function init_musketeer30( name )
end

function getMusketeer30Level( )
	return "louvrehouse2" ;
end

function getMusketeer30PosX( )
	return -367 ;
end

function getMusketeer30PosY( )
	return -50 ;
end

function place_musketeer30( name )
	placeCharacter( name, getMusketeer30Level( ), getMusketeer30PosX( ), getMusketeer30PosY( ) ) ;
end

function dress_musketeer30( name )
	randomDressMusketeer( name, 0.0, 341756 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_musketeer30( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer30( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d8" ) ) ;
	sayAndWait( name, getString( "musketeer_d8" ) ) ;
end

-- musketeer31
function init_musketeer31( name )
end

function getMusketeer31Level( )
	return "louvrehouse2" ;
end

function getMusketeer31PosX( )
	return -234 ;
end

function getMusketeer31PosY( )
	return -50 ;
end

function place_musketeer31( name )
	placeCharacter( name, getMusketeer31Level( ), getMusketeer31PosX( ), getMusketeer31PosY( ) ) ;
end

function dress_musketeer31( name )
	randomDressMusketeer( name, 0.0, 77756 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_musketeer31( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer31( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d16" ) ) ;
	sayAndWait( name, getString( "musketeer_d16" ) ) ;
end

-- musketeer32 (rochelle)
function init_musketeer32( name )
end

function place_musketeer32( name )
	placeCharacter( name, "france", -8430, 9829 ) ;
end

function dress_musketeer32( name )
	randomDressMusketeer( name, 0.0, 66799 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer32( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer32( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d18" ) ) ;
	sayAndWait( name, getString( "musketeer_d18" ) ) ;
end

-- musketeer33 (rochelle)
function init_musketeer33( name )
end

function place_musketeer33( name )
	placeCharacter( name, "france", -8390, 9829 ) ;
end

function dress_musketeer33( name )
	randomDressMusketeer( name, 0.0, 13443799 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer33( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer33( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d16" ) ) ;
	sayAndWait( name, getString( "musketeer_d16" ) ) ;
end

-- musketeer34 (rochelle)
function init_musketeer34( name )
end

function place_musketeer34( name )
	placeCharacter( name, "france", -8701, 9898 ) ;
end

function dress_musketeer34( name )
	randomDressMusketeer( name, 0.0, 123799 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer34( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer34( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d7" ) ) ;
	sayAndWait( name, getString( "musketeer_d7" ) ) ;
end

-- musketeer35 (rochelle)
function init_musketeer35( name )
end

function place_musketeer35( name )
	placeCharacter( name, "france", -8351, 10000 ) ;
end

function dress_musketeer35( name )
	randomDressMusketeer( name, 0.0, 139799 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer35( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer35( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d19" ) ) ;
	sayAndWait( name, getString( "musketeer_d19" ) ) ;
end

-- musketeer36 (rochelle)
function init_musketeer36( name )
end

function place_musketeer36( name )
	placeCharacter( name, "france", -8645, 9712 ) ;
end

function dress_musketeer36( name )
	randomDressMusketeer( name, 0.0, 93799 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer36( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer36( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d20" ) ) ;
	sayAndWait( name, getString( "musketeer_d20" ) ) ;
end

-- musketeer37 (rochelle)
function init_musketeer37( name )
end

function place_musketeer37( name )
	placeCharacter( name, "france", -8645, 9770 ) ;
end

function dress_musketeer37( name )
	randomDressMusketeer( name, 0.0, 22799 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer37( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer37( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d8" ) ) ;
	sayAndWait( name, getString( "musketeer_d8" ) ) ;
end

-- musketeer38 (rochelle)
function init_musketeer38( name )
end

function place_musketeer38( name )
	placeCharacter( name, "france", -8340, 9670 ) ;
end

function dress_musketeer38( name )
	randomDressMusketeer( name, 0.0, 36799 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer38( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer38( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d19" ) ) ;
	sayAndWait( name, getString( "musketeer_d19" ) ) ;
end

-- musketeer39 (rochelle)
function init_musketeer39( name )
end

function place_musketeer39( name )
	placeCharacter( name, "france", -8290, 9670 ) ;
end

function dress_musketeer39( name )
	randomDressMusketeer( name, 0.0, 133129 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer39( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer39( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d20" ) ) ;
	sayAndWait( name, getString( "musketeer_d20" ) ) ;
end

-- musketeer40 (rochelle)
function init_musketeer40( name )
end

function place_musketeer40( name )
	placeCharacter( name, "france", -8315, 9700 ) ;
end

function dress_musketeer40( name )
	randomDressMusketeer( name, 0.0, 136699 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer40( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer40( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d7" ) ) ;
	sayAndWait( name, getString( "musketeer_d7" ) ) ;
end

-- musketeer41 (rochelle)
function init_musketeer41( name )
end

function place_musketeer41( name )
	placeCharacter( name, "france", -8107, 9724 ) ;
end

function dress_musketeer41( name )
	randomDressMusketeer( name, 0.0, 439 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer41( name )
	while ( true ) do
		local destX = -8189 ;
		local destY = 9728 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		waitForNoGoal( name ) ;
		
		wait( 1 ) ;
		
		destX = -8048 ;
		destY = 9722 ;
		addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
		waitForNoGoal( name ) ;
	
		wait( 1 ) ;
	
		coroutine.yield( ) ;
	end
end

function chat_musketeer41( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hellodartagnan" ) ) ;
	sayAndWait( name, getString( "hellodartagnan" ) ) ;
end

-- musketeer42 (rochelle)
function init_musketeer42( name )
end

function place_musketeer42( name )
	placeCharacter( name, "france", -8520, 9697) ;
end

function dress_musketeer42( name )
	randomDressMusketeer( name, 0.0, 9949 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer42( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer42( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d8" ) ) ;
	sayAndWait( name, getString( "musketeer_d8" ) ) ;
end

-- musketeer43 (rochelle)
function init_musketeer43( name )
end

function place_musketeer43( name )
	placeCharacter( name, "france", -8665, 9740 ) ;
end

function dress_musketeer43( name )
	randomDressMusketeer( name, 0.0, 13349 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer43( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer43( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- musketeer44 (rochelle)
function init_musketeer44( name )
end

function place_musketeer44( name )
	placeCharacter( name, "france", -8625, 9740 ) ;
end

function dress_musketeer44( name )
	randomDressMusketeer( name, 0.0, 9993349 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_musketeer44( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_musketeer44( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d16" ) ) ;
	sayAndWait( name, getString( "musketeer_d16" ) ) ;
end

-- musketeerlouvre1
function init_musketeerlouvre1( name )
end

function place_musketeerlouvre1( name )
	placeCharacter( name, "louvrehouse", -773, -173 ) ;
end

function dress_musketeerlouvre1( name )
	randomDressMusketeer( name, 0.0, 99944 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeerlouvre1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_musketeerlouvre1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d16" ) ) ;
	sayAndWait( name, getString( "musketeer_d16" ) ) ;
end

-- musketeerlouvre2
function init_musketeerlouvre2( name )
end

function place_musketeerlouvre2( name )
	placeCharacter( name, "louvrehouse", -847, -173 ) ;
end

function dress_musketeerlouvre2( name )
	randomDressMusketeer( name, 0.0, 93774 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeerlouvre2( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_musketeerlouvre2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d8" ) ) ;
	sayAndWait( name, getString( "musketeer_d8" ) ) ;
end

-- musketeerlouvre3
function init_musketeerlouvre3( name )
end

function place_musketeerlouvre3( name )
	placeCharacter( name, "louvrehouse", 570, 160 ) ;
end

function dress_musketeerlouvre3( name )
	randomDressMusketeer( name, 0.0, 9972714 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeerlouvre3( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_musketeerlouvre3( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "hellodartagnan" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d2" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- musketeerlouvre4
function init_musketeerlouvre4( name )
end

function place_musketeerlouvre4( name )
	placeCharacter( name, "louvrehouse", 609, -172 ) ;
end

function dress_musketeerlouvre4( name )
	randomDressMusketeer( name, 0.0, 947274 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeerlouvre4( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_musketeerlouvre4( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "musketeer_d7" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d1" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- musketeerlouvre5
function init_musketeerlouvre5( name )
end

function place_musketeerlouvre5( name )
	placeCharacter( name, "louvrehouse2", -768, -169 ) ;
end

function dress_musketeerlouvre5( name )
	randomDressMusketeer( name, 0.0, 997274 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeerlouvre5( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_musketeerlouvre5( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "hellodartagnan" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d2" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- musketeerlouvre6
function init_musketeerlouvre6( name )
end

function place_musketeerlouvre6( name )
	placeCharacter( name, "louvrehouse2", -633, -170 ) ;
end

function dress_musketeerlouvre6( name )
	randomDressMusketeer( name, 0.0, 99721 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeerlouvre6( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_musketeerlouvre6( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d16" ) ) ;
	sayAndWait( name, getString( "musketeer_d16" ) ) ;
end

-- musketeerlouvre7
function init_musketeerlouvre7( name )
end

function place_musketeerlouvre7( name )
	placeCharacter( name, "louvrehouse2", 640, -849 ) ;
end

function dress_musketeerlouvre7( name )
	randomDressMusketeer( name, 0.0, 99721 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeerlouvre7( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_musketeerlouvre7( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d8" ) ) ;
	sayAndWait( name, getString( "musketeer_d8" ) ) ;
end

-- musketeerlouvre8
function init_musketeerlouvre8( name )
end

function place_musketeerlouvre8( name )
	placeCharacter( name, "louvrehouse2", 395, 76 ) ;
end

function dress_musketeerlouvre8( name )
	randomDressMusketeer( name, 0.0, 99721 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_musketeerlouvre8( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_musketeerlouvre8( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "hellodartagnan" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d2" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- louvreservantlady1
function init_louvreservantlady1( name )
	setWoman( name, true ) ;
end

function place_louvreservantlady1( name )
	placeCharacter( name, "louvrehouse", 1164, -845 ) ;
end

function dress_louvreservantlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "957a4a" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "6d6de5" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "6d6de5" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "6d6de5" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8e8161" ) ;
	addCharacterPiece( name, "w_hat_cap" ) ;
	end
	

function runAI_louvreservantlady1( name )
	while ( true ) do
		local destX = 1164 ;
		local destY = -845 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 1060 ;
		local destY = -743 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_louvreservantlady1( name, chatWith )
	genericGreeting( name, chatWith, 0.93 ) ;
end

-- louvreservantlady2
function init_louvreservantlady2( name )
	setWoman( name, true ) ;
end

function place_louvreservantlady2( name )
	placeCharacter( name, "louvrehouse", 1182, -644 ) ;
end

function dress_louvreservantlady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "e0d25a" ) ;
	addCharacterPiece( name, "w_stripe_torso", "b1a992" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "8e8161" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right","8e8161" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "8e8161" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6d6de5" ) ;
	addCharacterPiece( name, "w_hat_cap" ) ;
end

function runAI_louvreservantlady2( name )
	while ( true ) do
		local destX = 1182 ;
		local destY = -644 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 1145 ;
		local destY = -600 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_louvreservantlady2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "louvreservantlady2_d1" ) ) ;
	sayAndWait( name, getString( "louvreservantlady2_d1" ) ) ;
end

-- louvreservantlady3
function init_louvreservantlady3( name )
	setWoman( name, true ) ;
end

function place_louvreservantlady3( name )
	placeCharacter( name, "louvrehouse", 1265, -749 ) ;
end

function dress_louvreservantlady3( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_plain", "cdaa4c" ) ;
	addCharacterPiece( name, "w_stripe_torso", "bdc4ef" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "6d6de5" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "6d6de5" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "6d6de5" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8e8161" ) ;

end

function runAI_louvreservantlady3( name )
	while ( true ) do
		local destX = 1265 ;
		local destY = -749 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 1274 ;
		local destY = -854 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_louvreservantlady3( name, chatWith )
	fameGreeting( name, chatWith ) ;
end

-- louvreservantlady4
function init_louvreservantlady4( name )
	setWoman( name, true ) ;
end

function place_louvreservantlady4( name )
	placeCharacter( name, "louvrehouse2", 1038, -428 ) ;
end

function dress_louvreservantlady4( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "2d251c" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "6d6de5" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "6d6de5" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "6d6de5" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "d3cb6b" ) ;
end

function runAI_louvreservantlady4( name )
	while ( true ) do
		local destX = 1038 ;
		local destY = -428 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse2", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 1307 ;
		local destY = -803 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse2", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_louvreservantlady4( name, chatWith )
	genericGreeting( name, chatWith, 1.0 ) ;
end

-- louvreservantman1
function init_louvreservantman1( name )
end

function place_louvreservantman1( name )
	placeCharacter( name, "louvrehouse", 1265, -412 ) ;
end

function dress_louvreservantman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "d3ca6b" ) ;
	addCharacterPiece( name, "belt", "8e8161" ) ;
	addCharacterPiece( name, "boot_sock_right"  ) ;
	addCharacterPiece( name, "boot_sock_left" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "d3ca6b" ) ;
	addCharacterPiece( name, "hair_curly", "d3ca6b" ) ;
	addCharacterPiece( name, "pant_baggy_right", "8e8161" ) ;
	addCharacterPiece( name, "pant_baggy_left", "8e8161" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "d3ca6b" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "d3ca6b" ) ;
end

function runAI_louvreservantman1( name )
	while ( true ) do
		local destX = 1265 ;
		local destY = -412 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 1270 ;
		local destY = -354 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse", false ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 1, 3 ) ) ;

		local destX = 1085 ;
		local destY = -319 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse", false ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 1, 3 ) ) ;
	end
end

function chat_louvreservantman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "louvreservantman1_d1" ) ) ;
	sayAndWait( name, getString( "louvreservantman1_d1" ) ) ;
end

-- louvreservantman2
function init_louvreservantman2( name )
end

function place_louvreservantman2( name )
	placeCharacter( name, "louvrehouse2", 1043, -839 ) ;
end

function dress_louvreservantman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "2d261e" ) ;	
	addCharacterPiece( name, "belt", "8e8161" ) ;
	addCharacterPiece( name, "boot_plain_right", "8e8161" ) ;
	addCharacterPiece( name, "boot_plain_left", "8e8161" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "6d6de5" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "6d6de5" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "6d6de5" ) ;
	addCharacterPiece( name, "hair_medium", "2d261e" ) ;
	addCharacterPiece( name, "mustache_a", "2d261e" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "b1a992" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "b1a992" ) ;
end

function runAI_louvreservantman2( name )
	while ( true ) do
		local destX = 1043 ;
		local destY = -839 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse2", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 979 ;
		local destY = -782 ;
		addGoalGetToPointInLevel( name, destX, destY, "louvrehouse2", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 1, 3 ) ) ;
	end
end

function chat_louvreservantman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "louvreservantman2_d1" ) ) ;
	sayAndWait( name, getString( "louvreservantman2_d1" ) ) ;
end

-- louvreservantman3
function init_louvreservantman3( name )
end

function place_louvreservantman3( name )
	placeCharacter( name, "louvrehouse2", 1127, -818 ) ;
end

function dress_louvreservantman3( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt", "b1a992" ) ;
	addCharacterPiece( name, "boot_sock_right" ) ;
	addCharacterPiece( name, "boot_sock_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_long", "d38e35" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "6d6de5" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "6d6de5" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "8e8161" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d3cb6b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d3cb6b" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "d3cb6b" ) ;
	end

function runAI_louvreservantman3( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_louvreservantman3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "longliveking" ) ) ;
	sayAndWait( name, getString( "longliveking" ) ) ;
end

-- marinlebourgeoys
function init_marinlebourgeoys( name )
end

function place_marinlebourgeoys( name )
	placeCharacter( name, "louvrehouse2", 472, -840 ) ;
end

function dress_marinlebourgeoys( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "5f4729" ) ;
	addCharacterPiece( name, "boot_sock_right", "ada293" ) ;
	addCharacterPiece( name, "boot_sock_left", "ada293" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "332410" ) ;
	addCharacterPiece( name, "glove_plain_right", "ada293" ) ;
	addCharacterPiece( name, "glove_plain_left", "ada293" ) ;
	addCharacterPiece( name, "mustache_b", "5f4729" ) ;
	addCharacterPiece( name, "hair_medium", "5f4729"  ) ;
	addCharacterPiece( name, "pant_musketeer_right", "170e03" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "170e03" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "332410" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "332410" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "ada293" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "ada293" ) ;	
	addCharacterPiece( name, "stripe_plain_leg_right", "ada293" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "ada293" ) ;	
end

function runAI_marinlebourgeoys( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_marinlebourgeoys( name, chatWith )
	local split1 = gameIsSplit( ) and getGameSplitPart( ) == 1 ;
	if ( split1 ) then
		sayAndWait( name, getString( "mmarin0d1" ) ) ;
		return ;
	end

	if ( isMissionComplete( "missionmarin3" ) ) then
		local items = { "ointment" } ;
		
		local guns = {
			"pistol_flintlock_1", 
			"pistol_flintlock_2", 
			"pistol_flintlock_3", 
			"pistol_flintlock_4", 
			"pistol_flintlock_5", 
			"pistol_flintlock_6", 
			"pistol_flintlock_7",
			"pistol_flintlock_8",
			"musket_flintlock_1", 
			"musket_flintlock_2", 
			"musket_flintlock_3", 
			"musket_flintlock_4", 
			"musket_flintlock_5", 
			"musket_flintlock_6", 
			"musket_flintlock_7",
			"musket_flintlock_8" } ;
			
		if ( getBoolean( "gunsAvailable" ) ) then
			for i, v in pairs(guns) do
				table.insert( items, v ) ;
			end
		end
			
		chat_vendor( name, chatWith, items ) ;
	else
		sayAndWait( name, getString( "mmarin0d1" ) ) ;
		
		local requireHonour = 20 ;
		if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
			setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
		elseif ( getTooManyActiveMissions( ) ) then
			setQuickInfoTag( getString( "toomanymissions" ) ) ;
		else
			-- meets minimum requirements
			sayAndWait( name, getString( "mmarin0d2" ) ) ;
			sayAndWait( name, getString( "mmarin0d3" ) ) ;
	
			local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mmarin0d4" ), getString( "mmarin0d5" ), getString( "mmarin0d6" ) ) ;
			local option = waitForBubbleOption( bubInd ) ;
			if ( option == 0 ) then
				-- accept
			elseif ( option == 1 ) then
				-- ask about pay
				sayAndWait( name, getString( "mmarin0d7" ) ) ;
			else
				-- reject
				return ;
			end
			
			sayAndWait( name, getString( "mmarin0d8" ) ) ;

			activateMission( "missionmarin1" ) ;
		end
	end
end

-- guardsman1
function init_guardsman1( name )
end

function place_guardsman1A( name )
	placeCharacter( name, "guardhouse", -39, 80 ) ;
end

function place_guardsman1B( name )
	placeCharacter( name, "france", -8144, 8925 ) ;
end

function dress_guardsman1A( name )
	randomDressGuardsman( name, 0.0, 137796 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman1B( name )
	dress_guardsman1A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman1( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman1( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- guardsman2
function init_guardsman2( name )
end

function place_guardsman2A( name )
	placeCharacter( name, "guardhouse", 0, 80 ) ;
end

function place_guardsman2B( name )
	placeCharacter( name, "france", -8090, 8926 ) ;
end

function dress_guardsman2A( name )
	randomDressGuardsman( name, 0.0, 1379796 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman2B( name )
	dress_guardsman2A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman2( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman2( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- guardsman3
function init_guardsman3( name )
end

function place_guardsman3A( name )
	placeCharacter( name, "guardhouse", 75, 150 ) ;
end

function place_guardsman3B( name )
	placeCharacter( name, "france", -8010, 9063 ) ;
end

function dress_guardsman3A( name )
	randomDressGuardsman( name, 0.0, 2796 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman3B( name )
	dress_guardsman3A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman3( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman3( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- guardsman4
function init_guardsman4( name )
end

function place_guardsman4A( name )
	placeCharacter( name, "guardhouse", 105, 150 ) ;
end

function place_guardsman4B( name )
	placeCharacter( name, "france", -7876, 8991 ) ;
end

function dress_guardsman4A( name )
	randomDressGuardsman( name, 0.0, 2135796 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman4B( name )
	dress_guardsman4A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman4( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman4( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- guardsman5
function init_guardsman5( name )
end

function place_guardsman5A( name )
	placeCharacter( name, "guardhouse", 90, 120 ) ;
end

function place_guardsman5B( name )
	placeCharacter( name, "france", -7826, 8991 ) ;
end

function dress_guardsman5A( name )
	randomDressGuardsman( name, 0.0, 21796 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman5B( name )
	dress_guardsman5A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman5( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman5( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- guardsman6
function init_guardsman6( name )
end

function place_guardsman6A( name )
	placeCharacter( name, "guardhouse", -190, 314 ) ;
end

function place_guardsman6B( name )
	placeCharacter( name, "france", -7851, 9016 ) ;
end

function dress_guardsman6A( name )
	randomDressGuardsman( name, 0.0, 217988 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman6B( name )
	dress_guardsman6A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman6( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman6( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- guardsman7
function init_guardsman7( name )
end

function place_guardsman7A( name )
	placeCharacter( name, "guardhouse", -150, 314 ) ;
end

function place_guardsman7B( name )
	placeCharacter( name, "france", -8288, 8837 ) ;
end

function dress_guardsman7A( name )
	randomDressGuardsman( name, 0.0, 21768 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman7B( name )
	dress_guardsman7A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman7( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman7( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- guardsman8
function init_guardsman8( name )
end

function place_guardsman8A( name )
	sitCharacter( name, "guardbench" ) ;
end

function place_guardsman8B( name )
	placeCharacter( name, "france", -8288, 8880 ) ;
end

function dress_guardsman8A( name )
	randomDressGuardsman( name, 0.0, 776768 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman8B( name )
	dress_guardsman8A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman8( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman8( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- guardsman9
function init_guardsman9( name )
end

function place_guardsman9A( name )
	placeCharacter( name, "guardhouse2", -21, 70 ) ;
end

function place_guardsman9B( name )
	placeCharacter( name, "france", -8241, 9145 ) ;
end

function dress_guardsman9A( name )
	randomDressGuardsman( name, 0.0, 2176468 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman9B( name )
	dress_guardsman9A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman9( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman9( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- guardsman10
function init_guardsman10( name )
end

function place_guardsman10A( name )
	placeCharacter( name, "guardhouse2", 21, 70 ) ;
end

function place_guardsman10B( name )
	placeCharacter( name, "france", -8200, 9145 ) ;
end

function dress_guardsman10A( name )
	randomDressGuardsman( name, 0.0, 2176468 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman10B( name )
	dress_guardsman10A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman10( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman10( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- guardsman11
function init_guardsman11( name )
end

function place_guardsman11A( name )
	placeCharacter( name, "guardhouse2", 0, 120 ) ;
end

function place_guardsman11B( name )
	placeCharacter( name, "france", -8173, 9212 ) ;
end

function dress_guardsman11A( name )
	randomDressGuardsman( name, 0.0, 13268 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman11B( name )
	dress_guardsman11A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman11( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman11( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- guardsman12
function init_guardsman12( name )
end

function place_guardsman12A( name )
	placeCharacter( name, "guardhouse2", -249, 311 ) ;
end

function place_guardsman12B( name )
	placeCharacter( name, "france", -8173, 9262 ) ;
end

function dress_guardsman12A( name )
	randomDressGuardsman( name, 0.0, 133268 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman12B( name )
	dress_guardsman12A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman12( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		setBaseFaceDirection( name, 0, -1 ) ;

		while ( true ) do
			local destX = -263 ;
			local destY = 249 ;
			addGoalGetToPointInLevel( name, destX, destY, "guardhouse2", false ) ;
			waitForNoGoal( name ) ;
			
			destX = -260 ;
			destY = 345 ;
			addGoalGetToPointInLevel( name, destX, destY, "guardhouse2", false ) ;
			waitForNoGoal( name ) ;
		
			coroutine.yield( ) ;
		end
	end
end

function chat_guardsman12( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- guardsman13
function init_guardsman13( name )
end

function place_guardsman13A( name )
	placeCharacter( name, "guardhouse2", -30, 270 ) ;
end

function place_guardsman13B( name )
	placeCharacter( name, "france", -7860, 9292 ) ;
end

function dress_guardsman13A( name )
	randomDressGuardsman( name, 0.0, 1991778 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman13B( name )
	dress_guardsman13A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman13( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman13( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- guardsman14
function init_guardsman14( name )
end

function place_guardsman14A( name )
	placeCharacter( name, "guardhouse2", 10, 270 ) ;
end

function place_guardsman14B( name )
	placeCharacter( name, "france", -7820, 9292 ) ;
end

function dress_guardsman14A( name )
	randomDressGuardsman( name, 0.0, 23781 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman14B( name )
	dress_guardsman14A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman14( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman14( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- guardsman15
function init_guardsman15( name )
end

function place_guardsman15A( name )
	placeCharacter( name, "guardhouse", -49, 222 ) ;
end

function place_guardsman15B( name )
	placeCharacter( name, "france", -8200, 9416 ) ;
end

function dress_guardsman15A( name )
	randomDressGuardsman( name, 0.0, 232378 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman15B( name )
	dress_guardsman15A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman15( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			local destX = 35 ;
			local destY = 182 ;
			setBaseFaceCharacter( name, "guardsman3" ) ;
			addGoalGetToPointInLevel( name, destX, destY, "guardhouse", false ) ;
			waitForNoGoal( name ) ;
			
			wait( 1 ) ;
			
			destX = -168 ;
			destY = 272 ;
			setBaseFaceDirection( name, 0, 1 ) ;
			addGoalGetToPointInLevel( name, destX, destY, "guardhouse", false ) ;
			waitForNoGoal( name ) ;
		
			wait( 1 ) ;
			
			coroutine.yield( ) ;
		end
	end
end

function chat_guardsman15( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- guardsman16
function init_guardsman16( name )
end

function place_guardsman16A( name )
	placeCharacter( name, "france", 2905, 3393 ) ;
end

function place_guardsman16B( name )
	placeCharacter( name, "france", -8160, 9416 ) ;
end

function dress_guardsman16A( name )
	randomDressGuardsman( name, 0.0, 3378 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman16B( name )
	dress_guardsman16A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman16( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman16( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- guardsman17
function init_guardsman17( name )
end

function place_guardsman17A( name )
	placeCharacter( name, "france", 2945, 3393 ) ;
end

function place_guardsman17B( name )
	placeCharacter( name, "france", -8356, 9030 ) ;
end

function dress_guardsman17A( name )
	randomDressGuardsman( name, 0.0, 339878 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman17B( name )
	dress_guardsman17A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman17( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman17( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- guardsman18
function init_guardsman18( name )
end

function place_guardsman18A( name )
	placeCharacter( name, "france", 3160, 3388 ) ;
end

function place_guardsman18B( name )
	placeCharacter( name, "france", -7808, 8898 ) ;
end

function dress_guardsman18A( name )
	randomDressGuardsman( name, 0.0, 343378 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman18B( name )
	dress_guardsman18A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman18( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman18( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- guardsman19
function init_guardsman19( name )
end

function place_guardsman19A( name )
	placeCharacter( name, "france", 3200, 3388 ) ;
end

function place_guardsman19B( name )
	placeCharacter( name, "france", -8105, 9051 ) ;
end

function dress_guardsman19A( name )
	randomDressGuardsman( name, 0.0, 137378 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman19B( name )
	dress_guardsman19A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman19( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, -1 ) ;

			local destX = -8012 ;
			local destY = 9101 ;
			addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
			waitForNoGoal( name ) ;
			
			wait( 2 ) ;
			
			destX = -8116 ;
			destY = 8960 ;
			addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
			waitForNoGoal( name ) ;
		
			wait( 2 ) ;
			
			coroutine.yield( ) ;
		end
		
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman19( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- guardsman20
function init_guardsman20( name )
end

function place_guardsman20A( name )
	placeCharacter( name, "france", 3180, 3410 ) ;
end

function place_guardsman20B( name )
	placeCharacter( name, "france", -8414, 9443 ) ;
end

function dress_guardsman20A( name )
	randomDressGuardsman( name, 0.0, 166378 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_guardsman20B( name )
	dress_guardsman20A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman20( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceNone( name ) ;

			local destX = -8514 ;
			local destY = 9443 ;
			addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
			waitForNoGoal( name ) ;
			
			destX = -8314 ;
			destY = 9443 ;
			addGoalGetToPointInLevel( name, destX, destY, "france", false ) ;
			waitForNoGoal( name ) ;
			
			coroutine.yield( ) ;
		end
		
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_guardsman20( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- guardsman21
function init_guardsman21( name )
end

function place_guardsman21( name )
	placeCharacter( name, "france", -9560, 9589 ) ;
end

function dress_guardsman21( name )
	randomDressGuardsman( name, 0.0, 664944) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman21( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_guardsman21( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- guardsman22
function init_guardsman22( name )
end

function place_guardsman22( name )
	placeCharacter( name, "france", -9540, 9746 ) ;
end

function dress_guardsman22( name )
	randomDressGuardsman( name, 0.0, 6649413 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman22( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_guardsman22( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- guardsman23
function init_guardsman23( name )
end

function place_guardsman23( name )
	placeCharacter( name, "france", -9648, 9887 ) ;
end

function dress_guardsman23( name )
	randomDressGuardsman( name, 0.0, 48976 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman23( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_guardsman23( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- guardsman24
function init_guardsman24( name )
end

function place_guardsman24( name )
	placeCharacter( name, "france", -9429, 10273 ) ;
end

function dress_guardsman24( name )
	randomDressGuardsman( name, 0.0, 631123 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman24( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_guardsman24( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- guardsman25
function init_guardsman25( name )
end

function place_guardsman25( name )
	placeCharacter( name, "france", -9167, 10672 ) ;
end

function dress_guardsman25( name )
	randomDressGuardsman( name, 0.0, 941331 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_guardsman25( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_guardsman25( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- foureau (guardsman who tries to kill dartagnan, later dies from wine, should be brisemont)
function init_foureau( name )
	setAllowPermanentDeath( name, false ) ;
	setStatsCalculatorStatic( name, 32, 32, 32, 32 ) ;
	setHasLootDrop( name, false ) ;
end

function place_foureauA( name )
	placeDead( name ) ;
end

function place_foureauB( name )
	placeCharacter( name, "france", -8265, 9306 ) ;
end

function place_foureauC( name )
	placeCharacter( name, "france", -7585, 9106 ) ;
end

function place_foureauD( name )
	placeDead( name ) ;
end

function dress_foureauA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "boot_plain_right", "ad8555" ) ;
	addCharacterPiece( name, "boot_plain_left", "ad8555" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "cdaa8b" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "cdaa8b" ) ;
	addCharacterPiece( name, "hair_medium", "cec07b" ) ;	
	addCharacterPiece( name, "beard_a", "cec07b" ) ;	
	addCharacterPiece( name, "mustache_a", "cec07b" ) ;	
	addCharacterPiece( name, "hat_simple", "a4845f" ) ;	
	addCharacterPiece( name, "belt", "9b7756" ) ;	
	addCharacterPiece( name, "glove_plain_left", "766e65" ) ;
	addCharacterPiece( name, "glove_plain_right", "766e65" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "d5c07d" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d7d0c2" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d7d0c2" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e5c45e" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e5c45e" ) ;
	
	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_foureau( name )
	while ( true ) do
		setBaseFaceCharacter( name, "dartagnan" ) ;
		wait( 1 ) ;
	end
end

function chat_foureau( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- cardinalsguard1
function init_cardinalsguard1( name )
	setAllowPermanentDeath( name, false ) ;
	setStatsCalculatorStatic( name, 7, 7, 7, 7 ) ; -- 7, 7, 7, 7
end

function place_cardinalsguard1( name )
	placeCharacter( name, "france", -576, 3929 ) ;
end

function dress_cardinalsguard1( name )
	randomDressCardinalsGuard( name, 0.0, 511112 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguard1( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
	
		coroutine.yield( ) ;
	end
end

function chat_cardinalsguard1( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguard2
function init_cardinalsguard2( name )
	setAllowPermanentDeath( name, false ) ;
	setStatsCalculatorStatic( name, 7, 7, 7, 7 ) ;
end

function place_cardinalsguard2( name )
	placeCharacter( name, "france", -530, 3929 ) ;
end

function dress_cardinalsguard2( name )
	randomDressCardinalsGuard( name, 0.0, 3492 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguard2( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_cardinalsguard2( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguard3
function init_cardinalsguard3( name )
	setAllowPermanentDeath( name, false ) ;
end

function place_cardinalsguard3A( name )
	placeCharacter( name, "cardinalguardhouse", -29, 87 ) ;
end

function place_cardinalsguard3B( name )
	placeCharacter( name, "france", -9160, 9354 ) ;
end

function dress_cardinalsguard3A( name )
	randomDressCardinalsGuard( name, 0.0, 123433 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_cardinalsguard3B( name )
	dress_cardinalsguard3A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_cardinalsguard3( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_cardinalsguard3( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguard4
function init_cardinalsguard4( name )
	setAllowPermanentDeath( name, false ) ;
end

function place_cardinalsguard4A( name )
	placeCharacter( name, "cardinalguardhouse", 10, 87 ) ;
end

function place_cardinalsguard4B( name )
	placeCharacter( name, "france", -9200, 9354 ) ;
end

function dress_cardinalsguard4A( name )
	randomDressCardinalsGuard( name, 0.0, 34446 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_cardinalsguard4B( name )
	dress_cardinalsguard4A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_cardinalsguard4( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_cardinalsguard4( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguard5
function init_cardinalsguard5( name )
	setAllowPermanentDeath( name, false ) ;
end

function place_cardinalsguard5A( name )
	placeCharacter( name, "cardinalguardhouse", -183, 149 ) ;
end

function place_cardinalsguard5B( name )
	placeCharacter( name, "france", -8778, 9098 ) ;
end

function dress_cardinalsguard5A( name )
	randomDressCardinalsGuard( name, 0.0, 116476 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_cardinalsguard5B( name )
	dress_cardinalsguard5A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_cardinalsguard5( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_cardinalsguard5( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguard6
function init_cardinalsguard6( name )
	setAllowPermanentDeath( name, false ) ;
end

function place_cardinalsguard6A( name )
	placeCharacter( name, "cardinalguardhouse", -143, 149 ) ;
end

function place_cardinalsguard6B( name )
	placeCharacter( name, "france", -8738, 9098 ) ;
end

function dress_cardinalsguard6A( name )
	randomDressCardinalsGuard( name, 0.0, 15576 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_cardinalsguard6B( name )
	dress_cardinalsguard6A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_cardinalsguard6( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_cardinalsguard6( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguard7
function init_cardinalsguard7( name )
	setAllowPermanentDeath( name, false ) ;
end

function place_cardinalsguard7A( name )
	placeCharacter( name, "cardinalguardhouse", -163, 170 ) ;
end

function place_cardinalsguard7B( name )
	placeCharacter( name, "france", -8850, 9402 ) ;
end

function dress_cardinalsguard7A( name )
	randomDressCardinalsGuard( name, 0.0, 64646 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_cardinalsguard7B( name )
	dress_cardinalsguard7A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_cardinalsguard7( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_cardinalsguard7( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguard8
function init_cardinalsguard8( name )
	setAllowPermanentDeath( name, false ) ;
end

function place_cardinalsguard8A( name )
	placeCharacter( name, "cardinalguardhouse2", 0, 160 ) ;
end

function place_cardinalsguard8B( name )
	placeCharacter( name, "france", -8638, 9183 ) ;
end

function dress_cardinalsguard8A( name )
	randomDressCardinalsGuard( name, 0.0, 34146 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_cardinalsguard8B( name )
	dress_cardinalsguard8A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_cardinalsguard8( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_cardinalsguard8( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguard9
function init_cardinalsguard9( name )
	setAllowPermanentDeath( name, false ) ;
end

function place_cardinalsguard9A( name )
	placeCharacter( name, "cardinalguardhouse2", 40, 160 ) ;
end

function place_cardinalsguard9B( name )
	placeCharacter( name, "france", -8598, 9183 ) ;
end

function dress_cardinalsguard9A( name )
	randomDressCardinalsGuard( name, 0.0, 633699 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_cardinalsguard9B( name )
	dress_cardinalsguard9A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_cardinalsguard9( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, -1, 0 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_cardinalsguard9( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguard10
function init_cardinalsguard10( name )
	setAllowPermanentDeath( name, false ) ;
end

function place_cardinalsguard10A( name )
	placeCharacter( name, "cardinalguardhouse2", 20, 130 ) ;
end

function place_cardinalsguard10B( name )
	placeCharacter( name, "france", -8618, 9213 ) ;
end

function dress_cardinalsguard10A( name )
	randomDressCardinalsGuard( name, 0.0, 1136 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function dress_cardinalsguard10B( name )
	dress_cardinalsguard10A( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function runAI_cardinalsguard10( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 0, 1 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_cardinalsguard10( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- jussac
function init_jussac( name )
	setAllowPermanentDeath( name, false ) ;
	setStatsCalculatorStatic( name, 8, 8, 8, 8 ) ;
end

function place_jussac( name )
	placeCharacter( name, "france", -260, 3917 ) ;
end

function dress_jussac( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "hair_long", "211510" ) ;
	addCharacterPiece( name, "beard_c", "211510" ) ;
	addCharacterPiece( name, "mustache_a", "211510" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "tabbard_overlay" ) ;
	addCharacterPiece( name, "tabbard", "ac2323"  ) ;
	addCharacterPiece( name, "doublet_plain_torso", "827a78" ) ;
	addCharacterPiece( name, "boot_plain_right" ) ;
	addCharacterPiece( name, "boot_plain_left" );
	addCharacterPiece( name, "glove_plain_right", "bda6a0" ) ;
	addCharacterPiece( name, "glove_plain_left", "bda6a0" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "eae6d6" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "eae6d6" ) ;
	addCharacterPiece( name, "pant_baggy_right", "81736c" ) ;
	addCharacterPiece( name, "pant_baggy_left", "81736c" ) ;

	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_jussac( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_jussac( name, chatWith )
	if ( isMissionComplete( "missionparis8" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "jussac_d1" ) ) ;
		sayAndWait( name, getString( "jussac_d1" ) ) ;
	else
		cardGuardGreeting( name, chatWith, 2 ) ;
	end
end

-- cahusac
function init_cahusac( name )
	setAllowPermanentDeath( name, false ) ;
	setStatsCalculatorStatic( name, 8, 8, 8, 8 ) ;
end

function place_cahusac( name )
	placeCharacter( name, "france", -211, 3917 ) ;
end

function dress_cahusac( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "hair_curly", "f3e973" ) ;
	addCharacterPiece( name, "beard_a", "bea88f" ) ;
	addCharacterPiece( name, "tabbard_overlay" ) ;
	addCharacterPiece( name, "tabbard", "ac2323"  ) ;
	addCharacterPiece( name, "boot_plain_right", "bba8ba" ) ;
	addCharacterPiece( name, "boot_plain_left", "bba8ba" );
	addCharacterPiece( name, "pant_musketeer_right", "bea88b" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "bea88b" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "9ea75f" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "9ea75f"  ) ;
	addCharacterPiece( name, "shirt_plain_torso", "9ea75f"  ) ;
	addCharacterPiece( name, "sashbelt", "9c6f35" ) ;

	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cahusac( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_cahusac( name, chatWith )
	if ( isMissionComplete( "missionparis8" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "cahusac_d1" ) ) ;
		sayAndWait( name, getString( "cahusac_d1" ) ) ;
	else
		cardGuardGreeting( name, chatWith, 3 ) ;
	end
end

-- bicarat
function init_bicarat( name )
	setAllowPermanentDeath( name, false ) ;
	setStatsCalculatorStatic( name, 8, 8, 8, 8 ) ;
end

function place_bicarat( name )
	placeCharacter( name, "france", -236, 3952 ) ;
end

function dress_bicarat( name )
clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "hair_short", "bea88f" ) ;
	addCharacterPiece( name, "mustache_b", "bea88f" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "tabbard_overlay" ) ;
	addCharacterPiece( name, "tabbard", "ac2323"  ) ;
	addCharacterPiece( name, "hat_plain", "a0957d" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "a45d93" ) ;
	addCharacterPiece( name, "boot_fancy_right", "a0957d" ) ;
	addCharacterPiece( name, "boot_fancy_left", "a0957d" );
	addCharacterPiece( name, "glove_plain_right", "776640" ) ;
	addCharacterPiece( name, "glove_plain_left", "776640" ) ;
	addCharacterPiece( name, "pant_baggy_right", "765309" ) ;
	addCharacterPiece( name, "pant_baggy_left", "765309" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "dbc38f" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "dbc38f"  ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "dbc38f"  ) ;
	addCharacterPiece( name, "shirt_plain_torso", "a45d93" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "a45d93" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "a45d93" ) ;
	
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_bicarat( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_bicarat( name, chatWith )
	if ( isMissionComplete( "missionparis8" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "bicarat_d1" ) ) ;
		sayAndWait( name, getString( "bicarat_d1" ) ) ;
	else
		cardGuardGreeting( name, chatWith, 1 ) ;
	end
end

-- bernajoux
function init_bernajoux( name )
	setStatsCalculatorStatic( name, 10, 10, 10, 10 ) ;
end

function place_bernajoux( name )
	placeDead( name ) ;
end

function dress_bernajoux( name )
		clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, 0.80 ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1, 1, 1, 0.80) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1, 1, 1, 0.80) ;
	addCharacterPiece( name, "hair_medium", "766640" ) ;
	addCharacterPiece( name, "mustache_a", "766640" ) ;
	addCharacterPiece( name, "beard_b", "766640" ) ;
	addCharacterPiece( name, "boot_plain_right", "68635b" ) ;
	addCharacterPiece( name, "boot_plain_left", "68635b" );
	addCharacterPiece( name, "pant_musketeer_right", "837787" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "837787" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "ac2323" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "ac2323" ) ;
	addCharacterPiece( name, "sashbelt", "ac2323" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "bda16b" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "bda16b"  ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "bda16b"  ) ;
	addCharacterPiece( name, "shirt_plain_torso", "efecb3" ) ;
	addCharacterPiece( name, "tabbard_overlay" ) ;
	addCharacterPiece( name, "tabbard", "ac2323"  ) ;

	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_bernajoux( name )
	while ( true ) do
		setBaseFaceCharacter( name, "dartagnan" ) ;
		wait( 1 ) ;
	end
end

function chat_bernajoux( name, chatWith )
	if ( isMissionActive( "missionparis10" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "bernajoux_d1" ) ) ;
		sayAndWait( name, getString( "bernajoux_d1" ) ) ;
	else
		cardGuardGreeting( name, chatWith, 2 ) ;
	end
end

-- cardinalsguard11
function init_cardinalsguard11( name )
end

function place_cardinalsguard11( name )
	placeCharacter( name, "cardinalguardhouse", 191, -8 ) ;
end

function dress_cardinalsguard11( name )
	randomDressCardinalsGuard( name, 0.0, 1344 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguard11( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_cardinalsguard11( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguard12
function init_cardinalsguard12( name )
end

function place_cardinalsguard12( name )
	placeCharacter( name, "cardinalguardhouse", -309, -3 ) ;
end

function dress_cardinalsguard12( name )
	randomDressCardinalsGuard( name, 0.0, 311344 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguard12( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_cardinalsguard12( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguard13
function init_cardinalsguard13( name )
end

function place_cardinalsguard13( name )
	sitCharacter( name, "cardinalguardchair1" ) ;
end

function dress_cardinalsguard13( name )
	randomDressCardinalsGuard( name, 0.0, 31131 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguard13( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_cardinalsguard13( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguard14
function init_cardinalsguard14( name )
end

function place_cardinalsguard14( name )
	sitCharacter( name, "cardinalguardchair2" ) ;
end

function dress_cardinalsguard14( name )
	randomDressCardinalsGuard( name, 0.0, 191344 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguard14( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_cardinalsguard14( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguard15
function init_cardinalsguard15( name )
end

function place_cardinalsguard15( name )
	sitCharacter( name, "cardinalguardbench1" ) ;
end

function dress_cardinalsguard15( name )
	randomDressCardinalsGuard( name, 0.0, 791344 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguard15( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_cardinalsguard15( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguard16
function init_cardinalsguard16( name )
end

function place_cardinalsguard16( name )
	placeCharacter( name, "cardinalguardhouse2", -382, 69 ) ;
end

function dress_cardinalsguard16( name )
	randomDressCardinalsGuard( name, 0.0, 66344 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguard16( name )
	while ( true ) do
		local destX = -384 ;
		local destY = 80 ;
		addGoalGetToPointInLevel( name, destX, destY, "cardinalguardhouse2", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( 10 ) ;

		local destX = -382 ;
		local destY = 244 ;
		addGoalGetToPointInLevel( name, destX, destY, "cardinalguardhouse2", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( 10 ) ;
	end
end

function chat_cardinalsguard16( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguard17
function init_cardinalsguard17( name )
end

function place_cardinalsguard17( name )
	placeCharacter( name, "cardinalguardhouse", -79, 31 ) ;
end

function dress_cardinalsguard17( name )
	randomDressCardinalsGuard( name, 0.0, 66344 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguard17( name )
	while ( true ) do
		local destX = -79 ;
		local destY = 31 ;
		addGoalGetToPointInLevel( name, destX, destY, "cardinalguardhouse", false ) ;
		setBaseFaceDirection( name, 1, -1 ) ;
		waitForNoGoal( name ) ;
		wait( 5 ) ;

		local destX = -119 ;
		local destY = 53 ;
		addGoalGetToPointInLevel( name, destX, destY, "cardinalguardhouse", false ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		waitForNoGoal( name ) ;
		wait( 5 ) ;
	end
end

function chat_cardinalsguard17( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguardinn1
function init_cardinalsguardinn1( name )
	setStatsCalculatorDynamic( name, -1, 1, 2, 100, 0.5 ) ;
	setHasPersistentStats( name, true ) ;
end

function place_cardinalsguardinn1A( name )
	sitCharacter( name, "parisinnbbench2" ) ;
end

function place_cardinalsguardinn1B( name )
	placeDead( name ) ;
end

function dress_cardinalsguardinn1( name )
	randomDressCardinalsGuard( name, 0.0, 33344 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardinn1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_cardinalsguardinn1( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguardinn2
function init_cardinalsguardinn2( name )
	setStatsCalculatorDynamic( name, -1, 1, 2, 100, 0.5 ) ;
	setHasPersistentStats( name, true ) ;
end

function place_cardinalsguardinn2A( name )
	sitCharacter( name, "parisinnbbench3" ) ;
end

function place_cardinalsguardinn2B( name )
	placeDead( name ) ;
end

function dress_cardinalsguardinn2( name )
	randomDressCardinalsGuard( name, 0.0, 3344 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardinn2( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_cardinalsguardinn2( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguardinn3
function init_cardinalsguardinn3( name )
	setStatsCalculatorDynamic( name, -1, 1, 2, 100, 0.5 ) ;
	setHasPersistentStats( name, true ) ;
end

function place_cardinalsguardinn3A( name )
	placeCharacter( name, "parisinnb", -87, 100 ) ;
end

function place_cardinalsguardinn3B( name )
	placeDead( name ) ;
end

function dress_cardinalsguardinn3( name )
	randomDressCardinalsGuard( name, 0.0, 83317 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardinn3( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function cardinalsguardinn3play( name )
	lockPlayerInPlace( ) ;
	setStateMessageIdle( "dartagnan" ) ;
	
	setBaseFaceCharacter( "cardinalsguardinn3", "dartagnan" ) ;
		
	gBetAmount = 10 ;
	gGameTempMusicID = addMusic( getHighestPriorityMusic( ), 15 ) ;
	gCardinalDiceCheat = true ;
	gOldLevel = getActiveLevel( ) ;
	stopCameraFollowCharacter( ) ;
	setActiveLevelMessage( "dicegame", 400, 300 ) ;
	activateScriptMessage( "runDiceGame" ) ;
	
	coroutine.yield( ) ;
	while ( gPlayingDice ) do
		coroutine.yield( ) ;
	end
	
	sayAndWait( "cardinalsguardinn3", getString( "cardinalsguardinn3_d3" ) ) ;
	
	gBetAmount = 10 ;
	gGameTempMusicID = addMusic( getHighestPriorityMusic( ), 15 ) ;
	gCardinalDiceCheat = true ;
	gOldLevel = getActiveLevel( ) ;
	stopCameraFollowCharacter( ) ;
	setActiveLevelMessage( "dicegame", 400, 300 ) ;
	activateScriptMessage( "runDiceGame" ) ;

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

	gCardinalDiceCheat = false ;

	placeCharacter( "dartagnan", "parisinnb", -59, 163 ) ;
	faceCharacter( "dartagnan", "cardinalsguardinn3" ) ;

	sayAndWait( "dartagnan", getString( "cardinalsguardinn3_d4" ) ) ;
	sayAndWait( "cardinalsguardinn3", getString( "cardinalsguardinn3_d5" ) ) ;
	
	activateMission( "missioncardguardgambling1" ) ;	
	
	unlockPlayerInPlace( ) ;
end

function chat_cardinalsguardinn3( name, chatWith )
	local bubInd = characterSay( name, true, -1, -1, false, getString( "cardinalsguardinn3_d1" ) ) ;
	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
		-- play
		activateScriptMessage( "cardinalsguardinn3play" ) ;
	else
		-- don't play
		sayAndWait( name, getString( "cardinalsguardinn3_d2" ) ) ;
	end
end

-- cardinalsguardinn4
function init_cardinalsguardinn4( name )
	setStatsCalculatorDynamic( name, -1, 1, 2, 100, 0.5 ) ;
	setHasPersistentStats( name, true ) ;
end

function place_cardinalsguardinn4A( name )
	placeCharacter( name, "parisinnb", -15, 71 ) ;
end

function place_cardinalsguardinn4B( name )
	placeDead( name ) ;
end

function dress_cardinalsguardinn4( name )
	randomDressCardinalsGuard( name, 0.0, 838317 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardinn4( name )
	while ( true ) do
		if ( not isMissionActive( "missioncardguardgambling1" ) ) then
			local destX = -14 ;
			local destY = 72 ;
			addGoalGetToPointInLevel( name, destX, destY, "parisinnb", false ) ;
			setBaseFaceDirection( name, -1, 0 ) ;
			waitForNoGoal( name ) ;
			wait( 3 ) ;
	
			local destX = -46 ;
			local destY = 99 ;
			addGoalGetToPointInLevel( name, destX, destY, "parisinnb", false ) ;
			setBaseFaceDirection( name, -1, -1 ) ;
			waitForNoGoal( name ) ;
			wait( 3 ) ;
		end
		
		coroutine.yield( ) ;
	end
end

function chat_cardinalsguardinn4( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguardinn5
function init_cardinalsguardinn5( name )
	setStatsCalculatorDynamic( name, -1, 1, 2, 100, 0.5 ) ;
	setHasPersistentStats( name, true ) ;
end

function place_cardinalsguardinn5A( name )
	placeCharacter( name, "parisinnb", 216, 241 ) ;
end

function place_cardinalsguardinn5B( name )
	placeDead( name ) ;
end

function dress_cardinalsguardinn5( name )
	randomDressCardinalsGuard( name, 0.0, 83976 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardinn5( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_cardinalsguardinn5( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguardinn6
function init_cardinalsguardinn6( name )
	setStatsCalculatorDynamic( name, -1, 1, 2, 100, 0.5 ) ;
	setHasPersistentStats( name, true ) ;
end

function place_cardinalsguardinn6A( name )
	placeCharacter( name, "parisinnb", 149, 231 ) ;
end

function place_cardinalsguardinn6B( name )
	placeDead( name ) ;
end

function dress_cardinalsguardinn6( name )
	randomDressCardinalsGuard( name, 0.0, 333976 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardinn6( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_cardinalsguardinn6( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguardinn7
function init_cardinalsguardinn7( name )
	setStatsCalculatorDynamic( name, -1, 1, 2, 100, 0.5 ) ;
	setHasPersistentStats( name, true ) ;
end

function place_cardinalsguardinn7A( name )
	placeCharacter( name, "parisinnb", -87, -13 ) ;
end

function place_cardinalsguardinn7B( name )
	placeDead( name ) ;
end

function dress_cardinalsguardinn7( name )
	randomDressCardinalsGuard( name, 0.0, 3111 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardinn7( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_cardinalsguardinn7( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguardpalace1
function init_cardinalsguardpalace1( name )
end

function place_cardinalsguardpalace1( name )
	placeCharacter( name, "cardinalhouse", 458, 115 ) ;
end

function dress_cardinalsguardpalace1( name )
	randomDressCardinalsGuard( name, 0.0, 31633 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace1( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_cardinalsguardpalace1( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguardpalace2
function init_cardinalsguardpalace2( name )
end

function place_cardinalsguardpalace2( name )
	placeCharacter( name, "cardinalhouse", 511, -324 ) ;
end

function dress_cardinalsguardpalace2( name )
	randomDressCardinalsGuard( name, 0.0, 476133 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace2( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_cardinalsguardpalace2( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguardpalace3
function init_cardinalsguardpalace3( name )
end

function place_cardinalsguardpalace3( name )
	placeCharacter( name, "cardinalhouse", 551, -324 ) ;
end

function dress_cardinalsguardpalace3( name )
	randomDressCardinalsGuard( name, 0.0, 4763334 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace3( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_cardinalsguardpalace3( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguardpalace4
function init_cardinalsguardpalace4( name )
end

function place_cardinalsguardpalace4( name )
	placeCharacter( name, "cardinalhouse", -766, -279 ) ;
end

function dress_cardinalsguardpalace4( name )
	randomDressCardinalsGuard( name, 0.0, 47637 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace4( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_cardinalsguardpalace4( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguardpalace5
function init_cardinalsguardpalace5( name )
end

function place_cardinalsguardpalace5( name )
	placeCharacter( name, "cardinalhouse", -763, -441 ) ;
end

function dress_cardinalsguardpalace5( name )
	randomDressCardinalsGuard( name, 0.0, 476337 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace5( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_cardinalsguardpalace5( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguardpalace6
function init_cardinalsguardpalace6( name )
end

function place_cardinalsguardpalace6( name )
	placeCharacter( name, "cardinalhouse", -762, -620 ) ;
end

function dress_cardinalsguardpalace6( name )
	randomDressCardinalsGuard( name, 0.0, 13466 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace6( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_cardinalsguardpalace6( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguardpalace7
function init_cardinalsguardpalace7( name )
end

function place_cardinalsguardpalace7( name )
	placeCharacter( name, "cardinalhouse", -475, -439 ) ;
end

function dress_cardinalsguardpalace7( name )
	randomDressCardinalsGuard( name, 0.0, 93466 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace7( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_cardinalsguardpalace7( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguardpalace8
function init_cardinalsguardpalace8( name )
end

function place_cardinalsguardpalace8( name )
	placeCharacter( name, "cardinalhouse", -478, -626 ) ;
end

function dress_cardinalsguardpalace8( name )
	randomDressCardinalsGuard( name, 0.0, 93466 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace8( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_cardinalsguardpalace8( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguardpalace9
function init_cardinalsguardpalace9( name )
end

function place_cardinalsguardpalace9( name )
	placeCharacter( name, "cardinalhouse", -662, -931 ) ;
end

function dress_cardinalsguardpalace9( name )
	randomDressCardinalsGuard( name, 0.0, 1366678 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace9( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_cardinalsguardpalace9( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguardpalace10
function init_cardinalsguardpalace10( name )
end

function place_cardinalsguardpalace10( name )
	placeCharacter( name, "cardinalhouse2", -759, -769 ) ;
end

function dress_cardinalsguardpalace10( name )
	randomDressCardinalsGuard( name, 0.0, 97678 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace10( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_cardinalsguardpalace10( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguardpalace11
function init_cardinalsguardpalace11( name )
end

function place_cardinalsguardpalace11( name )
	placeCharacter( name, "cardinalhouse2", -478, -785 ) ;
end

function dress_cardinalsguardpalace11( name )
	randomDressCardinalsGuard( name, 0.0, 9713678 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace11( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_cardinalsguardpalace11( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguardpalace12
function init_cardinalsguardpalace12( name )
end

function place_cardinalsguardpalace12( name )
	placeCharacter( name, "cardinalhouse2", -761, -214 ) ;
end

function dress_cardinalsguardpalace12( name )
	randomDressCardinalsGuard( name, 0.0, 971378 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace12( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_cardinalsguardpalace12( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardinalsguardpalace13
function init_cardinalsguardpalace13( name )
end

function place_cardinalsguardpalace13( name )
	placeCharacter( name, "cardinalhouse2", -480, -214 ) ;
end

function dress_cardinalsguardpalace13( name )
	randomDressCardinalsGuard( name, 0.0, 33678 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace13( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_cardinalsguardpalace13( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- cardinalsguardpalace14
function init_cardinalsguardpalace14( name )
end

function place_cardinalsguardpalace14( name )
	placeCharacter( name, "cardinalhouse2", 242, -116 ) ;
end

function dress_cardinalsguardpalace14( name )
	randomDressCardinalsGuard( name, 0.0, 7668 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace14( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_cardinalsguardpalace14( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- cardinalsguardpalace15
function init_cardinalsguardpalace15( name )
end

function place_cardinalsguardpalace15( name )
	placeCharacter( name, "cardinalhouse2", 310, 35 ) ;
end

function dress_cardinalsguardpalace15( name )
	randomDressCardinalsGuard( name, 0.0, 627668 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cardinalsguardpalace15( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_cardinalsguardpalace15( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- cardservantlady1
function init_cardservantlady1( name )
	setWoman( name, true ) ;
end

function place_cardservantlady1( name )
	placeCharacter( name, "cardinalhouse3", 469, -857 ) ;
end

function dress_cardservantlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "150c03" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "a47d50" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "a47d50" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "a47d50" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e0d46b" ) ;
	addCharacterPiece( name, "w_hat_cap" ) ;
end

function runAI_cardservantlady1( name )
	while ( true ) do
		local destX = 439 ;
		local destY = -827 ;
		addGoalGetToPointInLevel( name, destX, destY, "cardinalhouse3", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 442 ;
		local destY = -932 ;
		addGoalGetToPointInLevel( name, destX, destY, "cardinalhouse3", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_cardservantlady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "cardservantlady1_d1" ) ) ;
	sayAndWait( name, getString( "cardservantlady1_d1" ) ) ;
end

-- cardservantlady2
function init_cardservantlady2( name )
	setWoman( name, true ) ;
end

function place_cardservantlady2( name )
	placeCharacter( name, "cardinalhouse3", 584, -667 ) ;
end

function dress_cardservantlady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_curly", "8d5620" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "e0d46b" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "e0d46b" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "e0d46b" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "ba151d" ) ;
end

function runAI_cardservantlady2( name )
	while ( true ) do
		local destX = 584 ;
		local destY = -667 ;
		addGoalGetToPointInLevel( name, destX, destY, "cardinalhouse3", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 584 ;
		local destY = -630 ;
		addGoalGetToPointInLevel( name, destX, destY, "cardinalhouse3", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_cardservantlady2( name, chatWith )
	genericGreeting( name, chatWith, 0.83 ) ;
end

-- cardservantlady3
function init_cardservantlady3( name )
	setWoman( name, true ) ;
end

function place_cardservantlady3( name )
	placeCharacter( name, "cardinalhouse3", 375, -651 ) ;
end

function dress_cardservantlady3( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "f5f3df" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_plain", "f9f4a7" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "ba151d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "ba151d" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "ba151d" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a47d50" ) ;
end

function runAI_cardservantlady3( name )
	while ( true ) do
		local destX = 362 ;
		local destY = -648 ;
		addGoalGetToPointInLevel( name, destX, destY, "cardinalhouse3", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 401 ;
		local destY = -634 ;
		addGoalGetToPointInLevel( name, destX, destY, "cardinalhouse3", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 354 ;
		local destY = -936 ;
		addGoalGetToPointInLevel( name, destX, destY, "cardinalhouse3", false ) ;
		setBaseFaceDirection( name, -1, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_cardservantlady3( name, chatWith )
	genericGreeting( name, chatWith, 0.95 ) ;
end

-- cardservantlady4
function init_cardservantlady4( name )
	setWoman( name, true ) ;
end

function place_cardservantlady4( name )
	placeCharacter( name, "cardinalhouse2", -238, -873 ) ;
end

function dress_cardservantlady4( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_short", "d3c983" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "e0d46b" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "e0d46b" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "e0d46b" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a47d50" ) ;
end

function runAI_cardservantlady4( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_cardservantlady4( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "cardservantlady4_d1" ) ) ;
	sayAndWait( name, getString( "cardservantlady4_d1" ) ) ;
end

-- cardservantman1
function init_cardservantman1( name )
end

function place_cardservantman1( name )
	placeCharacter( name, "cardinalhouse2", -1, -963 ) ;
end

function dress_cardservantman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "boot_sock_right"  ) ;
	addCharacterPiece( name, "boot_sock_left" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_medium", "767676" ) ;
	addCharacterPiece( name, "pant_baggy_right", "e0d46b" ) ;
	addCharacterPiece( name, "pant_baggy_left", "e0d46b" ) ;	
	addCharacterPiece( name, "shirt_fancy_torso", "a47d50" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "a47d50" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "a47d50" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
end

function runAI_cardservantman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_cardservantman1( name, chatWith )
	genericGreeting( name, chatWith, 0.93 ) ;
end

-- cardservantman2
function init_cardservantman2( name )
end

function place_cardservantman2( name )
	placeCharacter( name, "cardinalhouse2", 32, -767 ) ;
end

function dress_cardservantman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt", "a47d50" ) ;
	addCharacterPiece( name, "boot_sock_right"  ) ;
	addCharacterPiece( name, "boot_sock_left" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left","e0d46b" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "e0d46b" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "e0d46b" ) ;
	addCharacterPiece( name, "hair_curly", "876b3e" ) ;
	addCharacterPiece( name, "mustache_a", "876b3e" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "ba151d" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "ba151d" ) ;
end

function runAI_cardservantman2( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_cardservantman2( name, chatWith )
	fameGreeting( name, chatWith ) ;
end

-- stleulady1
function init_stleulady1( name )
	setWoman( name, true ) ;
end

function place_stleulady1( name )
	sitCharacter( name, "stleupew2" ) ;
end

function dress_stleulady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "b4e080" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "b4e080" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "b4e080" ) ;
	addCharacterPiece( name, "w_hair_plain", "8b7948" ) ;
	addCharacterPiece( name, "w_stripe_torso", "c2dd88" ) ;
	addCharacterPiece( name, "w_stripe_legs", "c2dd88" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "e4db91" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "e4db91" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "e4db91" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e4db91" ) ;
end

function runAI_stleulady1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_stleulady1( name, chatWith )
	genericGreeting( name, chatWith, 0.89 ) ;
end

-- stleulady2
function init_stleulady2( name )
	setWoman( name, true ) ;
end

function place_stleulady2( name )
	placeCharacter( name, "stleuhouse", -343, 27 ) ;
end

function dress_stleulady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "191817" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "191817" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "191817" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "191817" ) ;
	addCharacterPiece( name, "w_hat_holy", "191817" ) ;
end

function runAI_stleulady2( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_stleulady2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "nun_d1" ) ) ;
	sayAndWait( name, getString( "nun_d1" ) ) ;
end

-- stleupriest1
function init_stleupriest1( name )
end

function place_stleupriest1( name )
	placeCharacter( name, "stleuhouse", -316, -38 ) ;
end

function dress_stleupriest1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "cloak_holy", "191817" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "hair_short", "d4c064") ;
	addCharacterPiece( name, "pant_monk_legs", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "191817" ) ;
	addCharacterPiece( name, "hat_holy", "191817" ) ;
end

function runAI_stleupriest1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_stleupriest1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "priest_d1" ) ) ;
	sayAndWait( name, getString( "priest_d1" ) ) ;
end

-- stleupriest2
function init_stleupriest2( name )
end

function place_stleupriest2( name )
	placeCharacter( name, "stleuhouse", 238, 210 ) ;
end

function dress_stleupriest2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "cloak_holy", "191817" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "pant_monk_legs", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "191817" ) ;
end

function runAI_stleupriest2( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_stleupriest2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "priest_d4" ) ) ;
	sayAndWait( name, getString( "priest_d4" ) ) ;
end

-- parisrestaman1
function init_parisrestaman1( name )
end

function place_parisrestaman1( name )
	sitCharacter( name, "parisrestachair1" ) ;
end

function dress_parisrestaman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "787268" ) ;	
	addCharacterPiece( name, "belt", "615035" ) ;
	addCharacterPiece( name, "sashbelt", "d3bf39" ) ;
	addCharacterPiece( name, "boot_fancy_right", "615035" ) ;
	addCharacterPiece( name, "boot_fancy_left", "615035" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "6e4a26" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "6e4a26" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "6e4a26" ) ;
	addCharacterPiece( name, "hair_curly", "787268" ) ;
	addCharacterPiece( name, "mustache_a", "787268" ) ;
	addCharacterPiece( name, "pant_baggy_right", "c23421" ) ;
	addCharacterPiece( name, "pant_baggy_left", "c23421" ) ;
	
end

function runAI_parisrestaman1( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parisrestaman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "goodfood1" ) ) ;
	sayAndWait( name, getString( "goodfood1" ) ) ;
end

-- parisrestalady1
function init_parisrestalady1( name )
	setWoman( name, true ) ;
end

function place_parisrestalady1( name )
	sitCharacter( name, "parisrestachair2" ) ;
end

function dress_parisrestalady1( name )
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "e4254d" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "e4254d" ) ;
	addCharacterPiece( name, "w_hair_curly", "b19465" ) ;
	addCharacterPiece( name, "w_stripe_torso", "edb5c1" ) ;
	addCharacterPiece( name, "w_stripe_legs", "edb5c1" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "edb5c1" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "edb5c1" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "f0eccf" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "f0eccf" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "f0eccf" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "f0eccf" ) ;
end

function runAI_parisrestalady1( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_parisrestalady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "goodfood2" ) ) ;
	sayAndWait( name, getString( "goodfood2" ) ) ;
end

-- parisrestaman2
function init_parisrestaman2( name )
end

function place_parisrestaman2( name )
	sitCharacter( name, "parisrestachair5" ) ;
end

function dress_parisrestaman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_c", "c3b754" ) ;	
	addCharacterPiece( name, "belt", "e9c845" ) ;
	addCharacterPiece( name, "boot_sock_right"  ) ;
	addCharacterPiece( name, "boot_sock_left" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "hair_long", "c3b754" ) ;
	addCharacterPiece( name, "mustache_b", "c3b754" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "223985" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "223985" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "abb0c0" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "abb0c0" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "abb0c0" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "223985" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "223985" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "223985" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "abb0c0" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "abb0c0" ) ;
end

function runAI_parisrestaman2( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parisrestaman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "goodfood1" ) ) ;
	sayAndWait( name, getString( "goodfood1" ) ) ;
end

-- parisrestalady2
function init_parisrestalady2( name )
	setWoman( name, true ) ;
end

function place_parisrestalady2( name )
	sitCharacter( name, "parisrestachair6" ) ;
end

function dress_parisrestalady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "6a2e54" ) ;
	addCharacterPiece( name, "w_hair_plain", "2f2216" ) ;
	addCharacterPiece( name, "w_stripe_torso", "6a2e54" ) ;
	addCharacterPiece( name, "w_stripe_legs", "6a2e54" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "e3d772" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "e3d772" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "e3d772" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e3d772" ) ;

end

function runAI_parisrestalady2( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_parisrestalady2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "goodfood2" ) ) ;
	sayAndWait( name, getString( "goodfood2" ) ) ;
end

-- parisrestacook
function init_parisrestacook( name )
end

function place_parisrestacook( name )
	placeCharacter( name, "parisrestauranta", -209, -100 ) ;
end

function dress_parisrestacook( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "belt", "a18863" ) ;
	addCharacterPiece( name, "boot_sock_right", "efe7dc" ) ;
	addCharacterPiece( name, "boot_sock_left", "efe7dc" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "hair_short", "795625" ) ;
	addCharacterPiece( name, "mustache_a", "795625" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "8b8276" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "8b8276" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e1dac8" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e1dac8" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "e1dac8" ) ;	
	
end


function runAI_parisrestacook( name )
	while ( true ) do
		local destX = -218 ;
		local destY = -136 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisrestauranta", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = -237 ;
		local destY = -97 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisrestauranta", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = -212 ;
		local destY = 64 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisrestauranta", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parisrestacook( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parisrestacook_d1" ) ) ;
	sayAndWait( name, getString( "parisrestacook_d1" ) ) ;
end

-- parisrestaservantlady1
function init_parisrestaservantlady1( name )
	setWoman( name, true ) ;
end

function place_parisrestaservantlady1( name )
	placeCharacter( name, "parisrestauranta", 2, -92 ) ;
end

function dress_parisrestaservantlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "f1efdd" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "e9e184" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "8ea8d8" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "8ea8d8" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "8ea8d8" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8e8e8e" ) ;
end

function runAI_parisrestaservantlady1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisrestaservantlady1( name, chatWith )
	local items = { 
		"ointment", 
		"hat_plain_best_1",
		"boot_sock_best_1",
		"boot_fancy_best_1",
		"sashbelt_best_1" } ;
	
	chat_vendorCustom( name, chatWith, items, getString( "parisrestaservantlady1_d1" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

-- parisinnbman
function init_parisinnbman( name )
end

function place_parisinnbman( name )
	placeCharacter( name, "parisinnb", 84, -48 ) ;
end

function dress_parisinnbman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "boot_sock_right", "d8c4b5" ) ;
	addCharacterPiece( name, "boot_sock_left", "d8c4b5" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "hair_curly", "6c4f22" ) ;
	addCharacterPiece( name, "mustache_a", "6c4f22" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "5e281d" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "5e281d" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "b93928" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d8c4b5" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d8c4b5" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "b93928" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "b93928" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "b93928" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "b93928" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;

end

function runAI_parisinnbman( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisinnbman( name, chatWith )
	if ( isMissionComplete( "missioncardguardgambling1" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "parisinnbman_d2" ) ) ;
		sayAndWait( name, getString( "parisinnbman_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "parisinnbman_d1" ) ) ;
		sayAndWait( name, getString( "parisinnbman_d1" ) ) ;
	end
end

-- parisinnblady
function init_parisinnblady( name )
	setWoman( name, true ) ;
end

function place_parisinnblady( name )
	placeCharacter( name, "parisinnb2", 125, -45 ) ;
end

function dress_parisinnblady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "w_bow_torso", "c4bb90" ) ;
	addCharacterPiece( name, "w_hair_curly", "ab9069" ) ;
	addCharacterPiece( name, "w_stripe_torso", "b93928" ) ;
	addCharacterPiece( name, "w_stripe_legs", "b93928" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "cab760" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "cab760" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "cab760" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "cab760" ) ;
end

function runAI_parisinnblady( name )
	setBaseFaceDirection( name, -1, -1 ) ;
end

function chat_parisinnblady( name, chatWith )
	if ( isMissionComplete( "missioncardguardgambling1" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "parisinnblady_d2" ) ) ;
		sayAndWait( name, getString( "parisinnblady_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "parisinnblady_d1" ) ) ;
		sayAndWait( name, getString( "parisinnblady_d1" ) ) ;
	end
end

-- aramishouselady
function init_aramishouselady( name )
	setWoman( name, true ) ;
end

function place_aramishouselady( name )
	placeCharacter( name, "aramishouse2", -100, -168 ) ;
end

function dress_aramishouselady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "8d7eb1" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "8d7eb1" ) ;
	addCharacterPiece( name, "w_hair_plain", "dfc275" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "cab880" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "cab880" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "cab880" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8d7eb1" ) ;

	end

function runAI_aramishouselady( name )
	while ( true ) do
		local destX = -100 ;
		local destY = -172 ;
		addGoalGetToPointInLevel( name, destX, destY, "aramishouse2", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( 5 ) ;

		local destX = -3 ;
		local destY = -178 ;
		addGoalGetToPointInLevel( name, destX, destY, "aramishouse2", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( 5 ) ;
	end
end

function chat_aramishouselady( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "aramishouselady_d1" ) ) ;
	sayAndWait( name, getString( "aramishouselady_d1" ) ) ;
end

-- parishouseiman
function init_parishouseiman( name )
end

function place_parishouseiman( name )
	placeCharacter( name, "parishousei", -152, -52 ) ;
end

function dress_parishouseiman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b","a19c8e" ) ;
	addCharacterPiece( name, "boot_plain_right","704d33"  ) ;
	addCharacterPiece( name, "boot_plain_left", "704d33" ) ;
	addCharacterPiece( name, "collar_plain") ;
	addCharacterPiece( name, "doublet_plain_arm_left","ac8d75" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "ac8d75" ) ;
	addCharacterPiece( name, "hair_long", "a19c8e" ) ;
	addCharacterPiece( name, "mustache_b", "a19c8e" ) ;
	addCharacterPiece( name, "pant_baggy_right", "3c4b1b" ) ;
	addCharacterPiece( name, "pant_baggy_left", "3c4b1b" ) ;	
	addCharacterPiece( name, "shirt_plain_torso", "ac8d75" ) ;

	end

function runAI_parishouseiman( name )
	setBaseFaceCharacter( name, "parishouseilady" ) ;
end

function chat_parishouseiman( name, chatWith )
	--autoDeleteChat( name, chatWith, getString( "parishouseiman_d1" ) ) ;
	sayAndWait( name, getString( "parishouseiman_d1" ) ) ;
end

-- parishouseilady
function init_parishouseilady( name )
	setWoman( name, true ) ;
end

function place_parishouseilady( name )
	placeCharacter( name, "parishousei", -214, -59 ) ;
end

function dress_parishouseilady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "d6caa6" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_short", "8f866f" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "cbd9ea" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "cbd9ea" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "cbd9ea" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a18c4b" ) ;


end

function runAI_parishouseilady( name )
	while ( true ) do
		local destX = -219 ;
		local destY = -91 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishousei", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( 5 ) ;

		local destX = -236 ;
		local destY = -52 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishousei", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( 5 ) ;
	end
end

function chat_parishouseilady( name, chatWith )
	--autoDeleteChat( name, chatWith, getString( "parishouseilady_d1" ) ) ;
	sayAndWait( name, getString( "parishouseilady_d1" ) ) ;
end

-- parishouseglady1
function init_parishouseglady1( name )
	setWoman( name, true ) ;
end

function place_parishouseglady1( name )
	placeCharacter( name, "parishouseg", -112, 20 ) ;
end

function dress_parishouseglady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "ebe4c7" ) ;
	addCharacterPiece( name, "w_collar_plain", "ebe4c7" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "625f55" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "9ac595" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "9ac595" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "9ac595" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "878787" ) ;

end

function runAI_parishouseglady1( name )
	while ( true ) do
		local destX = -112 ;
		local destY = 20 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishouseg", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 4, 6 ) ) ;

		local destX = -149 ;
		local destY = -91 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishouseg", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 3, 5 ) ) ;
	end
end

function chat_parishouseglady1( name, chatWith )
	genericGreeting( name, chatWith, 0.52 ) ;
end

-- parishouseglady2
function init_parishouseglady2( name )
	setWoman( name, true ) ;
end

function place_parishouseglady2( name )
	placeCharacter( name, "parishouseg", -114, 150 ) ;
end

function dress_parishouseglady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "dcd583" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "dc975b" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "dc975b" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "dc975b" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "615142" ) ;
	addCharacterPiece( name, "w_hat_cap" ) ;

end

function runAI_parishouseglady2( name )
	while ( true ) do
		local destX = -114 ;
		local destY = 150 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishouseg", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 4, 6 ) ) ;

		local destX = -77 ;
		local destY = -94 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishouseg", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 3, 5 ) ) ;
	end
end

function chat_parishouseglady2( name, chatWith )
	genericGreeting( name, chatWith, 0.85 ) ;
end

-- parishouseglady3
function init_parishouseglady3( name )
	setWoman( name, true ) ;
end

function place_parishouseglady3( name )
	placeCharacter( name, "parishouseg", -7, 146 ) ;
end

function dress_parishouseglady3( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_plain", "af8b45" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "b6c4d3" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "b6c4d3" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "b6c4d3" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "886354" ) ;
end

function runAI_parishouseglady3( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_parishouseglady3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parishouseglady_d1" ) ) ;
	sayAndWait( name, getString( "parishouseglady_d1" ) ) ;
end

-- parishousegman
function init_parishousegman( name )
end

function place_parishousegman( name )
	sitCharacter( name, "parishousegchair1" ) ;
end

function dress_parishousegman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "615430" ) ;
	addCharacterPiece( name, "belt", "615430" ) ;
	addCharacterPiece( name, "boot_sock_right", "cec8b7" ) ;
	addCharacterPiece( name, "boot_sock_left", "cec8b7" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "75876f" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "75876f" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "75876f" ) ;
	addCharacterPiece( name, "pant_baggy_right", "9c9c9c" ) ;
	addCharacterPiece( name, "pant_baggy_left", "9c9c9c" ) ;	
	addCharacterPiece( name, "stripe_plain_leg_right", "cabb74" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "cabb74" ) ;
	
end

function runAI_parishousegman( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_parishousegman( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parishousegman_d1" ) ) ;
	sayAndWait( name, getString( "parishousegman_d1" ) ) ;
end

-- parishousefman
function init_parishousefman( name )
end

function place_parishousefman( name )
	placeCharacter( name, "parishousef", -66, 151 ) ;
end

function dress_parishousefman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "cloak_holy", "a48b60" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "hair_short", "4d3e18") ;
	addCharacterPiece( name, "pant_monk_legs", "a48b60" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "a48b60" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "a48b60" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "a48b60" ) ;
	
	end

function runAI_parishousefman( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_parishousefman( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "priest_d1" ) ) ;
	sayAndWait( name, getString( "priest_d1" ) ) ;
end

-- parishouseeman
function init_parishouseeman( name )
end

function place_parishouseeman( name )
	placeCharacter( name, "parishousee", -16, -67 ) ;
end

function dress_parishouseeman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "bfb788" ) ;
	addCharacterPiece( name, "sashbelt", "e6d64e" ) ;
	addCharacterPiece( name, "boot_sock_right", "dfdbb5" ) ;
	addCharacterPiece( name, "boot_sock_left", "dfdbb5" ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "hair_long", "bfb788" ) ;
	addCharacterPiece( name, "mustache_b", "bfb788" ) ;
	addCharacterPiece( name, "pant_baggy_right", "d2ac36" ) ;
	addCharacterPiece( name, "pant_baggy_left", "d2ac36" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "ecd17e" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "ecd17e" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "ecd17e" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "dfdbb5" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "dfdbb5" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "dfdbb5" ) ;
end

function runAI_parishouseeman( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_parishouseeman( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parishouseeman_d1" ) ) ;
	sayAndWait( name, getString( "parishouseeman_d1" ) ) ;
end

-- parishousedman
function init_parishousedman( name )
end

function place_parishousedman( name )
	placeCharacter( name, "parishoused2", -110, 219 ) ;
end

function dress_parishousedman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a", "2c231b" ) ;
	addCharacterPiece( name, "boot_fancy_right", "7d5e3f"  ) ;
	addCharacterPiece( name, "boot_fancy_left", "7d5e3f" ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "hair_curly", "2c231b" ) ;
	addCharacterPiece( name, "mustache_b", "2c231b" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "782a40" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "782a40" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "b8b8b8" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "b8b8b8" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "b8b8b8" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "782a40" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "782a40" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "782a40" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "b0becc" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "b0becc" ) ;
	
	end

function runAI_parishousedman( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_parishousedman( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parishousedman_d1" ) ) ;
	sayAndWait( name, getString( "parishousedman_d1" ) ) ;
end

-- parishousedlady1
function init_parishousedlady1( name )
	setWoman( name, true ) ;
end

function place_parishousedlady1( name )
	placeCharacter( name, "parishoused2", -80, 219 ) ;
end

function dress_parishousedlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_hair_plain", "e0b053" ) ;
	addCharacterPiece( name, "w_stripe_legs", "b0becc" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "b0becc" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "b0becc" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "f3add0" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "f3add0" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "f3add0" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "f3add0" ) ;

end

function runAI_parishousedlady1( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parishousedlady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "sacrebleu" ) ) ;
	sayAndWait( name, getString( "sacrebleu" ) ) ;
end

-- parishousedlady2
function init_parishousedlady2( name )
	setWoman( name, true ) ;
end

function place_parishousedlady2( name )
	placeCharacter( name, "parishoused", -143, 79 ) ;
end

function dress_parishousedlady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "f3d5e4" ) ;
	addCharacterPiece( name, "w_collar_plain", "f3d5e4" ) ;
	addCharacterPiece( name, "w_hair_short", "c2ac81" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "92647c" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "92647c" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "92647c" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "665a42" ) ;
	
end

function runAI_parishousedlady2( name )
	while ( true ) do
		local destX = -132 ;
		local destY = 92 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishoused", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = -132 ;
		local destY = -11 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishoused", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = -143 ;
		local destY = -53 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishoused", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parishousedlady2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parishousedlady2_d1" ) ) ;
	sayAndWait( name, getString( "parishousedlady2_d1" ) ) ;
end

-- pommedepinhouselady
function init_pommedepinhouselady( name )
	setWoman( name, true ) ;
end

function place_pommedepinhouselady( name )
	placeCharacter( name, "pommedepinhouse", -199, 51 ) ;
end

function dress_pommedepinhouselady( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_apron", "d6d2b9") ;
	addCharacterPiece( name, "w_dress_plain_torso", "9ca8db" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "9ca8db" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "9ca8db" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "aa8c5e" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "aa8c5e" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "aa8c5e" ) ;
	addCharacterPiece( name, "w_hair_curly", "322006" ) ;
end

function runAI_pommedepinhouselady( name )
	while ( true ) do
		local destX = -235 ;
		local destY = 102 ;
		addGoalGetToPointInLevel( name, destX, destY, "pommedepinhouse", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = -217 ;
		local destY = -13 ;
		addGoalGetToPointInLevel( name, destX, destY, "pommedepinhouse", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = -159 ;
		local destY = 176 ;
		addGoalGetToPointInLevel( name, destX, destY, "pommedepinhouse", false ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 1, 2 ) ) ;
	end
end

function chat_pommedepinhouselady( name, chatWith )
	local items = { 
		"ointment", 
		"hat_simple_poor_1",
		"hat_simple_ok_1",
		"hat_simple_best_1",
		"sashbelt_poor_1",
		"sashbelt_ok_1" } ;
	
	chat_vendorCustom( name, chatWith, items, getString( "pommedepinhouselady_d1" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

-- parishousehman
function init_parishousehman( name )
end

function place_parishousehman( name )
	placeCharacter( name, "parishouseh", 15, -44 ) ;
end

function dress_parishousehman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c" ) ;	
	addCharacterPiece( name, "belt", "c4ae91" ) ;
	addCharacterPiece( name, "boot_sock_right", "c4ae91" ) ;
	addCharacterPiece( name, "boot_sock_left", "c4ae91" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "b6ad60" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "b6ad60" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "b6ad60" ) ;
	addCharacterPiece( name, "hair_short", "80633d" ) ;
	addCharacterPiece( name, "mustache_b", "80633d" ) ;
	addCharacterPiece( name, "mustache_b", "80633d" ) ;
	addCharacterPiece( name, "mustache_b", "80633d" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "57543c" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "57543c" ) ;
	
end

function runAI_parishousehman( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_parishousehman( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parishousehman_d1" ) ) ;
	sayAndWait( name, getString( "parishousehman_d1" ) ) ;
end

-- athoshouseman
function init_athoshouseman( name )
end

function place_athoshouseman( name )
	sitCharacter( name, "athoshousebench1" ) ;
end

function dress_athoshouseman( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt", "453529" ) ;
	addCharacterPiece( name, "boot_sock_right", "e5e2c6" ) ;
	addCharacterPiece( name, "boot_sock_left", "e5e2c6" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_curly", "977256" ) ;
	addCharacterPiece( name, "mustache_a", "977256" ) ;
	addCharacterPiece( name, "pant_baggy_right", "28256e" ) ;
	addCharacterPiece( name, "pant_baggy_left", "28256e" ) ;	
	addCharacterPiece( name, "shirt_fancy_torso", "c9a56d" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e5e2c6" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e5e2c6") ;
	addCharacterPiece( name, "shirt_plain_torso", "e5e2c6" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e5e2c6" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e5e2c6" ) ;
	
end

function runAI_athoshouseman( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_athoshouseman( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "athoshouseman_d1" ) ) ;
	sayAndWait( name, getString( "athoshouseman_d1" ) ) ;
end

-- athoshouselady
function init_athoshouselady( name )
	setWoman( name, true ) ;
end

function place_athoshouselady( name )
	placeCharacter( name, "athoshouse", 88, -115 ) ;
end

function dress_athoshouselady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "dddbc7" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_short", "ccba59" ) ;
	addCharacterPiece( name, "w_stripe_torso", "af7241" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "dcd7a2" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "dcd7a2" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "dcd7a2" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "af7241" ) ;

end

function runAI_athoshouselady( name )
	while ( true ) do
		local destX = 84 ;
		local destY = -129 ;
		addGoalGetToPointInLevel( name, destX, destY, "athoshouse", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 92 ;
		local destY = -72 ;
		addGoalGetToPointInLevel( name, destX, destY, "athoshouse", false ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_athoshouselady( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "athoshouselady_d1" ) ) ;
	sayAndWait( name, getString( "athoshouselady_d1" ) ) ;
end

-- parishousellady
function init_parishousellady( name )
	setWoman( name, true ) ;
end

function place_parishousellady( name )
	placeCharacter( name, "parishousel", -44, -88 ) ;
end

function dress_parishousellady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_hair_curly", "8d8986" ) ;
	addCharacterPiece( name, "w_stripe_torso", "eee093" ) ;
	addCharacterPiece( name, "w_stripe_legs", "eee093" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "ead562" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "ead562" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "9f9873" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "9f9873" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "9f9873" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "ead562" ) ;
end

function runAI_parishousellady( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_parishousellady( name, chatWith )
	genericGreeting( name, chatWith, 0.98 ) ;
end

-- parisrestbman1
function init_parisrestbman1( name )
end

function place_parisrestbman1( name )
	sitCharacter( name, "parisrestbchair1" ) ;
end

function dress_parisrestbman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "c5b35f" ) ;
	addCharacterPiece( name, "sashbelt", "8d6f43" ) ;
	addCharacterPiece( name, "boot_plain_right", "1c1b18" ) ;
	addCharacterPiece( name, "boot_plain_left", "1c1b18" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "glove_plain_right", "1c1b18" ) ;
	addCharacterPiece( name, "glove_plain_left", "1c1b18" ) ;
	addCharacterPiece( name, "hair_medium", "c5b35f" ) ;
	addCharacterPiece( name, "mustache_b", "c5b35f" ) ;
	addCharacterPiece( name, "pant_baggy_right", "81ac7a" ) ;
	addCharacterPiece( name, "pant_baggy_left", "81ac7a" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "828282" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "828282" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "828282" ) ;
	end

function runAI_parisrestbman1( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parisrestbman1( name, chatWith )
	genericGreeting( name, chatWith, 0.4 ) ;
end

-- parisrestbman2
function init_parisrestbman2( name )
end

function place_parisrestbman2( name )
	sitCharacter( name, "parisrestbchair2" ) ;
end

function dress_parisrestbman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "c0c0c0" ) ;
	addCharacterPiece( name, "belt", "987147" ) ;
	addCharacterPiece( name, "boot_fancy_right", "72593e" ) ;
	addCharacterPiece( name, "boot_fancy_left", "72593e" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "bd5332" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "3c241d" ) ;
	addCharacterPiece( name, "hat_plain", "85653b" ) ;
	addCharacterPiece( name, "hair_long", "c0c0c0" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "9b886f" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "9b886f" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "bd5332" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "bd5332" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left" ) ;
end

function runAI_parisrestbman2( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parisrestbman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parisrestbman2_d1" ) ) ;
	sayAndWait( name, getString( "parisrestbman2_d1" ) ) ;
end

-- parisrestbman3
function init_parisrestbman3( name )
end

function place_parisrestbman3( name )
	sitCharacter( name, "parisrestbchair3" ) ;
end

function dress_parisrestbman3( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beret", "91754c" ) ;
	addCharacterPiece( name, "boot_sock_right", "d6cbba" ) ;
	addCharacterPiece( name, "boot_sock_left", "d6cbba" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_curly", "d47f46" ) ;
	addCharacterPiece( name, "mustache_a", "d47f46" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "536387" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "536387" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "aead7e" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "aead7e" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "aead7e" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "5b4832" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "5b4832" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "5b4832" ) ;
	
	end

function runAI_parisrestbman3( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parisrestbman3( name, chatWith )
	fameGreeting( name, chatWith ) ;
end

-- parisrestblady1
function init_parisrestblady1( name )
	setWoman( name, true ) ;
end

function place_parisrestblady1( name )
	placeCharacter( name, "parisrestaurantb", -62, 140 ) ;
end

function dress_parisrestblady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "917148" ) ;
	addCharacterPiece( name, "w_stripe_torso", "8ca6c6" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "73a774" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "73a774" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "73a774" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8ca6c6" ) ;

end

function runAI_parisrestblady1( name )
	while ( true ) do
		local destX = -56 ;
		local destY = 114 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisrestaurantb", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 52 ;
		local destY = 80 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisrestaurantb", false ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
		
		local destX = 162 ;
		local destY = -6 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisrestaurantb", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 1, 3 ) ) ;
	end
end

function chat_parisrestblady1( name, chatWith )
	local items = { 
		"ointment", 
		"gloves_poor_1",
		"gloves_ok_1",
		"gloves_best_1" } ;
	
	chat_vendorCustom( name, chatWith, items, getString( "welcomehelp" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

-- parishouseklady1
function init_parishouseklady1( name )
	setWoman( name, true ) ;
end

function place_parishouseklady1( name )
	placeCharacter( name, "parishousek", -46, -26 ) ;
end

function dress_parishouseklady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "f0ebd5" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "f6b6ac" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "f6b6ac" ) ;
	addCharacterPiece( name, "w_hair_pinned", "e2ca59" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "ce7880" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "ce7880" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "ce7880" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "f6b6ac" ) ;
	addCharacterPiece( name, "w_hat_cap", "f0ebd5" ) ;
end

function runAI_parishouseklady1( name )
	while ( true ) do
		local destX = -79 ;
		local destY = 31 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishousek", false ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = -21 ;
		local destY = -89 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishousek", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
		
		local destX = 86 ;
		local destY = -93 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishousek", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
	end
end

function chat_parishouseklady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parishouseklady1_d1" ) ) ;
	sayAndWait( name, getString( "parishouseklady1_d1" ) ) ;
end

-- parishousekman1
function init_parishousekman1( name )
end

function place_parishousekman1( name )
	placeCharacter( name, "parishousek3", -21, 100 ) ;
end

function dress_parishousekman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "d0c588" ) ;
	addCharacterPiece( name, "belt", "7e6948" ) ;
	addCharacterPiece( name, "boot_plain_right", "a79a84" ) ;
	addCharacterPiece( name, "boot_plain_left", "a79a84" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "8dc4a4" ) ;
	addCharacterPiece( name, "hat_simple", "c4bf8d" ) ;
	addCharacterPiece( name, "hair_long", "d0c588" ) ;
	addCharacterPiece( name, "mustache_a", "d0c588" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "9a944b" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "9a944b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "8dc4a4" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "8dc4a4" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "e6cd59" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e6cd59" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e6cd59" ) ;
	
end

function runAI_parishousekman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parishousekman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- parishousejlady
function init_parishousejlady( name )
	setWoman( name, true ) ;
end

function place_parishousejlady( name )
	placeCharacter( name, "parishousej", -112, 13 ) ;
end

function dress_parishousejlady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "f3f1e4" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_curly", "a27a64" ) ;
	addCharacterPiece( name, "w_stripe_legs", "afa593" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "afa593" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "afa593" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "afa593" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "de6549" ) ;

end

function runAI_parishousejlady( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parishousejlady( name, chatWith )
	genericGreeting( name, chatWith, 0.22 ) ;
end

-- parisinnakeeperlady
function init_parisinnakeeperlady( name )
	setWoman( name, true ) ;
end

function place_parisinnakeeperlady( name )
	placeCharacter( name, "parisinna", -56, 53 ) ;
end

function dress_parisinnakeeperlady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "775a4a" ) ;
	addCharacterPiece( name, "w_stripe_torso", "977d4c" ) ;
	addCharacterPiece( name, "w_stripe_legs", "b4aaa4" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "b4aaa4" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "b4aaa4" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "b4aaa4" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "977d4c" ) ;
	addCharacterPiece( name, "w_hat_cap" ) ;

end


function runAI_parisinnakeeperlady( name )
	while ( true ) do
		local destX = -51 ;
		local destY = 33 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisinna", false ) ;
		setBaseFaceDirection( name, -1, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;

		local destX = -18 ;
		local destY = 134 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisinna", false ) ;
		setBaseFaceDirection( name, -1, 1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
		
		local destX = 61 ;
		local destY = 116 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisinna", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
		
		local destX = 138 ;
		local destY = 183 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisinna", false ) ;
		setBaseFaceDirection( name, 1, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
	end
end

function chat_parisinnakeeperlady( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "canihelp" ) ) ;
	sayAndWait( name, getString( "canihelp" ) ) ;
end

-- parisinnakeeperman
function init_parisinnakeeperman( name )
end

function place_parisinnakeeperman( name )
	placeCharacter( name, "parisinna", 63, 211 ) ;
end

function dress_parisinnakeeperman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "733913" ) ;
	addCharacterPiece( name, "belt", "7c6d4a" ) ;
	addCharacterPiece( name, "boot_fancy_right", "9c7b2b" ) ;
	addCharacterPiece( name, "boot_fancy_left", "9c7b2b" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "c6c55c" ) ;
	addCharacterPiece( name, "hair_short", "733913" ) ;
	addCharacterPiece( name, "mustache_a", "733913" ) ;
	addCharacterPiece( name, "pant_baggy_right", "7c3b27" ) ;
	addCharacterPiece( name, "pant_baggy_left", "7c3b27" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "cbbab5" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "cbbab5" ) ;
end

function runAI_parisinnakeeperman( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisinnakeeperman( name, chatWith )
	local items = { 
		"ointment", 
		"hat_simple_poor_1" } ;
	
	chat_vendorCustom( name, chatWith, items, getString( "welcomehelp" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

-- parisinnaman1
function init_parisinnaman1( name )
end

function place_parisinnaman1( name )
	sitCharacter( name, "parisinnabench2" ) ;
end

function dress_parisinnaman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beardmus", "5a5a5a" ) ;
	addCharacterPiece( name, "boot_plain_right", "9c715a" ) ;
	addCharacterPiece( name, "boot_plain_left", "9c715a" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "7e7eb9" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "7e7eb9" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "7e7eb9" ) ;
	addCharacterPiece( name, "feather_hat_small", "dac729" ) ;
	addCharacterPiece( name, "glove_plain_right", "997a5c" ) ;
	addCharacterPiece( name, "glove_plain_left", "997a5c" ) ;
	addCharacterPiece( name, "hat_simple", "997a5c" ) ;
	addCharacterPiece( name, "hair_long","5a5a5a" ) ;
	addCharacterPiece( name, "pant_baggy_right", "6c6156" ) ;
	addCharacterPiece( name, "pant_baggy_left", "6c6156" ) ;	
end

function runAI_parisinnaman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisinnaman1( name, chatWith )
	genericGreeting( name, chatWith, 0.6 ) ;
end

-- parisinnaman2
function init_parisinnaman2( name )
end

function place_parisinnaman2( name )
	sitCharacter( name, "parisinnabench3" ) ;
end

function dress_parisinnaman2( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "b5a25f" ) ;
	addCharacterPiece( name, "sashbelt", "83674b" ) ;
	addCharacterPiece( name, "boot_sock_right", "d8c9ba" ) ;
	addCharacterPiece( name, "boot_sock_left", "d8c9ba" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_curly", "b5a25f" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "729c5b" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "729c5b" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "cebcaa" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "cebcaa" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "cebcaa" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "729c5b" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "729c5b" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "729c5b" ) ;
end

function runAI_parisinnaman2( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisinnaman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parisinnaman2_d1" ) ) ;
	sayAndWait( name, getString( "parisinnaman2_d1" ) ) ;
end

-- parisinnalady1
function init_parisinnalady1( name )
	setWoman( name, true ) ;
end

function place_parisinnalady1( name )
	sitCharacter( name, "parisinnabench4" ) ;
end

function dress_parisinnalady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "72a5e4" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "72a5e4" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "72a5e4" ) ;
	addCharacterPiece( name, "w_hair_plain", "d2cc85" ) ;
	addCharacterPiece( name, "w_stripe_legs", "b0cbec" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "b0cbec" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "b0cbec" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "cbb8dc" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "cbb8dc" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "cbb8dc" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "cbb8dc" ) ;
end

function runAI_parisinnalady1( name )
	setBaseFaceDirection( name, -1, -1 ) ;
end

function chat_parisinnalady1( name, chatWith )
	genericGreeting( name, chatWith, 0.75 ) ;
end

-- parisinnaman3
function init_parisinnaman3( name )
end

function place_parisinnaman3( name )
	sitCharacter( name, "parisinnabench5" ) ;
end

function dress_parisinnaman3( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", "1c1107" ) ;
	addCharacterPiece( name, "beret", "c65739" ) ;
	addCharacterPiece( name, "boot_plain_right", "6a583e" ) ;
	addCharacterPiece( name, "boot_plain_left", "6a583e" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_short", "1c1107" ) ;
	addCharacterPiece( name, "mustache_b", "1c1107" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "aa9f8f" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "aa9f8f" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d1cbc7" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d1cbc7" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "d1cbc7" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "c16634" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "c16634" ) ;
end

function runAI_parisinnaman3( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisinnaman3( name, chatWith )
	fameGreeting( name, chatWith ) ;
end

-- parisinnaman4
function init_parisinnaman4( name )
end

function place_parisinnaman4( name )
	placeCharacter( name, "parisinna2", 0, -5 ) ;
end

function dress_parisinnaman4( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "sashbelt", "71502d" ) ;
	addCharacterPiece( name, "boot_plain_right", "71502d" ) ;
	addCharacterPiece( name, "boot_plain_left", "71502d" ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "hair_medium", "3f3429" ) ;
	addCharacterPiece( name, "mustache_b", "3f3429" ) ;
	addCharacterPiece( name, "pant_baggy_right", "633672" ) ;
	addCharacterPiece( name, "pant_baggy_left", "633672" ) ;	
	addCharacterPiece( name, "shirt_fancy_torso", "a18e81" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "a18e81" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "a18e81" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
	
	end

function runAI_parisinnaman4( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_parisinnaman4( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parisinnaman4_d1" ) ) ;
	sayAndWait( name, getString( "parisinnaman4_d1" ) ) ;
end

-- notredamelady1
function init_notredamelady1( name )
	setWoman( name, true ) ;
end

function place_notredamelady1( name )
	sitCharacter( name, "notredamebench1" ) ;
end

function dress_notredamelady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "f2ead6" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "b48f72" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "c4dab9" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "c4dab9" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "c4dab9" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a08460" ) ;
	addCharacterPiece( name, "w_hat_cap" ) ;

end

function runAI_notredamelady1( name )
	setBaseFaceDirection( name, -1, -1 ) ;
end

function chat_notredamelady1( name, chatWith )
	genericGreeting( name, chatWith, 0.62 ) ;
end

-- notredameman1
function init_notredameman1( name )
end

function place_notredameman1( name )
	sitCharacter( name, "notredamebench2" ) ;
end

function dress_notredameman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "dccc71" ) ;
	addCharacterPiece( name, "belt", "e9cd35" ) ;
	addCharacterPiece( name, "boot_fancy_right", "8a570f" ) ;
	addCharacterPiece( name, "boot_fancy_left", "8a570f" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "0f748a" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "0f748a" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "0f748a" ) ;
	addCharacterPiece( name, "glove_plain_right", "8a570f" ) ;
	addCharacterPiece( name, "glove_plain_left", "8a570f" ) ;
	addCharacterPiece( name, "hair_curly", "dccc71" ) ;
	addCharacterPiece( name, "mustache_a", "dccc71" ) ;
	addCharacterPiece( name, "pant_baggy_right", "716d64" ) ;
	addCharacterPiece( name, "pant_baggy_left", "716d64" ) ;	
	addCharacterPiece( name, "stripe_plain_torso", "f4e5c1" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "f4e5c1" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "f4e5c1" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "f4e5c1" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "f4e5c1" ) ;
	
end

function runAI_notredameman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_notredameman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "churchgoer_d1" ) ) ;
	sayAndWait( name, getString( "churchgoer_d1" ) ) ;
end

-- notredamelady2
function init_notredamelady2( name )
	setWoman( name, true ) ;
end

function place_notredamelady2( name )
	sitCharacter( name, "notredamebench3" ) ;
end

function dress_notredamelady2( name )
clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "c9a65c" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "c9a65c" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "c9a65c" ) ;
	addCharacterPiece( name, "w_hair_short", "332114" ) ;
	addCharacterPiece( name, "w_stripe_torso", "ebe4cf" ) ;
	addCharacterPiece( name, "w_stripe_legs", "ebe4cf" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "c9a65c" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "c9a65c" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "819770" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "819770" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "819770" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "819770" ) ;
end

function runAI_notredamelady2( name )
	setBaseFaceDirection( name, -1, -1 ) ;
end

function chat_notredamelady2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "churchgoer_d2" ) ) ;
	sayAndWait( name, getString( "churchgoer_d2" ) ) ;
end

-- notredameman2
function init_notredameman2( name )
end

function place_notredameman2( name )
	sitCharacter( name, "notredamebench4" ) ;
end

function dress_notredameman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "7a7a7a" ) ;
	addCharacterPiece( name, "belt", "83734c" ) ;
	addCharacterPiece( name, "boot_plain_right", "a27f5c" ) ;
	addCharacterPiece( name, "boot_plain_left", "a27f5c" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_short", "7a7a7a" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "534334" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "534334" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "aaa6a2" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "aaa6a2" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "aaa6a2" ) ;
	end

function runAI_notredameman2( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_notredameman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "churchgoer_d3" ) ) ;
	sayAndWait( name, getString( "churchgoer_d3" ) ) ;
end

-- notredamepriest1
function init_notredamepriest1( name )
end

function place_notredamepriest1( name )
	placeCharacter( name, "notredamehouse", 240, 184 ) ;
end

function dress_notredamepriest1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "bdbdbd" ) ;
	addCharacterPiece( name, "cloak_holy", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hat_holy", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "hair_short", "bdbdbd" ) ;
	addCharacterPiece( name, "pant_monk_legs", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "shirt_plain_torso", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "tabbard" ) ;
	end

function runAI_notredamepriest1( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_notredamepriest1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "priest_d3" ) ) ;
	sayAndWait( name, getString( "priest_d3" ) ) ;
end

-- notredamepriest2
function init_notredamepriest2( name )
end

function place_notredamepriest2( name )
	placeCharacter( name, "notredamehouse", -300, -30 ) ;
end

function dress_notredamepriest2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "726c67" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cloak_holy", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hat_holy", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "mustache_a", "726c67" ) ;	
	addCharacterPiece( name, "pant_monk_legs", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "shirt_plain_torso", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "tabbard" ) ;
	end

function runAI_notredamepriest2( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_notredamepriest2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "priest_d2" ) ) ;
	sayAndWait( name, getString( "priest_d2" ) ) ;
end

-- notredamepriest3
function init_notredamepriest3( name )
end

function place_notredamepriest3( name )
	placeCharacter( name, "notredamehouse", -706, 132 ) ;
end

function dress_notredamepriest3( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cloak_holy", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hat_holy", 0.73, 0.06, 0.06 ) ;
	addCharacterPiece( name, "hair_medium", "635a51" ) ;
	addCharacterPiece( name, "pant_monk_legs" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
	end

function runAI_notredamepriest3( name )
	while ( true ) do
		local destX = -797 ;
		local destY = -73 ;
		addGoalGetToPointInLevel( name, destX, destY, "notredamehouse", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;

		local destX = -495 ;
		local destY = 126 ;
		addGoalGetToPointInLevel( name, destX, destY, "notredamehouse", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
		
		local destX = -347 ;
		local destY = 286 ;
		addGoalGetToPointInLevel( name, destX, destY, "notredamehouse", false ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
		
		local destX = 84 ;
		local destY = 144 ;
		addGoalGetToPointInLevel( name, destX, destY, "notredamehouse", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
	end
end

function chat_notredamepriest3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "priest_d1" ) ) ;
	sayAndWait( name, getString( "priest_d1" ) ) ;
end

-- hoteldieuhouseman1
function init_hoteldieuhouseman1( name )
end

function place_hoteldieuhouseman1( name )
	placeCharacter( name, "hoteldieuhouse", 216, 284 ) ;
end

function dress_hoteldieuhouseman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_arm_left" ) ;
	addCharacterPiece( name, "nm_arm_right" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_leg_right" ) ;
	addCharacterPiece( name, "nm_leg_left" ) ;
	addCharacterPiece( name, "nm_torso" ) ;
	addCharacterPiece( name, "beard_c", "1a1714" ) ;
	addCharacterPiece( name, "hair_medium", "1a1714" ) ;
	addCharacterPiece( name, "mustache_a", "1a1714" ) ;	
	addCharacterPiece( name, "pant_musketeer_right", "705137" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "705137" ) ;
	end

function runAI_hoteldieuhouseman1( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_hoteldieuhouseman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "patient_d1" ) ) ;
	sayAndWait( name, getString( "patient_d1" ) ) ;
end

-- hoteldieuhouseman2
function init_hoteldieuhouseman2( name )
end

function place_hoteldieuhouseman2( name )
	placeCharacter( name, "hoteldieuhouse", 200, 199 ) ;
end

function dress_hoteldieuhouseman2( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "boot_plain_right", "76604d" ) ;
	addCharacterPiece( name, "boot_plain_left", "76604d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "b6b192" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "b6b192" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "b6b192" ) ;
	addCharacterPiece( name, "mustache_b", "e3d16b" ) ;
	addCharacterPiece( name, "pant_baggy_right", "959493" ) ;
	addCharacterPiece( name, "pant_baggy_left", "959493" ) ;	
	end

function runAI_hoteldieuhouseman2( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_hoteldieuhouseman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "patient_d1" ) ) ;
	sayAndWait( name, getString( "patient_d1" ) ) ;
end

-- hoteldieuhouseman3
function init_hoteldieuhouseman3( name )
end

function place_hoteldieuhouseman3( name )
	placeCharacter( name, "hoteldieuhouse", 44, 111 ) ;
end

function dress_hoteldieuhouseman3( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_leg_right" ) ;
	addCharacterPiece( name, "nm_leg_left" ) ;
	addCharacterPiece( name, "beardmus", "969390" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_long", "969390" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "f0e9e2" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "f0e9e2" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "f0e9e2" ) ;
	addCharacterPiece( name, "pant_baggy_right", "a76225" ) ;
	addCharacterPiece( name, "pant_baggy_left", "a76225" ) ;	
end


function runAI_hoteldieuhouseman3( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_hoteldieuhouseman3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "patient_d2" ) ) ;
	sayAndWait( name, getString( "patient_d2" ) ) ;
end

-- hoteldieuhouseman4
function init_hoteldieuhouseman4( name )
end

function place_hoteldieuhouseman4( name )
	placeCharacter( name, "hoteldieuhouse", -124, 199 ) ;
end

function dress_hoteldieuhouseman4( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_arm_left" ) ;
	addCharacterPiece( name, "nm_arm_right" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_leg_right" ) ;
	addCharacterPiece( name, "nm_leg_left" ) ;
	addCharacterPiece( name, "nm_torso" ) ;
	addCharacterPiece( name, "beard_b", "d06e17" ) ;
	addCharacterPiece( name, "boot_plain_right", "a28f69" ) ;
	addCharacterPiece( name, "boot_plain_left", "a28f69" ) ;
	addCharacterPiece( name, "hair_short", "d06e17" ) ;
	addCharacterPiece( name, "mustache_a", "d06e17" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "74b4e0" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "74b4e0" ) ;
	end

function runAI_hoteldieuhouseman4( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_hoteldieuhouseman4( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "patient_d1" ) ) ;
	sayAndWait( name, getString( "patient_d1" ) ) ;
end

-- hoteldieuhouseman5
function init_hoteldieuhouseman5( name )
end

function place_hoteldieuhouseman5( name )
	placeCharacter( name, "hoteldieuhouse2", -61, 71 ) ;
end

function dress_hoteldieuhouseman5( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_torso" ) ;
	addCharacterPiece( name, "beard_c", "82684c" ) ;
	addCharacterPiece( name, "boot_plain_right", "616161" ) ;
	addCharacterPiece( name, "boot_plain_left", "616161" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "5e353d" ) ;
	addCharacterPiece( name, "hair_long", "82684c" ) ;
	addCharacterPiece( name, "mustache_a", "82684c" ) ;	
	addCharacterPiece( name, "pant_musketeer_right", "627e4b" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "627e4b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e3efd9" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e3efd9" ) ;
	end

function runAI_hoteldieuhouseman5( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_hoteldieuhouseman5( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "patient_d1" ) ) ;
	sayAndWait( name, getString( "patient_d1" ) ) ;
end

-- hoteldieuhouseman6
function init_hoteldieuhouseman6( name )
end

function place_hoteldieuhouseman6( name )
	placeCharacter( name, "hoteldieuhouse2", -118, 322 ) ;
end

function dress_hoteldieuhouseman6( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_arm_left" ) ;
	addCharacterPiece( name, "nm_arm_right" ) ;
	addCharacterPiece( name, "nm_leg_right" ) ;
	addCharacterPiece( name, "nm_leg_left" ) ;
	addCharacterPiece( name, "nm_torso" ) ;
	addCharacterPiece( name, "beard_a", "847754" ) ;
	addCharacterPiece( name, "hair_curly", "847754" ) ;
	addCharacterPiece( name, "pant_baggy_right", "914698" ) ;
	addCharacterPiece( name, "pant_baggy_left", "914698" ) ;
	end

function runAI_hoteldieuhouseman6( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_hoteldieuhouseman6( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "patient_d3" ) ) ;
	sayAndWait( name, getString( "patient_d3" ) ) ;
end

-- hoteldieuhouselady1
function init_hoteldieuhouselady1( name )
	setWoman( name, true ) ;
end

function place_hoteldieuhouselady1( name )
	placeCharacter( name, "hoteldieuhouse", -193, 318 ) ;
end

function dress_hoteldieuhouselady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_curly", "c79d2c" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "9b9993" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "9b9993" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "9b9993" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6c523f" ) ;

end


function runAI_hoteldieuhouselady1( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_hoteldieuhouselady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "patient_d1" ) ) ;
	sayAndWait( name, getString( "patient_d1" ) ) ;
end

-- hoteldieuhouselady2
function init_hoteldieuhouselady2( name )
	setWoman( name, true ) ;
end

function place_hoteldieuhouselady2( name )
	placeCharacter( name, "hoteldieuhouse", 17, 282 ) ;
end

function dress_hoteldieuhouselady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_hair_pinned", "7b6032" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "c5bca9" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "c5bca9" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "c5bca9" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "c5bca9" ) ;

end


function runAI_hoteldieuhouselady2( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_hoteldieuhouselady2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "patient_d1" ) ) ;
	sayAndWait( name, getString( "patient_d1" ) ) ;
end

-- hoteldieuhouselady3
function init_hoteldieuhouselady3( name )
	setWoman( name, true ) ;
end

function place_hoteldieuhouselady3( name )
	placeCharacter( name, "hoteldieuhouse2", 169, 340 ) ;
end

function dress_hoteldieuhouselady3( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_plain", "070706" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "745d32" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "745d32" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "745d32" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "31240b" ) ;

end

function runAI_hoteldieuhouselady3( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_hoteldieuhouselady3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "patient_d1" ) ) ;
	sayAndWait( name, getString( "patient_d1" ) ) ;
end

-- hoteldieuhouselady4
function init_hoteldieuhouselady4( name )
	setWoman( name, true ) ;
end

function place_hoteldieuhouselady4( name )
	placeCharacter( name, "hoteldieuhouse2", -201, 202 ) ;
end

function dress_hoteldieuhouselady4( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "caab70" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "caab70" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "caab70" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8d887d" ) ;
end

function runAI_hoteldieuhouselady4( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_hoteldieuhouselady4( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "patient_d1" ) ) ;
	sayAndWait( name, getString( "patient_d1" ) ) ;
end

-- hoteldieudoctor1
function init_hoteldieudoctor1( name )
end

function place_hoteldieudoctor1( name )
	placeCharacter( name, "hoteldieuhouse", -44, 74 ) ;
end

function dress_hoteldieudoctor1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "mustache_b", "917a0d" ) ;
	addCharacterPiece( name, "hair_medium", "917a0d" ) ;
	addCharacterPiece( name, "beard_b", "917a0d" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "pant_monk_legs", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "191817" ) ;
	end

function runAI_hoteldieudoctor1( name )
	while ( true ) do
		local destX = -39 ;
		local destY = 67 ;
		addGoalGetToPointInLevel( name, destX, destY, "hoteldieuhouse", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;

		local destX = -161 ;
		local destY = 204 ;
		addGoalGetToPointInLevel( name, destX, destY, "hoteldieuhouse", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
		
		local destX = -152 ;
		local destY = 326 ;
		addGoalGetToPointInLevel( name, destX, destY, "hoteldieuhouse", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
	end
end

function chat_hoteldieudoctor1( name, chatWith )
	chatDoctor( name, chatWith ) ;
end

-- hoteldieudoctor2
function init_hoteldieudoctor2( name )
end

function place_hoteldieudoctor2( name )
	placeCharacter( name, "hoteldieuhouse2", 80, 81 ) ;
end

function dress_hoteldieudoctor2( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "mustache_a", "805e3d" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "pant_monk_legs", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "191817" ) ;
	end

function runAI_hoteldieudoctor2( name )
	while ( true ) do
		local destX = 80 ;
		local destY = 85 ;
		addGoalGetToPointInLevel( name, destX, destY, "hoteldieuhouse2", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;

		local destX = 135 ;
		local destY = 303 ;
		addGoalGetToPointInLevel( name, destX, destY, "hoteldieuhouse2", false ) ;
		setBaseFaceDirection( name, 1, 1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
		
		local destX = -164 ;
		local destY = 201 ;
		addGoalGetToPointInLevel( name, destX, destY, "hoteldieuhouse2", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
	end
end

function chat_hoteldieudoctor2( name, chatWith )
	chatDoctor( name, chatWith ) ;
end

-- hoteldieunurse1
function init_hoteldieunurse1( name )
	setWoman( name, true ) ;
end

function place_hoteldieunurse1( name )
	placeCharacter( name, "hoteldieuhouse", -303, 107 ) ;
end

function dress_hoteldieunurse1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "191817" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "191817" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "191817" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "191817" ) ;
	addCharacterPiece( name, "w_hat_holy", "191817" ) ;
end

function runAI_hoteldieunurse1( name )
	while ( true ) do
		local destX = -303 ;
		local destY = 107 ;
		addGoalGetToPointInLevel( name, destX, destY, "hoteldieuhouse", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;

		local destX = 172 ;
		local destY = 217 ;
		addGoalGetToPointInLevel( name, destX, destY, "hoteldieuhouse", false ) ;
		setBaseFaceDirection( name, 1, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
	end
end

function chat_hoteldieunurse1( name, chatWith )
	chatDoctor( name, chatWith ) ;
end

-- hoteldieunurse2
function init_hoteldieunurse2( name )
	setWoman( name, true ) ;
end

function place_hoteldieunurse2( name )
	placeCharacter( name, "hoteldieuhouse2", -200, 265 ) ;
end

function dress_hoteldieunurse2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "191817" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "191817" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "191817" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "191817" ) ;
	addCharacterPiece( name, "w_hat_holy", "191817" ) ;
end

function runAI_hoteldieunurse2( name )
	while ( true ) do
		local destX = -200 ;
		local destY = 265 ;
		addGoalGetToPointInLevel( name, destX, destY, "hoteldieuhouse2", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;

		local destX = -150 ;
		local destY = 325 ;
		addGoalGetToPointInLevel( name, destX, destY, "hoteldieuhouse2", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
	end
end

function chat_hoteldieunurse2( name, chatWith )
	chatDoctor( name, chatWith ) ;
end

-- parishousealady
function init_parishousealady( name )
	setWoman( name, true ) ;
end

function place_parishousealady( name )
	placeCharacter( name, "parishousea", -53, 145 ) ;
end

function dress_parishousealady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "d18b47" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "d18b47" ) ;
	addCharacterPiece( name, "w_hair_curly", "7c6847" ) ;
	addCharacterPiece( name, "w_stripe_torso", "e9c94a" ) ;
	addCharacterPiece( name, "w_stripe_legs", "e9c94a" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "e5c2a0" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "e5c2a0" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "e5c2a0" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e5c2a0" ) ;
end

function runAI_parishousealady( name )
	while ( true ) do
		local destX = -62 ;
		local destY = 132 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishousea", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 8 ) ) ;

		local destX = -18 ;
		local destY = 128 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishousea", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 8 ) ) ;
	end
end

function chat_parishousealady( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parishousealady_d1" ) ) ;
	sayAndWait( name, getString( "parishousealady_d1" ) ) ;
end

-- parishouseaman
function init_parishouseaman( name )
end

function place_parishouseaman( name )
	placeCharacter( name, "parishousea", -247, 141 ) ;
end

function dress_parishouseaman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "8e7446" ) ;	
	addCharacterPiece( name, "belt", "665f52" ) ;
	addCharacterPiece( name, "boot_fancy_right", "b3b3b3" ) ;
	addCharacterPiece( name, "boot_fancy_left", "b3b3b3" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "1f5ee0" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "e0c21f" ) ;
	addCharacterPiece( name, "hat_plain", "594525" ) ;
	addCharacterPiece( name, "hair_short", "8e7446" ) ;
	addCharacterPiece( name, "mustache_b", "8e7446" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "594525" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "594525" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "1f5ee0" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "1f5ee0" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "594525" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "594525" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e0c21f" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e0c21f" ) ;
end


function runAI_parishouseaman( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_parishouseaman( name, chatWith )
	local split1 = gameIsSplit( ) and getGameSplitPart( ) == 1 ;
	if ( split1 ) then
		sayAndWait( name, getString( "maquireflintlock0d1" ) ) ;
		return ;
	end

	if ( isMissionComplete( "missionaquireflintlock1" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "maquireflintlock1d5" ) ) ;
		sayAndWait( name, getString( "maquireflintlock1d5" ) ) ;
	elseif ( isMissionComplete( "missionmarin3" ) ) then
		local requireHonour = 20 ;
		
		if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
			sayAndWait( name, getString( "maquireflintlock0d1" ) ) ;
			setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
		elseif ( getTooManyActiveMissions( ) ) then
			sayAndWait( name, getString( "maquireflintlock0d1" ) ) ;
			setQuickInfoTag( getString( "toomanymissions" ) ) ;
		else
			-- meets minimum requirements
			sayAndWait( name, getString( "maquireflintlock0d2" ) ) ;
			sayAndWait( name, getString( "maquireflintlock0d3" ) ) ;
			
			local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "maquireflintlock0d4" ), getString( "maquireflintlock0d5" ) ) ;
			local option = waitForBubbleOption( bubInd ) ;
			if ( option == 0 ) then
				-- accept
				sayAndWait( name, getString( "maquireflintlock0d6" ) ) ;
				sayAndWait( name, getString( "maquireflintlock0d7" ) ) ;
				activateMission( "missionaquireflintlock1" ) ;
				addMoney( 5000 ) ;
			else
				-- reject
				sayAndWait( name, getString( "maquireflintlock0d8" ) ) ;
			end
		end
	else
		--autoDeleteFaceChat( name, chatWith, getString( "maquireflintlock0d1" ) ) ;
		sayAndWait( name, getString( "maquireflintlock0d1" ) ) ;
	end
end

-- parisstoreblady
function init_parisstoreblady( name )
	setWoman( name, true ) ;
end

function place_parisstoreblady( name )
	placeCharacter( name, "parisstoreb", -137, -10 ) ;
end

function dress_parisstoreblady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "f1b2c7" ) ;
	addCharacterPiece( name, "w_hair_plain", "dbd56d" ) ;
	addCharacterPiece( name, "w_stripe_torso", "e9cae8" ) ;
	addCharacterPiece( name, "w_stripe_legs", "e9cae8" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "9cdcef" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "9cdcef" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "9cdcef" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "9cdcef" ) ;
end


function runAI_parisstoreblady( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisstoreblady( name, chatWith )
	--chat_clothesdealer2( name, chatWith ) ;
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
		
	local items = { 
		"ointment", 
		"hat_plain_poor_1", 
		"hat_plain_poor_2",
		"hat_plain_ok_1", 
		"hat_plain_ok_2", 
		"hat_plain_best_1", 
		"hat_plain_best_2", 
		"hat_simple_ok_1", 
		"hat_simple_ok_2",
		"boot_plain_best_1", 
		"boot_sock_best_1", 
		"boot_fancy_poor_1", 
		"boot_fancy_ok_1", 
		"boot_fancy_best_1",
		"belt_best_1", 
		"belt_best_2",
		"sashbelt_best_1",
		"gloves_best_1", 
		"cuff_fancy_1",
		"collar_big_1", 
		"collar_fancy_1",
		"pants_musk_best_1", 
		"pants_baggy_ok_2", 
		"pants_baggy_best_1",
		"doublet_plain_ok_1", 
		"shirt_fancy_ok_1", 
		"doublet_best_1", 
		"doublet_best_2", 
		"doublet_fancy_best_1" } ;
		
	chat_vendor( name, chatWith, items ) ;
end

-- parisstorebman
function init_parisstorebman( name )
end

function place_parisstorebman( name )
	placeCharacter( name, "parisstoreb2", -35, -50 ) ;
end

function dress_parisstorebman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beardmus", "221808" ) ;
	addCharacterPiece( name, "belt", "be8223" ) ;
	addCharacterPiece( name, "boot_fancy_right", "755524" ) ;
	addCharacterPiece( name, "boot_fancy_left", "755524" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "231706" ) ;
	addCharacterPiece( name, "hair_long", "221808" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "86b4d8" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "86b4d8" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d5e4ef" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d5e4ef" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "efedc5" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "efedc5" ) ;
	
end

function runAI_parisstorebman( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisstorebman( name, chatWith )
	--chat_clothesdealer2( name, chatWith ) ;
	--chat_weapondealer1( name, chatWith ) ;
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	
	local swords = {
		"sword_6",
		"sword_8",
		"sword_11", 
		"sword_12", 
		"sword_13", 
		"sword_14", 
		"sword_15",
		"sword_16", 
		"sword_17", 
		"sword_18", 
		"sword_19", 
		"sword_20", 
		"sword_21", 
		"sword_22",
		"sword_23",
		"sword_24",
		"sword_25" } ;

	local pistols = { 
		"pistol_matchlock_3", 
		"pistol_wheellock_1", 
		"pistol_wheellock_3", 
		"pistol_snaplock_1", 
		"pistol_snaplock_2", 
		"pistol_snaplock_3", 
		"pistol_snaplock_4", 
		"pistol_snaplock_5", 
		"pistol_snaphance_1", 
		"pistol_snaphance_2", 
		"pistol_snaphance_3", 
		"pistol_snaphance_4", 
		"pistol_snaphance_5" } ;

	local muskets = { 
		"musket_matchlock_3", 
		"musket_wheellock_1", 
		"musket_wheellock_3", 
		"musket_snaplock_1", 
		"musket_snaplock_2", 
		"musket_snaplock_3", 
		"musket_snaplock_4", 
		"musket_snaplock_5", 
		"musket_snaphance_1", 
		"musket_snaphance_2",
		"musket_snaphance_3", 
		"musket_snaphance_4", 
		"musket_snaphance_5" } ;

	chat_weapondealers( name, chatWith, swords, pistols, muskets ) ;
end

-- parishouseblady1
function init_parishouseblady1( name )
	setWoman( name, true ) ;
end

function place_parishouseblady1A( name )
	placeCharacter( name, "parishouseb2", -198, 172 ) ;
end

function place_parishouseblady1B( name )
	placeCharacter( name, "parishouseb2", -177, -19 ) ;
end

function dress_parishouseblady1( name )
clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_plain", "e0d98e" ) ;
	addCharacterPiece( name, "w_stripe_torso", "e4d583" ) ;
	addCharacterPiece( name, "w_stripe_legs", "e4d583" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "93acf2" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "93acf2" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "93acf2" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "93acf2" ) ;
end


function runAI_parishouseblady1( name )
	if ( isMissionComplete( "missionfathermessage4" ) ) then
		setBaseFaceDirection( name, 1, 0 ) ;
	else
		setBaseFaceDirection( name, 0, 1 ) ;
	end
end

function chat_parishouseblady1( name, chatWith )
	if ( isMissionComplete( "missionfathermessage4" ) ) then
		addTimedHeartMaker( "parishousebman2", 2.5 ) ;
		addTimedHeartMaker( "parishouseblady1", 2.5 ) ;
		--autoDeleteFaceChat( name, chatWith, getString( "mfathermessage4d7" ) ) ;
		sayAndWait( name, getString( "mfathermessage4d7" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "mfathermessage0d6" ) ) ;
		sayAndWait( name, getString( "mfathermessage0d6" ) ) ;
	end
end

-- parishouseblady2
function init_parishouseblady2( name )
	setWoman( name, true ) ;
end

function place_parishouseblady2( name )
	placeCharacter( name, "parishouseb", 101, -68 ) ;
end

function dress_parishouseblady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "9c5c83" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "9c5c83" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "9c5c83" ) ;
	addCharacterPiece( name, "w_hair_short", "635647" ) ;
	addCharacterPiece( name, "w_stripe_legs", "9c5c83" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "cd94c2" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "cd94c2" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "cd94c2" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "cd94c2" ) ;
end

function runAI_parishouseblady2( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_parishouseblady2( name, chatWith )
	if ( isMissionComplete( "missionfathermessage4" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mfathermessage4d8" ) ) ;
		sayAndWait( name, getString( "mfathermessage4d8" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "mfathermessage0d4" ) ) ;
		sayAndWait( name, getString( "mfathermessage0d4" ) ) ;
	end
end

-- parishousebman1
function init_parishousebman1( name )
end

function place_parishousebman1( name )
	placeCharacter( name, "parishouseb2", -71, -51 ) ;
end

function dress_parishousebman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "5e554e" ) ;	
	addCharacterPiece( name, "belt", "7d6c43" ) ;
	addCharacterPiece( name, "boot_sock_right", "e5e0d4" ) ;
	addCharacterPiece( name, "boot_sock_left", "e5e0d4" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "hair_curly", "5e554e" ) ;
	addCharacterPiece( name, "mustache_b", "5e554e" ) ;
	addCharacterPiece( name, "pant_baggy_right", "6d6d6d" ) ;
	addCharacterPiece( name, "pant_baggy_left", "6d6d6d" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "779c5c" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "779c5c" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "779c5c" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "e5e0d4" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "e5e0d4" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "e5e0d4" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "779c5c" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "779c5c" ) ;
end

function runAI_parishousebman1( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_parishousebman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "mfathermessage0d5" ) ) ;
	sayAndWait( name, getString( "mfathermessage0d5" ) ) ;
end

-- parishousebman2
function init_parishousebman2( name )
end

function place_parishousebman2A( name )
	placeCharacter( name, "france", 2659, -591 ) ;
end

function place_parishousebman2B( name )
	placeCharacter( name, "parishouseb2", -137, -19 ) ;
end

function dress_parishousebman2( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", "31210b" ) ;
	addCharacterPiece( name, "belt", "937d61" ) ;
	addCharacterPiece( name, "boot_plain_right", "7f6749" ) ;
	addCharacterPiece( name, "boot_plain_left", "7f6749" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "aa9d7b" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "aa9d7b" ) ;
	addCharacterPiece( name, "glove_plain_right", "817e76" ) ;
	addCharacterPiece( name, "glove_plain_left", "817e76" ) ;
	addCharacterPiece( name, "hair_long", "31210b" ) ;
	addCharacterPiece( name, "mustache_a", "31210b" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "bfa04d" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "bfa04d" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "aa9d7b" ) ;
end

function runAI_parishousebman2( name )
	if ( isMissionComplete( "missionfathermessage4" ) ) then
		setBaseFaceDirection( name, -1, 0 ) ;
	else
		setBaseFaceDirection( name, 0, 1 ) ;
	end
end

function chat_parishousebman2( name, chatWith )
	if ( isMissionComplete( "missionfathermessage4" ) ) then
		addTimedHeartMaker( "parishousebman2", 2.5 ) ;
		addTimedHeartMaker( "parishouseblady1", 2.5 ) ;
		--autoDeleteFaceChat( name, chatWith, getString( "mfathermessage4d7" ) ) ;
		sayAndWait( name, getString( "mfathermessage4d7" ) ) ;
	else
		sayAndWait( name, getString( "mfathermessage0d1" ) ) ;
		
		local requireHonour = 15 ;
		if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
			setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
		elseif ( getTooManyActiveMissions( ) ) then
			setQuickInfoTag( getString( "toomanymissions" ) ) ;
		else
			-- meets minimum requirements
			local bubInd = characterSay( name, true, -1, -1, false, getString( "mfathermessage0d2" ) ) ;
			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( name, getString( "mfathermessage0d3" ) ) ;
				playSound( "paper", 1.0 ) ;
				activateMission( "missionfathermessage1" ) ;
			else
				-- no
				return ;
			end
		end
	end
end

-- parishousebservant1
function init_parishousebservant1( name )
	setWoman( name, true ) ;
end

function place_parishousebservant1( name )
	placeCharacter( name, "parishouseb", -167, -78 ) ;
end

function dress_parishousebservant1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "f1eedd" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "191106" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "c8bba9" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "c8bba9" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "c8bba9" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "604c30" ) ;
	addCharacterPiece( name, "w_hat_cap" ) ;

end

function runAI_parishousebservant1( name )
	while ( true ) do
		local destX = -175 ;
		local destY = -132 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishouseb", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;

		local destX = -120 ;
		local destY = -128 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishouseb", false ) ;
		setBaseFaceDirection( name, 1, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;

		local destX = -128 ;
		local destY = -51 ;
		addGoalGetToPointInLevel( name, destX, destY, "parishouseb", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 4 ) ) ;
	end
end

function chat_parishousebservant1( name, chatWith )
	if ( isMissionComplete( "missionfathermessage4" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "parishousebservant1_d2" ) ) ;
		sayAndWait( name, getString( "parishousebservant1_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "parishousebservant1_d1" ) ) ;
		sayAndWait( name, getString( "parishousebservant1_d1" ) ) ;
	end
end

-- miladyservant1
function init_miladyservant1( name )
end

function place_miladyservant1( name )
	placeCharacter( name, "miladyhouse", -185, -82 ) ;
end

function dress_miladyservant1( name )
	clearCharacterPieces( name ) ;
	local darkness = randomDouble( 0.8, 1.0 ) ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	local hairColour = "605b4e" ;
	if ( randomInt( 1, 3 ) == 1 ) then
		hairColour = "917214" ;
	end
	
	local shirtColour = "d7bc71" ;
	if ( randomInt( 1, 3 ) == 1 ) then
		shirtColour = "f2c061" ;
	end
	
	local pantColour = "77b6dd" ;
	if ( randomInt( 1, 3 ) == 1 ) then
		pantColour = "bf9000" ;
	end
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "boot_sock_right", "f0e9d7" ) ;
	addCharacterPiece( name, "boot_sock_left", "f0e9d7" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", shirtColour ) ;
	addCharacterPiece( name, "hair_medium", hairColour ) ;
	addCharacterPiece( name, "mustache_b", hairColour ) ;
	addCharacterPiece( name, "pant_musketeer_right", pantColour ) ;
	addCharacterPiece( name, "pant_musketeer_left", pantColour ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "ededed" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "ededed" ) ;
end

function runAI_miladyservant1( name )
	while ( true ) do
		local destX = -200 ;
		local destY = -95 ;
		addGoalGetToPointInLevel( name, destX, destY, "miladyhouse", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 1, 4 ) ) ;

		local destX = -200 ;
		local destY = -64 ;
		addGoalGetToPointInLevel( name, destX, destY, "miladyhouse", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 1, 4 ) ) ;
	end
end

function chat_miladyservant1( name, chatWith )
	if ( randomInt( 1, 3 ) == 1 ) then
		--autoDeleteFaceChat( name, chatWith, getString( "miladyservant1_d1" ) )
		sayAndWait( name, getString( "miladyservant1_d1" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "miladyservant1_d2" ) )
		sayAndWait( name, getString( "miladyservant1_d2" ) ) ;
	end
end

-- parishousecman1
function init_parishousecman1( name )
end

function place_parishousecman1( name )
	placeCharacter( name, "parishousec", -26, -84 ) ;
end

function dress_parishousecman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_c", "cabd74" ) ;
	addCharacterPiece( name, "boot_sock_right", "ebe8d1" ) ;
	addCharacterPiece( name, "boot_sock_left", "ebe8d1" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "8b9f75" ) ;
	addCharacterPiece( name, "hair_curly", "cabd74" ) ;
	addCharacterPiece( name, "mustache_b", "cabd74" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "9f7440" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "9f7440" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "f0edd0" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "f0edd0" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "f0edd0" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "f0edd0" ) ;
	end

function runAI_parishousecman1( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_parishousecman1( name, chatWith )
	genericGreeting( name, chatWith, 0.81 ) ;
end

-- parishousecman2
function init_parishousecman2( name )
end

function place_parishousecman2( name )
	placeCharacter( name, "parishousec", 20, -84 ) ;
end

function dress_parishousecman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_c" ) ;
	addCharacterPiece( name, "boot_sock_right", "ebe8d1" ) ;
	addCharacterPiece( name, "boot_sock_left", "ebe8d1" ) ;
	addCharacterPiece( name, "collar_big", "cabd74" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "9f7440" ) ;
	addCharacterPiece( name, "hair_curly", "cabd74" ) ;
	addCharacterPiece( name, "mustache_b", "cabd74" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "8b9f75" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "8b9f75" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "f0edd0" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "f0edd0" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "f0edd0" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "f0edd0" ) ;
	end

function runAI_parishousecman2( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parishousecman2( name, chatWith )
	genericGreeting( name, chatWith, 0.89 ) ;
end

-- parishouseclady1
function init_parishouseclady1( name )
	setWoman( name, true ) ;
end

function place_parishouseclady1( name )
	placeCharacter( name, "parishousec2", 78, 115 ) ;
end

function dress_parishouseclady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "ead64e" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "ead64e" ) ;
	addCharacterPiece( name, "w_hair_short", "756962" ) ;
	addCharacterPiece( name, "w_stripe_torso", "ead64e" ) ;
	addCharacterPiece( name, "w_stripe_legs", "ead64e" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "7f8cd8" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "7f8cd8" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "7f8cd8" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "7f8cd8" ) ;
end

function runAI_parishouseclady1( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_parishouseclady1( name, chatWith )
	fameGreeting( name, chatWith ) ;
end

-- parisman1
function init_parisman1( name )
end

function place_parisman1( name )
	placeCharacter( name, "france", 98, 3459 ) ;
end

function dress_parisman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "beardmus", "957351" ) ;
	addCharacterPiece( name, "belt", "a39f9a" ) ;
	addCharacterPiece( name, "boot_sock_right", "e8ddd2" ) ;
	addCharacterPiece( name, "boot_sock_left", "e8ddd2" ) ;
	addCharacterPiece( name, "collar_big") ;
	addCharacterPiece( name, "doublet_plain_torso", "a8abdd" ) ;
	addCharacterPiece( name, "glove_plain_right", "80818e" ) ;
	addCharacterPiece( name, "glove_plain_left", "80818e" ) ;
	addCharacterPiece( name, "hair_medium", "957351" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "bf9334" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "bf9334" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "a8abdd" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "a8abdd" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "675526" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "675526" ) ;

	end

function runAI_parisman1( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 92, 3460 ) ;
		goalWalkToPoint( name, "france", 87, 3177 ) ;
		goalWalkToPoint( name, "france", 902, 3182 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 890, 3461 ) ;
	end
end

function chat_parisman1( name, chatWith )
	fameGreeting( name, chatWith ) ;
end

-- parisman2
function init_parisman2( name )
end

function place_parisman2( name )
	placeCharacter( name, "france", 575, 2506 ) ;
end

function dress_parisman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "816e55" ) ;
	addCharacterPiece( name, "belt", "8a7c71" ) ;
	addCharacterPiece( name, "sashbelt", "615233" ) ;
	addCharacterPiece( name, "boot_plain_right", "8a7c71" ) ;
	addCharacterPiece( name, "boot_plain_left", "8a7c71" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "658ec6" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "658ec6" ) ;
	addCharacterPiece( name, "feather_hat_small", "c94040" ) ;
	addCharacterPiece( name, "hat_simple", "806f47" ) ;
	addCharacterPiece( name, "hair_medium", "816e55" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "615233" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "615233" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "658ec6" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "c94040" ) ;
	
end

function runAI_parisman2( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 575, 2506 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 880, 2503 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parisman2( name, chatWith )
	genericGreeting( name, chatWith, 0.0 ) ;
end

-- parisman3
function init_parisman3( name )
end

function place_parisman3( name )
	placeCharacter( name, "france", 913, 2691 ) ;
end

function dress_parisman3( name )

	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "d8bd7d" ) ;
	addCharacterPiece( name, "beret", "e9d449" ) ;
	addCharacterPiece( name, "boot_fancy_right", "9e8b74" ) ;
	addCharacterPiece( name, "boot_fancy_left", "9e8b74" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "feather_hat_small" ) ;
	addCharacterPiece( name, "hair_short", "d8bd7d" ) ;
	addCharacterPiece( name, "mustache_a", "d8bd7d" ) ;
	addCharacterPiece( name, "pant_baggy_right", "666e52" ) ;
	addCharacterPiece( name, "pant_baggy_left", "666e52" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "d6bd91" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d6bd91" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "d6bd91" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e9d449" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e9d449" ) ;

end

function runAI_parisman3( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 908, 2503 ) ;
		goalWalkToPoint( name, "france", 1519, 2501 ) ;
		goalWalkToPoint( name, "france", 1521, 2861 ) ;
		goalWalkToPoint( name, "france", 902, 2858 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parisman3( name, chatWith )
	genericGreeting( name, chatWith, 1.0 ) ;
end

-- parisman4
function init_parisman4( name )
end

function place_parisman4( name )
	placeCharacter( name, "france", 1701, 3168 ) ;
end

function dress_parisman4( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "786342" ) ;
	addCharacterPiece( name, "belt", "d9c869" ) ;
	addCharacterPiece( name, "boot_sock_right", "ece3d0" ) ;
	addCharacterPiece( name, "boot_sock_left", "ece3d0" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "ba4269" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "ba4269" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "ba4269" ) ;
	addCharacterPiece( name, "feather_hat_plain", "dfcf22" ) ;
	addCharacterPiece( name, "glove_plain_right", "7f7f7f" ) ;
	addCharacterPiece( name, "glove_plain_left", "7f7f7f" ) ;
	addCharacterPiece( name, "hat_plain", "7d6148" ) ;
	addCharacterPiece( name, "hair_curly", "786342" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "bd9b7d" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "bd9b7d" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "71644a" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "71644a" ) ;

end

function runAI_parisman4( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "france", 1667, 3164 ) ;
		wait( randomDouble( 3, 6 ) ) ;
		goalWalkToPoint( name, "france", 1867, 3154 ) ;
		wait( randomDouble( 3, 6 ) ) ;
	end
end

function chat_parisman4( name, chatWith )
	genericGreeting( name, chatWith, 0.9 ) ;
end

-- parisman5
function init_parisman5( name )
end

function place_parisman5( name )
	placeCharacter( name, "france", 1706, 4103 ) ;
end

function dress_parisman5( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "7d6438" ) ;	
	addCharacterPiece( name, "belt", "c5a834" ) ;
	addCharacterPiece( name, "sashbelt", "ead378" ) ;
	addCharacterPiece( name, "boot_fancy_right", "6a7587"  ) ;
	addCharacterPiece( name, "boot_fancy_left", "6a7587" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "9fa6b3" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "9fa6b3" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "9fa6b3" ) ;
	addCharacterPiece( name, "glove_plain_right", "574029" ) ;
	addCharacterPiece( name, "glove_plain_left", "574029" ) ;
	addCharacterPiece( name, "hat_simple", "574029" ) ;
	addCharacterPiece( name, "hair_curly", "7d6438" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "aa862e" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "aa862e" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "6a7587" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "6a7587" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "6a7587" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "6a7587" ) ;
	
end

function runAI_parisman5( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 1521, 4097 ) ;
		goalWalkToPoint( name, "france", 1527, 3175 ) ;
		goalWalkToPoint( name, "france", 2675, 3176 ) ;
		goalWalkToPoint( name, "france", 2685, 4100 ) ;
	end
end

function chat_parisman5( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "nicestroll" ) ) ;
	sayAndWait( name, getString( "nicestroll" ) ) ;
end

-- parisman6
function init_parisman6( name )
end

function place_parisman6( name )
	placeCharacter( name, "france", 2121, 2382 ) ;
end

function dress_parisman6( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "4d3625" ) ;
	addCharacterPiece( name, "belt", "7e6452" ) ;
	addCharacterPiece( name, "boot_fancy_right", "7e6452" ) ;
	addCharacterPiece( name, "boot_fancy_left", "7e6452" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hat_plain", "564d46" ) ;
	addCharacterPiece( name, "hair_long", "4d3625" ) ;
	addCharacterPiece( name, "mustache_a", "4d3625" ) ;
	addCharacterPiece( name, "pant_baggy_right", "c4b74a" ) ;
	addCharacterPiece( name, "pant_baggy_left", "c4b74a" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "928f77" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "928f77" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "928f77" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "efeac0" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "efeac0" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "efeac0" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "efeac0" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "efeac0" ) ;
	
end

function runAI_parisman6( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		goalWalkToPoint( name, "france", 1965, 2338 ) ;
		wait( randomDouble( 6, 8 ) ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		goalWalkToPoint( name, "france", 2235, 2344 ) ;
		wait( randomDouble( 5, 6 ) ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "france", 2070, 2441 ) ;
		wait( randomDouble( 5, 6 ) ) ;
	end
end

function chat_parisman6( name, chatWith )
	genericGreeting( name, chatWith, 0.2 ) ;
end

-- parisman7
function init_parisman7( name )
end

function place_parisman7( name )
	placeCharacter( name, "france", 3315, 2609 ) ;
end

function dress_parisman7( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "e0c454" ) ;
	addCharacterPiece( name, "sashbelt", "7c644d" ) ;
	addCharacterPiece( name, "boot_plain_right", "7c644d" ) ;
	addCharacterPiece( name, "boot_plain_left", "7c644d" ) ;
	addCharacterPiece( name, "feather_hat_small", "5b80dd" ) ;
	addCharacterPiece( name, "glove_plain_right", "82796c" ) ;
	addCharacterPiece( name, "glove_plain_left", "82796c" ) ;
	addCharacterPiece( name, "hat_plain", "82796c" ) ;
	addCharacterPiece( name, "hair_long", "e0c454" ) ;
	addCharacterPiece( name, "mustache_b", "e0c454" ) ;
	addCharacterPiece( name, "pant_baggy_right", "2a476f" ) ;
	addCharacterPiece( name, "pant_baggy_left", "2a476f" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "d3c0a3" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d3c0a3" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d3c0a3" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "2a476f" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "5b80dd" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "5b80dd" ) ;
end

function runAI_parisman7( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 3270, 2688 ) ;
		wait( randomDouble( 3, 6 ) ) ;
		goalWalkToPoint( name, "france", 3530, 2573 ) ;
		wait( randomDouble( 3, 6 ) ) ;
		goalWalkToPoint( name, "france", 3277, 2451 ) ;
		wait( randomDouble( 3, 6 ) ) ;
		goalWalkToPoint( name, "france", 3053, 2498 ) ;
		wait( randomDouble( 3, 6 ) ) ;
	end
end

function chat_parisman7( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "gardensnice" ) ) ;
	sayAndWait( name, getString( "gardensnice" ) ) ;
end

-- parisman8
function init_parisman8( name )
end

function place_parisman8( name )
	placeCharacter( name, "france", 3403, 2803 ) ;
end

function dress_parisman8( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;

	addCharacterPiece( name, "beardmus", "634b26" ) ;
	addCharacterPiece( name, "belt", "be9e6c" ) ;
	addCharacterPiece( name, "beret", "8ca568" ) ;
	addCharacterPiece( name, "boot_sock_right", "deeacc" ) ;
	addCharacterPiece( name, "boot_sock_left", "deeacc" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "7a9ad5" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "7a9ad5" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "7a9ad5" ) ;
	addCharacterPiece( name, "feather_hat_small", "be2231" ) ;
	addCharacterPiece( name, "hair_short", "634b26" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "be2231" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "be2231" ) ;
end

function runAI_parisman8( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 3306, 2869 ) ;
		wait( randomDouble( 3, 6 ) ) ;
		goalWalkToPoint( name, "france", 3596, 2725 ) ;
		wait( randomDouble( 3, 6 ) ) ;
		goalWalkToPoint( name, "france", 3422, 2683 ) ;
		wait( randomDouble( 3, 6 ) ) ;
		goalWalkToPoint( name, "france", 3491, 2806 ) ;
		wait( randomDouble( 3, 6 ) ) ;
	end
end

function chat_parisman8( name, chatWith )
	genericGreeting( name, chatWith, 0.58 ) ;
end

-- parisman9
function init_parisman9( name )
end

function place_parisman9( name )
	placeCharacter( name, "france", 1216, 4619 ) ;
end

function dress_parisman9( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;

	addCharacterPiece( name, "beardmus", "c8871f" ) ;
	addCharacterPiece( name, "sashbelt", "756b5b" ) ;
	addCharacterPiece( name, "boot_sock_right" ) ;
	addCharacterPiece( name, "boot_sock_left" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "8baacb" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "8baacb" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "8baacb" ) ;
	addCharacterPiece( name, "glove_plain_right", "756b5b" ) ;
	addCharacterPiece( name, "glove_plain_left", "756b5b" ) ;
	addCharacterPiece( name, "hair_medium", "c8871f" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "cbc98b" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "cbc98b" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "cbc98b" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "cbc98b" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "cbc98b" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "b2b2b2") ;
	addCharacterPiece( name, "stripe_plain_leg_left", "b2b2b2" ) ;

end

function runAI_parisman9( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 1515, 4767 ) ;
		goalWalkToPoint( name, "france", 1186, 4770 ) ;
		spinLook( name ) ;
		wait( randomDouble( 1, 2 ) ) ;
		goalWalkToPoint( name, "france", 856, 4701 ) ;
		goalWalkToPoint( name, "france", 1206, 4646 ) ;
	end
end

function chat_parisman9( name, chatWith )
	genericGreeting( name, chatWith, 0.75 ) ;
end

-- parisman10
function init_parisman10( name )
end

function place_parisman10( name )
	placeCharacter( name, "france", 1024, 4382 ) ;
end

function dress_parisman10( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", "cead5d" ) ;
	addCharacterPiece( name, "belt", "99858c" ) ;
	addCharacterPiece( name, "boot_plain_right", "66594b" ) ;
	addCharacterPiece( name, "boot_plain_left", "66594b" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "hat_plain", "67594b" ) ;
	addCharacterPiece( name, "hair_short", "cead5d" ) ;
	addCharacterPiece( name, "mustache_a", "cead5d" ) ;
	addCharacterPiece( name, "pant_baggy_right", "c43a6e" ) ;
	addCharacterPiece( name, "pant_baggy_left", "c43a6e" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "8f7499" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "8f7499" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "c43a6e" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "c43a6e" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "8f7499" ) ;
	end

function runAI_parisman10( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 1 ) ;
		goalWalkToPoint( name, "france", 1218, 4405 ) ;
		wait( randomDouble( 1, 6 ) ) ;
		setBaseFaceDirection( name, 1, -1 ) ;
		goalWalkToPoint( name, "france", 1106, 4264 ) ;
		wait( randomDouble( 1, 6 ) ) ;
	end
end

function chat_parisman10( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "gardensnice" ) ) ;
	sayAndWait( name, getString( "gardensnice" ) ) ;
end

-- parisman11
function init_parisman11( name )
end

function place_parisman11( name )
	placeCharacter( name, "france", 2042, 1561 ) ;
end

function dress_parisman11( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;

	addCharacterPiece( name, "cloak_holy", "7d5d33" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_short", "797979" ) ;
	addCharacterPiece( name, "mustache_a", "797979" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "7d5d33" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "7d5d33" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "7d5d33" ) ;
	addCharacterPiece( name, "pant_monk_legs", "7d5d33" ) ;
end
	

function runAI_parisman11( name )
	while ( true ) do
		if ( not gBlockGoalWalkToPoint ) then
			goalWalkToPoint( name, "france", 1889, 1564 ) ;
		end
		wait( randomDouble( 1, 6 ) ) ;
		if ( not gBlockGoalWalkToPoint ) then
			goalWalkToPoint( name, "france", 2336, 1578 ) ;
		end
		wait( randomDouble( 1, 6 ) ) ;
	end
end

function chat_parisman11( name, chatWith )
	if ( isMissionComplete( "missiongraveyard2" ) ) then
		if ( randomInt( 0, 2 ) == 0 ) then
			--autoDeleteFaceChat( name, chatWith, getString( "mgraveyard0d7" ) ) ;
			sayAndWait( name, getString( "mgraveyard0d7" ) ) ;
		else
			--autoDeleteFaceChat( name, chatWith, getString( "mgraveyard0d8" ) ) ;
			sayAndWait( name, getString( "mgraveyard0d8" ) ) ;
		end
	else
		local requireHonour = 7 ;
		if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
			sayAndWait( name, getString( "mgraveyard0d7" ) ) ;
			setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
		elseif ( getTooManyActiveMissions( ) ) then
			sayAndWait( name, getString( "mgraveyard0d7" ) ) ;
			setQuickInfoTag( getString( "toomanymissions" ) ) ;
		else
			-- meets minimum requirements
			sayAndWait( name, getString( "mgraveyard0d1" ) ) ;
	
			local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mgraveyard0d2" ), getString( "mgraveyard0d3" ) ) ;
			local option = waitForBubbleOption( bubInd ) ;
			if ( option == 0 ) then
				-- give money
			else
				-- give nothing
				return ;
			end

			removeMoney( 1 ) ;

			sayAndWait( name, getString( "mgraveyard0d4" ) ) ;
			sayAndWait( name, getString( "mgraveyard0d5" ) ) ;
						
			local bubInd = characterSay( name, true, -1, -1, false, getString( "mgraveyard0d6" ) ) ;
			waitForBubbleDone( bubInd ) ;
			setBubbleToBackgroundOpacity( bubInd ) ;
			local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, "", getString( "yes" ), getString( "no" ) ) ;
			local goWith = waitForBubbleOption( bubInd2 ) ;
			deleteBubble( bubInd ) ;
			if ( goWith == 0 ) then
				-- yes
				activateMission( "missiongraveyard1" ) ;
			else
				-- no
			end		
		end
	end
end

-- parisman12
function init_parisman12( name )
end

function place_parisman12( name )
	placeCharacter( name, "france", 2725, 1347 ) ;
end

function dress_parisman12( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "727272" ) ;
	addCharacterPiece( name, "belt", "89693f" ) ;
	addCharacterPiece( name, "boot_fancy_right", "ae5819" ) ;
	addCharacterPiece( name, "boot_fancy_left", "ae5819" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "glove_plain_right", "ae5819" ) ;
	addCharacterPiece( name, "glove_plain_left", "ae5819" ) ;
	addCharacterPiece( name, "hair_curly", "727272" ) ;
	addCharacterPiece( name, "pant_baggy_right", "829663" ) ;
	addCharacterPiece( name, "pant_baggy_left", "829663" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "cab44c" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "cab44c" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "cab44c" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "829663" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "829663" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "cab44c" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "cab44c" ) ;
end

function runAI_parisman12( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 2744, 514 ) ;
		goalWalkToPoint( name, "france", 2327, -58 ) ;
		goalWalkToPoint( name, "france", 3402, 48 ) ;
		goalWalkToPoint( name, "france", 2743, 1238 ) ;
		spinLook( name ) ;
		wait( randomDouble( 1, 6 ) ) ;
	end
end

function chat_parisman12( name, chatWith )
	genericGreeting( name, chatWith, 0.91 ) ;
end


-- parisman13
function init_parisman13( name )
end

function place_parisman13( name )
	placeCharacter( name, "france", 3030, -368 ) ;
end

function dress_parisman13( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "4a3b14" ) ;
	addCharacterPiece( name, "boot_fancy_right", "6d6d6d" ) ;
	addCharacterPiece( name, "boot_fancy_left", "6d6d6d" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "e6d72e" ) ;
	addCharacterPiece( name, "hat_plain", "6d6d6d" ) ;
	addCharacterPiece( name, "hair_long", "4a3b14" ) ;
	addCharacterPiece( name, "mustache_a", "4a3b14" ) ;
	addCharacterPiece( name, "pant_baggy_right", "b1b1b1" ) ;
	addCharacterPiece( name, "pant_baggy_left", "b1b1b1" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "e6d72e" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "e6d72e" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "e6d72e" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "b1b1b1" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "b1b1b1" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "b1b1b1" ) ;
end

function runAI_parisman13( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 2912, -360 ) ;
		wait( randomDouble( 1, 6 ) ) ;
		goalWalkToPoint( name, "france", 2916, -215 ) ;
		wait( randomDouble( 1, 6 ) ) ;
		goalWalkToPoint( name, "france", 3152, -217 ) ;
		wait( randomDouble( 1, 6 ) ) ;
		goalWalkToPoint( name, "france", 3152, -340 ) ;
		wait( randomDouble( 1, 6 ) ) ;
	end
end

function chat_parisman13( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "flowerwalker_d1" ) ) ;
	sayAndWait( name, getString( "flowerwalker_d1" ) ) ;
end

-- parisman14
function init_parisman14( name )
end

function place_parisman14( name )
	placeCharacter( name, "france", 2177, -856 ) ;
end

function dress_parisman14( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "boot_plain_right", "82745c" ) ;
	addCharacterPiece( name, "boot_plain_left", "82745c" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "9b6827" ) ;
	addCharacterPiece( name, "hat_simple", "beaa75" ) ;
	addCharacterPiece( name, "hair_medium", "a9976b" ) ;
	addCharacterPiece( name, "mustache_b", "a9976b" ) ;
	addCharacterPiece( name, "glove_plain_right", "96826c" ) ;
	addCharacterPiece( name, "glove_plain_left", "96826c" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "878fdf" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "878fdf" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "9b6827" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "9b6827" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e5dab5" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e5dab5" ) ;
end

function runAI_parisman14( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 2310, -829 ) ;
		goalWalkToPoint( name, "france", 2314, -267 ) ;
		goalWalkToPoint( name, "france", 1212, -259 ) ;
		goalWalkToPoint( name, "france", 1200, -844 ) ;
		goalWalkToPoint( name, "france", 1865, -543 ) ;
		goalWalkToPoint( name, "france", 2317, -535 ) ;
		goalWalkToPoint( name, "france", 2305, -258 ) ;
		goalWalkToPoint( name, "france", 1858, -270 ) ;
		goalWalkToPoint( name, "france", 1868, -845 ) ;
	end
end

function chat_parisman14( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parisman14_d1" ) ) ;
	sayAndWait( name, getString( "parisman14_d1" ) ) ;
end

-- parisman15
function init_parisman15( name )
end

function place_parisman15( name )
	placeCharacter( name, "france", 38, -347 ) ;
end

function dress_parisman15( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a", "ddc761" ) ;
	addCharacterPiece( name, "belt", "513914" ) ;
	addCharacterPiece( name, "sashbelt", "dcb336" ) ;
	addCharacterPiece( name, "boot_sock_right", "e6dcca" ) ;
	addCharacterPiece( name, "boot_sock_left", "e6dcca" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "9cc364" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "9cc364" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "9cc364" ) ;
	addCharacterPiece( name, "hair_long", "ddc761" ) ;
	addCharacterPiece( name, "mustache_a", "ddc761" ) ;
	addCharacterPiece( name, "pant_baggy_right", "998967" ) ;
	addCharacterPiece( name, "pant_baggy_left", "998967" ) ;	
	addCharacterPiece( name, "stripe_plain_leg_right", "dcb336" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "dcb336" ) ;
end

function runAI_parisman15( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "france", -92, -347 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		setBaseFaceDirection( name, 1, 1 ) ;
		goalWalkToPoint( name, "france", 108, -318 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parisman15( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "likefountains" ) ) ;
	sayAndWait( name, getString( "likefountains" ) ) ;
end

-- parisman16
function init_parisman16( name )
end

function place_parisman16( name )
	placeCharacter( name, "france", 177, -833 ) ;
end

function dress_parisman16( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "8a734a" ) ;
	addCharacterPiece( name, "boot_fancy_right", "535353" ) ;
	addCharacterPiece( name, "boot_fancy_left", "535353" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "feather_hat_plain", "957f3b" ) ;
	addCharacterPiece( name, "glove_plain_right", "9d9d9d" ) ;
	addCharacterPiece( name, "glove_plain_left", "9d9d9d" ) ;
	addCharacterPiece( name, "hat_plain", "535353" ) ;
	addCharacterPiece( name, "hair_medium", "8a734a" ) ;
	addCharacterPiece( name, "mustache_a", "8a734a" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "957f3b" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "957f3b" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "a91e31" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "a91e31" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "a91e31" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "957f3b" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "957f3b" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "957f3b" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "a91e31" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "a91e31" ) ;
end

function runAI_parisman16( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 9, -836 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 416, -836 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parisman16( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "longlivecardinal" ) ) ;
	sayAndWait( name, getString( "longlivecardinal" ) ) ;
end

-- parisman17
function init_parisman17( name )
end

function place_parisman17( name )
	placeCharacter( name, "france", -832, -1670 ) ;
end

function dress_parisman17( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "sashbelt", "8c6a45" ) ;
	addCharacterPiece( name, "boot_sock_right", "e3d7cb" ) ;
	addCharacterPiece( name, "boot_sock_left", "e3d7cb" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "db8930" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "db8930" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "db8930" ) ;
	addCharacterPiece( name, "hair_curly", "43382d" ) ;
	addCharacterPiece( name, "mustache_b", "43382d" ) ;
	addCharacterPiece( name, "pant_baggy_right", "8c6a45" ) ;
	addCharacterPiece( name, "pant_baggy_left", "8c6a45" ) ;	
	addCharacterPiece( name, "stripe_plain_leg_right", "db8930" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "db8930" ) ;
	end

function runAI_parisman17( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		goalWalkToPoint( name, "france", -831, -1710 ) ;
		wait( randomDouble( 5, 15 ) ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		goalWalkToPoint( name, "france", -829, -1599 ) ;
		goalWalkToPoint( name, "france", -689, -1607 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", -829, -1599 ) ;
	end
end

function chat_parisman17( name, chatWith )
	genericGreeting( name, chatWith, 0.37 ) ;
end

-- parisman18
function init_parisman18( name )
end

function place_parisman18( name )
	placeCharacter( name, "france", -1148, -716 ) ;
end

function dress_parisman18( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "boot_fancy_right", "727050" ) ;
	addCharacterPiece( name, "boot_fancy_left", "727050" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "hair_long", "a5621b" ) ;
	addCharacterPiece( name, "pant_baggy_right", "566764" ) ;
	addCharacterPiece( name, "pant_baggy_left", "566764" ) ;		
	addCharacterPiece( name, "shirt_fancy_arm_right", "1958b7" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "1958b7" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "1958b7" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
	end

function runAI_parisman18( name )
	while ( true ) do
		goalWalkToPoint( name, "france", -1395, -697 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", -878, -695 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parisman18( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "nicestroll" ) ) ;
	sayAndWait( name, getString( "nicestroll" ) ) ;
end

-- parisman19
function init_parisman19( name )
end

function place_parisman19( name )
	placeCharacter( name, "france", -843, 14 ) ;
end

function dress_parisman19( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "8e683a" ) ;
	addCharacterPiece( name, "belt" ) ;
	addCharacterPiece( name, "boot_plain_right", "53412b" ) ;
	addCharacterPiece( name, "boot_plain_left", "53412b" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "672772" ) ;
	addCharacterPiece( name, "glove_plain_right", "53412b" ) ;
	addCharacterPiece( name, "glove_plain_left", "53412b" ) ;
	addCharacterPiece( name, "hat_plain", "53412b" ) ;
	addCharacterPiece( name, "hair_short", "8e683a" ) ;
	addCharacterPiece( name, "mustache_b", "8e683a" ) ;
	addCharacterPiece( name, "pant_baggy_right", "8d82ae" ) ;
	addCharacterPiece( name, "pant_baggy_left", "8d82ae" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "ae82aa" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "ae82aa" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "ae82aa" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "8d82ae" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "8d82ae" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "8d82ae" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "672772" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "672772" ) ;
	end

function runAI_parisman19( name )
	setBaseFaceDirection( name, 1, 1 ) ;
end

function chat_parisman19( name, chatWith )
	genericGreeting( name, chatWith, 0.87 ) ;
end

-- parisgravedigger
function init_parisgravedigger( name )
end

function place_parisgravedigger( name )
	placeCharacter( name, "france", 1924, 319 ) ;
end

function dress_parisgravedigger( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a" ) ;
	addCharacterPiece( name, "belt", "906e4b" ) ;
	addCharacterPiece( name, "boot_plain_right", "906e4b" ) ;
	addCharacterPiece( name, "boot_plain_left", "906e4b" ) ;
	addCharacterPiece( name, "mustache_a", "906e4b" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "463c1e" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "463c1e" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "9b978c" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "9b978c" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "9b978c" ) ;
	end

function runAI_parisgravedigger( name )
	while ( true ) do
		if ( not gBlockGoalWalkToPoint ) then
			setBaseFaceDirection( name, 0, -1 ) ;
			goalWalkToPoint( name, "france", 1982, 433 ) ;
		end
		wait( randomDouble( 2, 6 ) ) ;
		
		if ( not gBlockGoalWalkToPoint ) then
			setBaseFaceDirection( name, 0, -1 ) ;
			goalWalkToPoint( name, "france", 1775, 265 ) ;
		end
		wait( randomDouble( 2, 6 ) ) ;
		
		if ( not gBlockGoalWalkToPoint ) then
			setBaseFaceDirection( name, 0, -1 ) ;
			goalWalkToPoint( name, "france", 2077, 273 ) ;
		end
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parisgravedigger( name, chatWith )
	if ( randomInt( 0, 2 ) == 0 ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mgraveyard0d7" ) ) ;
		sayAndWait( name, getString( "mgraveyard0d7" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "mgraveyard0d8" ) ) ;
		sayAndWait( name, getString( "mgraveyard0d8" ) ) ;
	end
end

-- parismarketvender1
function init_parismarketvender1( name )
end

function place_parismarketvender1( name )
	placeCharacter( name, "france", 2065, -129 ) ;
end

function dress_parismarketvender1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "5f5448" ) ;	
	addCharacterPiece( name, "belt", "875d31" ) ;
	addCharacterPiece( name, "beret", "f5c553" ) ;
	addCharacterPiece( name, "boot_plain_right", "875d31" ) ;
	addCharacterPiece( name, "boot_plain_left", "875d31" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "e7ca83" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "e7ca83" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "e7ca83" ) ;
	addCharacterPiece( name, "feather_hat_small", "d01c3e" ) ;
	addCharacterPiece( name, "hair_curly", "5f5448" ) ;
	addCharacterPiece( name, "mustache_a", "5f5448" ) ;
	addCharacterPiece( name, "pant_baggy_right", "bb9844" ) ;
	addCharacterPiece( name, "pant_baggy_left", "bb9844" ) ;	
	addCharacterPiece( name, "stripe_plain_leg_right", "e7ca83" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e7ca83" ) ;
end

function runAI_parismarketvender1( name )
	setBaseFaceDirection( name, -1, 1 ) ;
end

function chat_parismarketvender1( name, chatWith )
	if ( isMissionComplete( "missioncheese1" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mcheese2d7" ) ) ;
		sayAndWait( name, getString( "mcheese2d7" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "mcheese0d13" ) ) ;
		sayAndWait( name, getString( "mcheese0d13" ) ) ;
	end
end

-- parismarketvender2
function init_parismarketvender2( name )
end

function place_parismarketvender2( name )
	placeCharacter( name, "france", 1877, -86 ) ;
end

function dress_parismarketvender2( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;

	addCharacterPiece( name, "beardmus", "bc7836" ) ;
	addCharacterPiece( name, "belt", "69421c" ) ;
	addCharacterPiece( name, "boot_plain_right", "5c5753" ) ;
	addCharacterPiece( name, "boot_plain_left", "5c5753" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "78ad5e" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "78ad5e" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "78ad5e" ) ;
	addCharacterPiece( name, "hat_simple", "b4977c" ) ;
	addCharacterPiece( name, "hair_long", "bc7836" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "57391c" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "57391c" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "aacd9a" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "aacd9a" ) ;
end

function runAI_parismarketvender2( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parismarketvender2( name, chatWith )
	--chat_weapondealer1( name, chatWith ) ;
	
	local swords = { 
		"sword_1", 
		"sword_3", 
		"sword_6", 
		"sword_7", 
		"sword_8", 
		"sword_9", 
		"sword_10", 
		"sword_11", 
		"sword_12", 
		"sword_13", 
		"sword_14", 
		"sword_15",
		"sword_17",
		"sword_24" } ;

	local pistols = { 
		"pistol_matchlock_1",
		"pistol_matchlock_3",
		"pistol_wheellock_1", 
		"pistol_wheellock_2", 
		"pistol_wheellock_3", 
		"pistol_wheellock_4", 
		"pistol_wheellock_5", 
		"pistol_snaplock_1", 
		"pistol_snaplock_2", 
		"pistol_snaplock_3", 
		"pistol_snaplock_4", 
		"pistol_snaplock_5",  
		"pistol_snaphance_4" } ;

	local muskets = { 
		"musket_matchlock_1",
		"musket_matchlock_3", 
		"musket_wheellock_1", 
		"musket_wheellock_2", 
		"musket_wheellock_3", 
		"musket_wheellock_4", 
		"musket_wheellock_5", 
		"musket_snaplock_1", 
		"musket_snaplock_2", 
		"musket_snaplock_3", 
		"musket_snaplock_4", 
		"musket_snaplock_5", 
		"musket_snaphance_4" } ;

	chat_weapondealers( name, chatWith, swords, pistols, muskets ) ;
end

-- parismarketvender3
function init_parismarketvender3( name )
end

function place_parismarketvender3( name )
	placeCharacter( name, "france", 1755, 51 ) ;
end

function dress_parismarketvender3( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "696052" ) ;
	addCharacterPiece( name, "boot_sock_right", "eaddca" ) ;
	addCharacterPiece( name, "boot_sock_left", "eaddca" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "c29351" ) ;
	addCharacterPiece( name, "hair_short", "696052" ) ;
	addCharacterPiece( name, "mustache_b", "696052" ) ;
	addCharacterPiece( name, "pant_baggy_right", "a49887" ) ;
	addCharacterPiece( name, "pant_baggy_left", "a49887" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "eaddca" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "eaddca" ) ;
end

function runAI_parismarketvender3( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_parismarketvender3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "meatvendor_d1" ) ) ;
	sayAndWait( name, getString( "meatvendor_d1" ) ) ;
end

-- parismarketvender4
function init_parismarketvender4( name )
end

function place_parismarketvender4( name )
	placeCharacter( name, "france", 1525, -107 ) ;
end

function dress_parismarketvender4( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "baa268" ) ;	
	addCharacterPiece( name, "belt", "6d5233" ) ;
	addCharacterPiece( name, "sashbelt", "e6d841" ) ;
	addCharacterPiece( name, "boot_sock_right", "f9deee" ) ;
	addCharacterPiece( name, "boot_sock_left", "f9deee" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "ec6eb8" ) ;
	addCharacterPiece( name, "hair_curly", "baa268" ) ;
	addCharacterPiece( name, "hat_plain", "baa268" ) ;
	addCharacterPiece( name, "mustache_b", "baa268" ) ;
	addCharacterPiece( name, "pant_baggy_right", "912d68" ) ;
	addCharacterPiece( name, "pant_baggy_left", "912d68" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "ec6eb8" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "ec6eb8" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "ec6eb8" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left" ) ;
	end

function runAI_parismarketvender4( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_parismarketvender4( name, chatWith )
	local items = {
		"ointment", 
		"beret_4", 
		"hat_simple_ok_1", 
		"hat_simple_ok_2", 
		"hat_simple_best_1", 
		"hat_plain_poor_1", 
		"hat_plain_poor_2", 
		"hat_plain_ok_1",
		"hat_plain_ok_2",
		"hat_plain_best_pink", 
		"boot_plain_ok_1", 
		"boot_plain_best_1", 
		"boot_sock_ok_1", 
		"boot_sock_best_1", 
		"boot_fancy_poor_1",
		"belt_ok_1", 
		"belt_best_1",
		"sashbelt_ok_1",
		"gloves_ok_1", 
		"cuff_plain_1", 
		"cuff_fancy_1",
		"collar_plain_1", 
		"collar_big_1",
		"pants_musk_ok_2", 
		"pants_baggy_ok_1", 
		"pants_baggy_ok_2", 
		"pants_baggy_best_1",
		"pants_baggy_best_pink",
		"shirt_fancy_poor_1", 
		"shirt_fancy_poor_2",
		"shirt_fancy_ok_1", 
		"shirt_fancy_ok_2", 
		"shirt_fancy_best_1", 
		"shirt_fancy_best_2", 
		"shirt_fancy_best_pink" } ;
			
	chat_vendorCustom( name, chatWith, items, getString( "parismarketvender4_d1" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

-- parismarketvender5
function init_parismarketvender5( name )
	setWoman( name, true ) ;
end

function place_parismarketvender5( name )
	placeCharacter( name, "france", 1586, 19 ) ;
end

function dress_parismarketvender5( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_pinned", "cf8047") ;
	addCharacterPiece( name, "w_stripe_torso", "4767cf" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "a08e62" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "a08e62" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "a08e62" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "4767cf" ) ;
	addCharacterPiece( name, "w_hat_cap" ) ;
	addCharacterPiece( name, "w_apron" ) ;
end

function runAI_parismarketvender5( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_parismarketvender5( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "bookseller_d1" ) ) ;
	sayAndWait( name, getString( "bookseller_d1" ) ) ;
end

-- parismarketvender6
function init_parismarketvender6( name )
	setWoman( name, true ) ;
end

function place_parismarketvender6( name )
	placeCharacter( name, "france", 1421, 56 ) ;
end

function dress_parismarketvender6( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_hair_pinned", "c2b784" ) ;
	addCharacterPiece( name, "w_stripe_legs", "9c8a37" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "9c8a37" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "9c8a37" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "9c8a37" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8e7867" ) ;
	addCharacterPiece( name, "w_hat_plain", "8e7867" ) ; 
end

function runAI_parismarketvender6( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_parismarketvender6( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "bookseller_d1" ) ) ;
	sayAndWait( name, getString( "bookseller_d1" ) ) ;
end

-- parismarketvender7
function init_parismarketvender7( name )
	setWoman( name, true ) ;
end

function place_parismarketvender7( name )
	placeCharacter( name, "france", 1718, -84 ) ;
end

function dress_parismarketvender7( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "f3f1d8" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "392a1b" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "a36a32" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "a36a32" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "a36a32" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "938577" ) ;
	addCharacterPiece( name, "w_hat_cap", "f3f1d8" ) ;
end

function runAI_parismarketvender7( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parismarketvender7( name, chatWith )
	genericGreeting( name, chatWith, 0.78 ) ;
end

-- parismarketvender8
function init_parismarketvender8( name )
	setWoman( name, true ) ;
end

function place_parismarketvender8( name )
	placeCharacter( name, "france", 1954, 57 ) ;
end

function dress_parismarketvender8( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "e7eacd" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "aeb859" ) ;
	addCharacterPiece( name, "w_hair_plain", "dccf85" ) ;
	addCharacterPiece( name, "w_stripe_torso", "475e30" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "90b66b" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "90b66b" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "90b66b" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "475e30" ) ;
end

function runAI_parismarketvender8( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_parismarketvender8( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "cabbages_d1" ) ) ;
	sayAndWait( name, getString( "cabbages_d1" ) ) ;
end

-- parismarketvender9
function init_parismarketvender9( name )
	setWoman( name, true ) ;
end

function place_parismarketvender9( name )
	placeCharacter( name, "france", 2055, -21 ) ;
end

function dress_parismarketvender9( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_hair_pinned", "ca812c" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "e2dba0" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "e2dba0" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "e2dba0" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "96763d" ) ;
	addCharacterPiece( name, "w_hat_cap" ) ;
end

function runAI_parismarketvender9( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parismarketvender9( name, chatWith )
	local split1 = gameIsSplit( ) and getGameSplitPart( ) == 1 ;
	if ( split1 ) then
		sayAndWait( name, getString( "mbaguettedelivery0d1" ) ) ;
		return ;
	end

	if ( isMissionComplete( "missionbaguettedelivery2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mbaguettedelivery2d2" ) ) ;
		sayAndWait( name, getString( "mbaguettedelivery2d2" ) ) ;
	else
		local requireHonour = 20 ;
		if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
			sayAndWait( name, getString( "mbaguettedelivery0d1" ) ) ;
			setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
		elseif ( getTooManyActiveMissions( ) ) then
			sayAndWait( name, getString( "mbaguettedelivery0d1" ) ) ;
			setQuickInfoTag( getString( "toomanymissions" ) ) ;
		else
			-- meets minimum requirements
			sayAndWait( name, getString( "mbaguettedelivery0d2" ) ) ;
			
			local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mbaguettedelivery0d3" ), getString( "mbaguettedelivery0d4" ) ) ;
			local option = waitForBubbleOption( bubInd ) ;
			if ( option == 0 ) then
				-- accept
				sayAndWait( name, getString( "mbaguettedelivery0d5" ) ) ;
				sayAndWait( name, getString( "mbaguettedelivery0d6" ) ) ;
				sayAndWait( name, getString( "mbaguettedelivery0d7" ) ) ;
	
				activateMission( "missionbaguettedelivery1" ) ;
			else
				-- don't accept
			end
		end
	end
end

-- parislady1
function init_parislady1( name )
	setWoman( name, true ) ;
end

function place_parislady1( name )
	placeCharacter( name, "france", 1467, -51 ) ;
end

function dress_parislady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_curly", "27211b" ) ;
	addCharacterPiece( name, "w_stripe_torso", "a0c1c1" ) ;
	addCharacterPiece( name, "w_stripe_legs", "a0c1c1" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "9a7b57" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "9a7b57" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "9a7b57" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "9a7b57" ) ;
	addCharacterPiece( name, "w_hat_plain", "6c4518" ) ;

end

function runAI_parislady1( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "france", 1427, -3 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "france", 1586, -43 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		goalWalkToPoint( name, "france", 1914, -132 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		setBaseFaceDirection( name, 1, -1 ) ;
		goalWalkToPoint( name, "france", 2036, -103 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "france", 1757, -12 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parislady1_d1" ) ) ;
	sayAndWait( name, getString( "parislady1_d1" ) ) ;
end

-- parislady2
function init_parislady2( name )
	setWoman( name, true ) ;
end

function place_parislady2( name )
	placeCharacter( name, "france", 1956, -23 ) ;
end

function dress_parislady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "efebcd" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_bow_torso", "efebcd" ) ;
	addCharacterPiece( name, "w_hair_plain", "8b7a5c" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "c1acc9" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "c1acc9" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "c1acc9" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "928a95" ) ;
end

function runAI_parislady2( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "france", 1953, 32 ) ;
		wait( randomDouble( 2, 10 ) ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		goalWalkToPoint( name, "france", 2019, -23 ) ;
		wait( randomDouble( 2, 10 ) ) ;
	end
end

function chat_parislady2( name, chatWith )
	genericGreeting( name, chatWith, 0.65 ) ;
end

-- parislady3
function init_parislady3( name )
	setWoman( name, true ) ;
end

function place_parislady3( name )
	placeCharacter( name, "france", 463, 351 ) ;
end

function dress_parislady3( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "d75894" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "d75894" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "d75894" ) ;
	addCharacterPiece( name, "w_hair_curly", "966c36" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "efb9d2" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "efb9d2" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "efb9d2" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "9d5b7a" ) ;
end

function runAI_parislady3( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 350, 397 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 761, 416 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady3( name, chatWith )
	genericGreeting( name, chatWith, 0.88 ) ;
end

-- parislady4
function init_parislady4( name )
	setWoman( name, true ) ;
end

function place_parislady4( name )
	placeCharacter( name, "france", -1333, -105 ) ;
end

function dress_parislady4( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_short", "8a734a" ) ;
	addCharacterPiece( name, "w_stripe_torso" ) ;
	addCharacterPiece( name, "w_stripe_legs" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "ebda65" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "ebda65" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "ebda65" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "ebda65" ) ;
end

function runAI_parislady4( name )
	while ( true ) do
		goalWalkToPoint( name, "france", -1335, -210 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", -828, -396 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", -1109, 78 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", -1359, -396 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady4( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "nicestroll" ) ) ;
	sayAndWait( name, getString( "nicestroll" ) ) ;
end

-- parislady5 Madame d'Aiguillon
function init_parislady5( name )
	setWoman( name, true ) ;
end

function place_parislady5( name )
	placeCharacter( name, "france", -630, -1531 ) ;
end

function dress_parislady5( name )
clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "e0a4a6" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "e0a4a6" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "e0a4a6" ) ;
	addCharacterPiece( name, "w_hair_short", "1b0c0d" ) ;
	addCharacterPiece( name, "w_stripe_torso", "4d2728" ) ;
	addCharacterPiece( name, "w_stripe_legs", "4d2728" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "4d2728" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "4d2728" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "a40e12" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "a40e12" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "a40e12" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a40e12" ) ;
end

function runAI_parislady5( name )
	setBaseFaceDirection( name, 1, -1 ) 
end

function chat_parislady5( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parislady5_d1" ) ) ;
	sayAndWait( name, getString( "parislady5_d1" ) ) ;
end

-- parislady6 Marion de Lorme
function init_parislady6( name )
	setWoman( name, true ) ;
end

function place_parislady6( name )
	placeCharacter( name, "france", 699, -1508 ) ;
end

function dress_parislady6( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_plain", "a4681a" ) ;
	addCharacterPiece( name, "w_stripe_torso", "a53869" ) ;
	addCharacterPiece( name, "w_stripe_legs", "a53869" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "6f4976" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "6f4976" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "6f4976" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6f4976" ) ;
end

function runAI_parislady6( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, -1 ) 
		goalWalkToPoint( name, "france", 651, -1539 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		setBaseFaceDirection( name, 0, 1 ) 
		goalWalkToPoint( name, "france", 591, -1638 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady6( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parislady6_d1" ) ) ;
	sayAndWait( name, getString( "parislady6_d1" ) ) ;
end

-- parislady7
function init_parislady7( name )
	setWoman( name, true ) ;
end

function place_parislady7( name )
	placeCharacter( name, "france", 1094, -813 ) ;
end

function dress_parislady7( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "eba040" ) ;
	addCharacterPiece( name, "w_hair_short", "858585" ) ;
	addCharacterPiece( name, "w_stripe_torso", "6e7e5a" ) ;
	addCharacterPiece( name, "w_stripe_legs", "6e7e5a" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "eba040" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "eba040" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "80aa5d" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "80aa5d" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "80aa5d" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "80aa5d" ) ;
end

function runAI_parislady7( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 945, -822 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 1185, -834 ) ;
		goalWalkToPoint( name, "france", 1199, -67 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 1185, -834 ) ;
	end
end

function chat_parislady7( name, chatWith )
	genericGreeting( name, chatWith, 0.36 ) ;
end

-- parislady8
function init_parislady8( name )
	setWoman( name, true ) ;
end

function place_parislady8( name )
	placeCharacter( name, "france", 1480, -838 ) ;
end

function dress_parislady8( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "e4d063" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "e4d063" ) ;
	addCharacterPiece( name, "w_hair_plain", "a58a3f" ) ;
	addCharacterPiece( name, "w_stripe_legs", "e4d063" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "e4b563" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "e4b563" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "e4b563" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e4b563" ) ;
end

function runAI_parislady8( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 1257, -853 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 1784, -873 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady8( name, chatWith )
	genericGreeting( name, chatWith, 0.99 ) ;
end

-- parislady9
function init_parislady9( name )
	setWoman( name, true ) ;
end

function place_parislady9( name )
	placeCharacter( name, "france", 2850, -69 ) ;
end

function dress_parislady9( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "453daa" ) ;
	addCharacterPiece( name, "w_hair_curly", "523723" ) ;
	addCharacterPiece( name, "w_stripe_torso", "7f7d9d" ) ;
	addCharacterPiece( name, "w_stripe_legs", "7f7d9d" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "8783ba" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "8783ba" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "8783ba" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8783ba" ) ;
	addCharacterPiece( name, "w_hat_plain", "453daa" ) ;
end


function runAI_parislady9( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 3392, -59 ) ;
		goalWalkToPoint( name, "france", 3402, -536 ) ;
		goalWalkToPoint( name, "france", 2333, -525 ) ;
		goalWalkToPoint( name, "france", 2340, -60 ) ;
	end
end

function chat_parislady9( name, chatWith )
	genericGreeting( name, chatWith, 0.2 ) ;
end

-- parislady10
function init_parislady10( name )
	setWoman( name, true ) ;
end

function place_parislady10( name )
	placeCharacter( name, "france", 1797, 550 ) ;
end

function dress_parislady10( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_short", "be9d55" ) ;
	addCharacterPiece( name, "w_stripe_torso", "b25b52" ) ;
	addCharacterPiece( name, "w_stripe_legs", "b25b52" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "be8f8b" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "be8f8b" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "be8f8b" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "be8f8b" ) ;
end

function runAI_parislady10( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) 
		goalWalkToPoint( name, "france", 2522, 601 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 1650, 576 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady10( name, chatWith )
	fameGreeting( name, chatWith ) ;
end

-- parislady11
function init_parislady11( name )
	setWoman( name, true ) ;
end

function place_parislady11( name )
	placeCharacter( name, "france", 2919, 1433 ) ;
end

function dress_parislady11( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "eae9ae" ) ;
	addCharacterPiece( name, "w_hair_plain", "30261d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "769b5f" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "769b5f" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "769b5f" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "357150" ) ;
end

function runAI_parislady11( name )
	setBaseFaceDirection( name, 1, 1 ) 
end

function chat_parislady11( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "parislady11_d1" ) ) ;
	sayAndWait( name, getString( "parislady11_d1" ) ) ;
end

-- parislady12
function init_parislady12( name )
	setWoman( name, true ) ;
end

function place_parislady12( name )
	placeCharacter( name, "france", 2694, 2605 ) ;
end

function dress_parislady12( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "a69678" ) ;
	addCharacterPiece( name, "w_hair_curly", "e6d698" ) ;
	addCharacterPiece( name, "w_stripe_torso", "e6d698" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "a7c18f" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "a7c18f" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "a7c18f" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a69678" ) ;
	addCharacterPiece( name, "w_hat_plain", "a69678" ) ;

end

function runAI_parislady12( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 2673, 2344 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 2672, 2605 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 2673, 2862 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 2359, 2864 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 2673, 2856 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady12( name, chatWith )
	fameGreeting( name, chatWith ) ;
end

-- parislady13
function init_parislady13( name )
	setWoman( name, true ) ;
end

function place_parislady13( name )
	placeCharacter( name, "france", 3283, 2537 ) ;
end

function dress_parislady13( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;	
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_short", "ab8060" ) ;
	addCharacterPiece( name, "w_stripe_torso", "9d8c50" ) ;
	addCharacterPiece( name, "w_stripe_legs", "9d8c50" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "e0b727" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "e0b727" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "e0b727" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e0b727" ) ;
	addCharacterPiece( name, "w_hat_plain", "9d8c50" ) ;
end

function runAI_parislady13( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 3228, 2555 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 3333, 2556 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady13( name, chatWith )
	fameGreeting( name, chatWith ) ;
end

-- parislady14
function init_parislady14( name )
	setWoman( name, true ) ;
end

function place_parislady14( name )
	placeCharacter( name, "france", 2446, 4024 ) ;
end

function dress_parislady14( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_curly", "7f5d1b" ) ;
	addCharacterPiece( name, "w_stripe_torso", "d5b956" ) ;
	addCharacterPiece( name, "w_stripe_legs", "d5b956" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "d5b956" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "d5b956" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "3e658d" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "3e658d" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "3e658d" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "3e658d" ) ;
end

function runAI_parislady14( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 2231, 4033 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 2543, 4026 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady14( name, chatWith )
	genericGreeting( name, chatWith, 0.2 ) ;
end

-- parislady15
function init_parislady15( name )
	setWoman( name, true ) ;
end

function place_parislady15( name )
	placeCharacter( name, "france", 2514, 4516 ) ;
end

function dress_parislady15( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_plain", "473f37" ) ;
	addCharacterPiece( name, "w_stripe_torso", "6c9cd7" ) ;
	addCharacterPiece( name, "w_stripe_legs", "6c9cd7" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "8eb778" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "8eb778" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "8eb778" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8eb778" ) ;
end

function runAI_parislady15( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 2651, 4274 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 2658, 4769 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 2379, 4773 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady15( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "nicestroll" ) ) ;
	sayAndWait( name, getString( "nicestroll" ) ) ;
end

-- parislady16
function init_parislady16( name )
	setWoman( name, true ) ;
end

function place_parislady16( name )
	placeCharacter( name, "france", 1290, 4507 ) ;
end

function dress_parislady16( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1, .8 ) ;
	addCharacterPiece( name, "w_bow_torso", "ecc7e8" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "c487bd" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "c487bd" ) ;
	addCharacterPiece( name, "w_hair_short", "edeba7" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "e3d085" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "e3d085" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "e3d085" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "c487bd" ) ;
end

function runAI_parislady16( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) 
		goalWalkToPoint( name, "france", 1099, 4491 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		setBaseFaceDirection( name, -1, 0 ) 
		goalWalkToPoint( name, "france", 1218, 4492 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		setBaseFaceDirection( name, 1, -1 ) 
		goalWalkToPoint( name, "france", 1504, 4547 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady16( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "likefountains" ) ) ;
	sayAndWait( name, getString( "likefountains" ) ) ;
end

-- parislady17
function init_parislady17( name )
	setWoman( name, true ) ;
end

function place_parislady17( name )
	placeCharacter( name, "france", 1219, 3574 ) ;
end

function dress_parislady17( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_pinned", "d57c3b" ) ;
	addCharacterPiece( name, "w_stripe_torso", "d4cba9" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "6a7741" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "6a7741" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "6a7741" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "d4cba9" ) ;
	addCharacterPiece( name, "w_hat_plain", "5a4c3a" ) ;

end

function runAI_parislady17( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 1147, 3542 ) ;
		wait( randomDouble( 3, 10 ) ) ;
		goalWalkToPoint( name, "france", 1189, 3318 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady17( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "gloriousday" ) ) ;
	sayAndWait( name, getString( "gloriousday" ) ) ;
end

-- parislady18
function init_parislady18( name )
	setWoman( name, true ) ;
end

function place_parislady18( name )
	placeCharacter( name, "france", 260, 3608 ) ;
end

function dress_parislady18( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "f1e7d8" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "0b0705" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "87b2b1" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "87b2b1" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "87b2b1" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8e7a61" ) ;
	addCharacterPiece( name, "w_hat_cap", "f1e7d8" ) ;

end

function runAI_parislady18( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 196, 3643 ) ;
		wait( randomDouble( 2, 6 ) ) ;
		goalWalkToPoint( name, "france", 422, 3649 ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_parislady18( name, chatWith )
	genericGreeting( name, chatWith, 0.95 ) ;
end

-- parislady19
function init_parislady19( name )
	setWoman( name, true ) ;
end

function place_parislady19( name )
	placeCharacter( name, "france", 345, 2812 ) ;
end

function dress_parislady19( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "8aa4ef" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "8aa4ef" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "8aa4ef" ) ;
	addCharacterPiece( name, "w_hair_curly", "1b1919" ) ;
	addCharacterPiece( name, "w_stripe_legs", "f5e1b5" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "f5e1b5" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "f5e1b5" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "f5e1b5" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8aa4ef" ) ;

end

function runAI_parislady19( name )
	setBaseFaceDirection( name, 0, 1 ) 
end

function chat_parislady19( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hellohandsome" ) ) ;
	sayAndWait( name, getString( "hellohandsome" ) ) ;
end

-- parisguardsman1
function init_parisguardsman1( name )
end

function place_parisguardsman1( name )
	placeCharacter( name, "france", 3946, 716 ) ;
end

function dress_parisguardsman1( name )
	randomDressGuardsman( name, 0.0, 13712 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisguardsman1( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- parisguardsman2
function init_parisguardsman2( name )
end

function place_parisguardsman2( name )
	placeCharacter( name, "france", 4102, 708 ) ;
end

function dress_parisguardsman2( name )
	randomDressGuardsman( name, 0.0, 133312 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman2( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisguardsman2( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- parisguardsman3
function init_parisguardsman3( name )
end

function place_parisguardsman3( name )
	placeCharacter( name, "france", 4441, 718 ) ;
end

function dress_parisguardsman3( name )
	randomDressGuardsman( name, 0.0, 773312 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman3( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisguardsman3( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- parisguardsman4
function init_parisguardsman4( name )
end

function place_parisguardsman4( name )
	placeCharacter( name, "france", 3592, 717 ) ;
end

function dress_parisguardsman4( name )
	randomDressGuardsman( name, 0.0, 13339 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman4( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisguardsman4( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- parisguardsman5
function init_parisguardsman5( name )
end

function place_parisguardsman5( name )
	placeCharacter( name, "france", 2779, 448 ) ;
end

function dress_parisguardsman5( name )
	randomDressGuardsman( name, 0.0, 3339 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman5( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisguardsman5( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- parisguardsman6
function init_parisguardsman6( name )
end

function place_parisguardsman6( name )
	placeCharacter( name, "france", 2965, 441 ) ;
end

function dress_parisguardsman6( name )
	randomDressGuardsman( name, 0.0, 3333139 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman6( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisguardsman6( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- parisguardsman7
function init_parisguardsman7( name )
	setAllowPermanentDeath( name, false ) ;
	setHasLootDrop( name, false ) ;
	setStatsCalculatorStatic( name, 1, 1, 1, 1 ) ;
end

function place_parisguardsman7( name )
	placeCharacter( name, "france", -1400, 2405 ) ;
end

function dress_parisguardsman7( name )
	if ( isMissionActive( "missionretirement1" ) or isMissionComplete( "missionretirement1" ) ) then
		placeDead( name ) ;
	else
		clearCharacterPieces( name ) ;
		local skinR = 0.8 ;
		local skinG = 0.75 ;
		local skinB = 0.75 ; 
		local hairR = 1.0 ; 
		local hairG = 1.0 ; 
		local hairB = 1.0 ;
	
		addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
		addCharacterPiece( name, "doublet_plain_arm_right", 0.670000, 0.670000, 0.850000 ) ;
		addCharacterPiece( name, "boot_plain_right", 0.800000, 0.800000, 0.800000 ) ;
		addCharacterPiece( name, "pant_baggy_right", 0.670000, 0.670000, 0.850000 ) ;
		addCharacterPiece( name, "boot_plain_left", 0.800000, 0.800000, 0.800000 ) ;
		addCharacterPiece( name, "pant_baggy_left", 0.670000, 0.670000, 0.850000 ) ;
		addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
		addCharacterPiece( name, "beard_b", hairR, hairG, hairB ) ;
		addCharacterPiece( name, "mustache_b", hairR, hairG, hairB ) ;
		addCharacterPiece( name, "shirt_fancy_torso", 0.670000, 0.670000, 0.850000 ) ;
		addCharacterPiece( name, "sashbelt", 0.370000, 0.290000, 0.150000 ) ;
		addCharacterPiece( name, "tabbard", 0.650000, 0.650000, 0.650000 ) ;
		addCharacterPiece( name, "tabbard_overlay", 0.960000, 0.880000, 0.310000 ) ;
		addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
		addCharacterPiece( name, "doublet_plain_arm_left", 0.670000, 0.670000, 0.850000 ) ;
		addCharacterPiece( name, "hair_long", hairR, hairG, hairB ) ;
				
		setMeleeWeapon( name, "sword_12" ) ;
		setRangedWeapon( name, "musket_matchlock_1" ) ;
	end
end

function runAI_parisguardsman7( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parisguardsman7( name, chatWith )
	local requireHonour = 15 ; -- 10
	if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
		sayAndWait( name, getString( "mretirement0d1" ) ) ;
		setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
	elseif ( getTooManyActiveMissions( ) ) then
		sayAndWait( name, getString( "mretirement0d1" ) ) ;
		setQuickInfoTag( getString( "toomanymissions" ) ) ;
	else
		-- meets minimum requirements
		setIgnoreFreeze( name, true ) ;
		setIgnoreFreeze( "parisguardsman8", true ) ;
		
		setBaseFaceCharacter( name, "dartagnan" ) ;
		setLockRangedStill( name, true ) ;

		sayAndWait( name, getString( "mretirement0d2" ) ) ;
		
		
		local enemy1 = createTempCharacter( getString( "outlaw" ), "france", -1966, 2263 ) ;
		setStatsCalculatorStatic( enemy1, 50, 50, 50, 50 ) ;
		randomDressEnemy( enemy1, 0.0, 469 ) ;
		setRangedWeapon( enemy1, "musket_matchlock_1" ) ;
		setBaseFaceCharacter( enemy1, name ) ;
		loadRanged( enemy1 ) ;
				
		addGoalGetToPointInLevel( enemy1, -1620, 2398, "france", false, true ) ;
		
		setIgnoreFreeze( enemy1, true ) ;

		sayAndWait( name, getString( "mretirement0d3" ) ) ;
		sayAndWait( name, getString( "mretirement0d4" ) ) ;

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

		waitForNoGoal( enemy1 ) ;

		setRangedLoadedRatio( name, 0.0 ) ;

		makeEnemies( enemy1, name ) ;
		wait( 1 ) ;
		setBaseFaceCharacter( "parisguardsman8", enemy1 ) ;
		setBaseFaceCharacter( "dartagnan", enemy1 ) ;
		takeDamage( name, 1000 ) ;
		makeNotEnemies( enemy1, name ) ;

		setWalkSpeed( enemy1, 140 ) ;
		addGoalGetToPointInLevel( enemy1, -1962, 2267, "france", false, true ) ;
		wait( 1 ) ;
		setBaseFaceCharacter( "parisguardsman8", name ) ;
		setBaseFaceCharacter( "dartagnan", name ) ;
		wait( 2 ) ;

		setBaseFaceCharacter( "parisguardsman8", "dartagnan" ) ;
		setBaseFaceCharacter( "dartagnan", "parisguardsman8" ) ;
				
		sayAndWait( "dartagnan", getString( "mretirement0d5" ) ) ;
		sayAndWait( "parisguardsman8", getString( "mretirement0d6" ) ) ;
		sayAndWait( "dartagnan", getString( "mretirement0d7" ) ) ;
		sayAndWait( "parisguardsman8", getString( "mretirement0d8" ) ) ;
		
		waitForNoGoal( enemy1 ) ;
		setIgnoreFreeze( enemy1, false ) ;
		deleteTempCharacter( enemy1 ) ;

		setIgnoreFreeze( name, false ) ;
		setIgnoreFreeze( "parisguardsman8", false ) ;

		setBaseFaceNone( "dartagnan" ) ;
		setBaseFaceDirection( "parisguardsman8", -1, 0 ) ;
				
		removeMusic( tenseMusicID ) ;
				
		activateMission( "missionretirement1" ) ;
	end
end

-- parisguardsman8
function init_parisguardsman8( name )
end

function place_parisguardsman8( name )
	placeCharacter( name, "france", -1400, 2537 ) ;
end

function dress_parisguardsman8( name )
	randomDressGuardsman( name, 0.0, 3339 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman8( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parisguardsman8( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- parisguardsman9
function init_parisguardsman9( name )
end

function place_parisguardsman9( name )
	placeCharacter( name, "france", -690, 4275 ) ;
end

function dress_parisguardsman9( name )
	randomDressGuardsman( name, 0.0, 13539 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman9( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisguardsman9( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- parisguardsman10
function init_parisguardsman10( name )
end

function place_parisguardsman10( name )
	placeCharacter( name, "france", -509, 4276 ) ;
end

function dress_parisguardsman10( name )
	randomDressGuardsman( name, 0.0, 133339 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman10( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parisguardsman10( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- parisguardsman11
function init_parisguardsman11( name )
end

function place_parisguardsman11( name )
	placeCharacter( name, "france", 3739, -477 ) ;
end

function dress_parisguardsman11( name )
	randomDressGuardsman( name, 0.0, 6939 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman11( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_parisguardsman11( name, chatWith )
	guardsmanGreeting( name, chatWith, 1 ) ;
end

-- parisguardsman12
function init_parisguardsman12( name )
end

function place_parisguardsman12( name )
	placeCharacter( name, "france", 3780, -477 ) ;
end

function dress_parisguardsman12( name )
	randomDressGuardsman( name, 0.0, 3639 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman12( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parisguardsman12( name, chatWith )
	guardsmanGreeting( name, chatWith, 2 ) ;
end

-- parisguardsman13
function init_parisguardsman13( name )
end

function place_parisguardsman13( name )
	placeCharacter( name, "france", 834, -2147 ) ;
end

function dress_parisguardsman13( name )
	randomDressGuardsman( name, 0.0, 63639 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman13( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_parisguardsman13( name, chatWith )
	guardsmanGreeting( name, chatWith, 3 ) ;
end

-- parisguardsman14
function init_parisguardsman14( name )
end

function place_parisguardsman14( name )
	placeCharacter( name, "france", 874, -2147 ) ;
end

function dress_parisguardsman14( name )
	randomDressGuardsman( name, 0.0, 3543639 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parisguardsman14( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_parisguardsman14( name, chatWith )
	if ( isMissionComplete( "missionguardsmanbounty2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mguardsmanbounty2d4" ) ) ;
		sayAndWait( name, getString( "mguardsmanbounty2d4" ) ) ;
	elseif ( isMissionComplete( "missionparis15" ) ) then
		local requireHonour = 10 ;
		
		if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
			sayAndWait( name, getString( "mguardsmanbounty0d1" ) ) ;
			setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
		elseif ( getTooManyActiveMissions( ) ) then
			sayAndWait( name, getString( "mguardsmanbounty0d1" ) ) ;
			setQuickInfoTag( getString( "toomanymissions" ) ) ;
		else
			-- meets minimum requirements
			sayAndWait( name, getString( "mguardsmanbounty0d2" ) ) ;
			sayAndWait( name, getString( "mguardsmanbounty0d3" ) ) ;
			sayAndWait( name, getString( "mguardsmanbounty0d4" ) ) ;
			
			local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mguardsmanbounty0d5" ), getString( "mguardsmanbounty0d6" ) ) ;
			local option = waitForBubbleOption( bubInd ) ;
			if ( option == 0 ) then
				-- accept
				sayAndWait( name, getString( "mguardsmanbounty0d7" ) ) ;
				activateMission( "missionguardsmanbounty1" ) ;
			else
				-- reject
				sayAndWait( name, getString( "mguardsmanbounty0d8" ) ) ;
			end
		end
	else
		--autoDeleteFaceChat( name, chatWith, getString( "mguardsmanbounty0d1" ) ) ;
		sayAndWait( name, getString( "mguardsmanbounty0d1" ) ) ;
	end
end

-- parismusketeer1
function init_parismusketeer1( name )
end

function place_parismusketeer1( name )
	placeCharacter( name, "france", -183, 301 ) ;
end

function dress_parismusketeer1( name )
	randomDressMusketeer( name, 0.0, 344978 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parismusketeer1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parismusketeer1( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "hellodartagnan" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d2" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- parismusketeer2
function init_parismusketeer2( name )
end

function place_parismusketeer2( name )
	placeCharacter( name, "france", 28, 298 ) ;
end

function dress_parismusketeer2( name )
	randomDressMusketeer( name, 0.0, 134978 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parismusketeer2( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parismusketeer2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d8" ) ) ;
	sayAndWait( name, getString( "musketeer_d8" ) ) ;
end

-- parismusketeer3
function init_parismusketeer3( name )
end

function place_parismusketeer3( name )
	placeCharacter( name, "france", 0, -647 ) ;
end

function dress_parismusketeer3( name )
	randomDressMusketeer( name, 0.0, 134913 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parismusketeer3( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_parismusketeer3( name, chatWith )
	local comment = "" ;
	if ( musksKnowDartagnan( ) ) then
		-- they know D'Artagnan
		comment = getString( "hellodartagnan" ) ;
	else
		-- they don't know him
		comment = getString( "musketeer_d2" ) ;
	end

	--autoDeleteFaceChat( name, chatWith, comment ) ;
	sayAndWait( name, comment ) ;
end

-- parismusketeer4
function init_parismusketeer4( name )
end

function place_parismusketeer4( name )
	placeCharacter( name, "france", 106, -647 ) ;
end

function dress_parismusketeer4( name )
	randomDressMusketeer( name, 0.0, 34413 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parismusketeer4( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_parismusketeer4( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d16" ) ) ;
	sayAndWait( name, getString( "musketeer_d16" ) ) ;
end

-- parismusketeer5
function init_parismusketeer5( name )
end

function place_parismusketeer5( name )
	placeCharacter( name, "france", -637, 2302 ) ;
end

function dress_parismusketeer5( name )
	randomDressMusketeer( name, 0.0, 1413 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parismusketeer5( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parismusketeer5( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d8" ) ) ;
	sayAndWait( name, getString( "musketeer_d8" ) ) ;
end

-- parismusketeer6
function init_parismusketeer6( name )
end

function place_parismusketeer6( name )
	placeCharacter( name, "france", -352, 2297 ) ;
end

function dress_parismusketeer6( name )
	randomDressMusketeer( name, 0.0, 377 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_parismusketeer6( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_parismusketeer6( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "musketeer_d16" ) ) ;
	sayAndWait( name, getString( "musketeer_d16" ) ) ;
end

-- pariscardinalsguard1
function init_pariscardinalsguard1( name )
end

function place_pariscardinalsguard1( name )
	placeCharacter( name, "france", -76, -1050 ) ;
end

function dress_pariscardinalsguard1( name )
	randomDressCardinalsGuard( name, 0.0, 5177112 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_pariscardinalsguard1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_pariscardinalsguard1( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- pariscardinalsguard2
function init_pariscardinalsguard2( name )
end

function place_pariscardinalsguard2( name )
	placeCharacter( name, "france", 74, -1054 ) ;
end

function dress_pariscardinalsguard2( name )
	randomDressCardinalsGuard( name, 0.0, 92112 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_pariscardinalsguard2( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_pariscardinalsguard2( name, chatWith )
	cardGuardGreeting( name, chatWith, 2 ) ;
end

-- pariscardinalsguard3
function init_pariscardinalsguard3( name )
end

function place_pariscardinalsguard3( name )
	placeCharacter( name, "france", 795, -1138 ) ;
end

function dress_pariscardinalsguard3( name )
	randomDressCardinalsGuard( name, 0.0, 1352 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_pariscardinalsguard3( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_pariscardinalsguard3( name, chatWith )
	cardGuardGreeting( name, chatWith, 3 ) ;
end

-- pariscardinalsguard4
function init_pariscardinalsguard4( name )
end

function place_pariscardinalsguard4( name )
	placeCharacter( name, "france", -795, -1137 ) ;
end

function dress_pariscardinalsguard4( name )
	randomDressCardinalsGuard( name, 0.0, 7952 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_pariscardinalsguard4( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_pariscardinalsguard4( name, chatWith )
	cardGuardGreeting( name, chatWith, 1 ) ;
end

-- treville
function init_treville( name )
end

function place_trevilleA( name )
	sitCharacter( name, "trevilleantechamberchair1" ) ;
end

function place_trevilleB( name )
	placeCharacter( name, "louvrehouse", -145, -165 ) ;
end

function place_trevilleC( name )
	placeDead( name ) ;
end

function place_trevilleD( name )
	-- rochelle
	placeCharacter( name, "france", -8444, 9630 ) ;
end

function dress_treville( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1, 1, 1, .9) ;
	addCharacterPiece( name, "boot_fancy_right", "a26348") ;
	addCharacterPiece( name, "boot_fancy_left", "a26348") ;
	addCharacterPiece( name, "hair_curly", "9f9786" ) ;
	addCharacterPiece( name, "beard_a", "9f9786" ) ;
	addCharacterPiece( name, "mustache_a", "9f9786" ) ;
	addCharacterPiece( name, "belt", "dfce5c" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "78849a" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "78849a" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "b18a65" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "b18a65" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "b18a65" ) ;

	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_treville( name )
	if ( isMissionComplete( "missionrochelle7" ) ) then
		while ( true ) do
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_treville( name, chatWith )
	if ( isMissionComplete( "missionrochelle19" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "treville_d3" ) ) ;	
		sayAndWait( name, getString( "treville_d3" ) ) ;
	elseif ( isMissionComplete( "missionrochelle10" ) ) then
		-- Musketeer
		--autoDeleteFaceChat( name, chatWith, getString( "hellodartagnan" ) ) ;
		sayAndWait( name, getString( "hellodartagnan" ) ) ;
	elseif ( isMissionComplete( "missionparis15" ) ) then
		-- guardsman
		if ( randomInt( 0, 2 ) == 0 ) then
			--autoDeleteFaceChat( name, chatWith, getString( "hellodartagnan" ) ) ;
			sayAndWait( name, getString( "hellodartagnan" ) ) ;
		else
			--autoDeleteFaceChat( name, chatWith, getString( "treville_d2" ) ) ;
			sayAndWait( name, getString( "treville_d2" ) ) ;
		end
	elseif ( isMissionComplete( "missionparis7" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "hellodartagnan" ) ) ;
		sayAndWait( name, getString( "hellodartagnan" ) ) ;
	else
		-- doesn't know dartagnan
		--autoDeleteFaceChat( name, chatWith, getString( "treville_d1" ) ) ;
		sayAndWait( name, getString( "treville_d1" ) ) ;
	end
end

-- tremouille
function init_tremouille( name )
end

function place_tremouilleA( name )
	placeCharacter( name, "cardinalguardhouse2", -96, -2 ) ;
end

function place_tremouilleB( name )
	placeCharacter( name, "france", -9057, 9413 ) ;
end

function dress_tremouille( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "hair_short", "b08d6a" ) ;
	addCharacterPiece( name, "mustache_a", "b08d6a" ) ;
	addCharacterPiece( name, "sashbelt", "df3636" ) ;
	addCharacterPiece( name, "boot_fancy_right", "767a80" ) ;
	addCharacterPiece( name, "boot_fancy_left", "767a80" );
	addCharacterPiece( name, "pant_musketeer_right", "a08a6d" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "a08a6d" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "bebb9b" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "bebb9b"  ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "bebb9b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "bebb9b"  ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "bebb9b" ) ;

	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_tremouille( name )
	if ( isMissionComplete( "missionparisb33" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, -1, 1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 1, -1 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_tremouille( name, chatWith )
	if ( isMissionComplete( "missionparisb34" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "tremouille_d3" ) ) ;
		sayAndWait( name, getString( "tremouille_d3" ) ) ;
	elseif ( isMissionComplete( "missionparis13" ) ) then
		-- generic knows dartagnan
		--autoDeleteFaceChat( name, chatWith, getString( "tremouille_d2" ) ) ;
		sayAndWait( name, getString( "tremouille_d2" ) ) ;
	else
		-- doesn't know dartagnan
		--autoDeleteFaceChat( name, chatWith, getString( "tremouille_d1" ) ) ;
		sayAndWait( name, getString( "tremouille_d1" ) ) ;
	end
end

-- essart
function init_essart( name )
end

function place_essartA( name )
	placeCharacter( name, "guardhouse", -274, 105 ) ;
end

function place_essartB( name )
	placeCharacter( name, "france", -8332, 9209 ) ;
end

function dress_essart( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "glove_plain_right", "807a66" ) ;
	addCharacterPiece( name, "glove_plain_left", "807a66" ) ;
	addCharacterPiece( name, "boot_fancy_right", "ecd091" ) ;
	addCharacterPiece( name, "boot_fancy_left", "ecd091" );
	addCharacterPiece( name, "belt", "a1a1a1" ) ;
	addCharacterPiece( name, "pant_baggy_right", "a1a1a1" ) ;
	addCharacterPiece( name, "pant_baggy_left", "a1a1a1" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "f3de4b" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "ecd091" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "ecd091" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "a1a1a1" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "a1a1a1" ) ;
	addCharacterPiece( name, "mustache_b", "be9f4b" ) ;
	addCharacterPiece( name, "beard_c", "be9f4b" ) ;
	addCharacterPiece( name, "hair_long", "be9f4b" ) ;
	addCharacterPiece( name, "hat_plain" ) ;
	addCharacterPiece( name, "feather_hat_plain", "f3de4b" ) ;

	setMeleeWeapon( name, "sword_12" ) ;
	setRangedWeapon( name, "pistol_matchlock_1" ) ;
end

function runAI_essart( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_essart( name, chatWith )
	if ( isMissionComplete( "missionrochelle19" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "essart_d3" ) ) ;
		sayAndWait( name, getString( "essart_d3" ) ) ;
	elseif ( isMissionComplete( "missionrochelle10" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "essart_d2" ) ) ;
		sayAndWait( name, getString( "essart_d2" ) ) ;
	elseif ( isMissionComplete( "missionparis15" ) ) then
		-- generic knows dartagnan
		--autoDeleteFaceChat( name, chatWith, getString( "essart_d1" ) ) ;
		sayAndWait( name, getString( "essart_d1" ) ) ;
	else
		-- doesn't know dartagnan
		--autoDeleteFaceChat( name, chatWith, getString( "canihelp" ) ) ;
		sayAndWait( name, getString( "canihelp" ) ) ;
	end
end

-- doctor1
function init_doctor1( name )
end

function getDoctor1Level( )
	return "hoteldieuhouse" ;
end

function getDoctor1PosX( )
	return -304 ;
end

function getDoctor1PosY( )
	return 291 ;
end

function place_doctor1( name )
	placeCharacter( name, getDoctor1Level( ), getDoctor1PosX( ), getDoctor1PosY( ) ) ;
end

function dress_doctor1( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	--addCharacterPiece( name, "collar_big" ) ;
	--addCharacterPiece( name, "boot_sock_right", "ecd091" ) ;
	--addCharacterPiece( name, "boot_sock_left", "ecd091" );
	--addCharacterPiece( name, "sashbelt", "5f4927" ) ;
	--addCharacterPiece( name, "pant_baggy_right", "2211f7" ) ;
	--addCharacterPiece( name, "pant_baggy_left", "2211f7" ) ;
	--addCharacterPiece( name, "doublet_plain_torso", "b39f59" ) ;
	--addCharacterPiece( name, "doublet_plain_arm_right", "b39f59" ) ;
	--addCharacterPiece( name, "doublet_plain_arm_left", "b39f59" ) ;
	addCharacterPiece( name, "mustache_a", "8a8882" ) ;
	addCharacterPiece( name, "beard_a", "8a8882" ) ;
	addCharacterPiece( name, "hair_long", "8a8882" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "pant_monk_legs", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "191817" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "191817" ) ;
end


function runAI_doctor1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_doctor1( name, chatWith )
	chatDoctor( name, chatWith ) ;
end

-- bonacieux
function init_bonacieux( name )
end

function place_bonacieuxA( name )
	placeCharacter( name, "bonacieuxhouse", 35, -118 ) ;
end

function place_bonacieuxB( name )
	placeDead( name ) ;
end

function dress_bonacieux( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "hair_medium", "918877" ) ;
	addCharacterPiece( name, "beard_a", "918877" ) ;
	addCharacterPiece( name, "mustache_b", "918877" ) ;
	addCharacterPiece( name, "belt", "8c6a3d" ) ;
	addCharacterPiece( name, "boot_sock_right", "f1e5cc") ;
	addCharacterPiece( name, "boot_sock_left", "f1e5cc") ;
	addCharacterPiece( name, "shirt_plain_torso", "8b9177" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "8b9177" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "8b9177" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "f1e5cc" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "f1e5cc" ) ;
	addCharacterPiece( name, "pant_baggy_right", "8d370d" ) ;
	addCharacterPiece( name, "pant_baggy_left", "8d370d" ) ;

end

function runAI_bonacieux( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		if ( not characterHasGoal( name ) ) then
			if ( getCharacterLevel( name ) == "bonacieuxhouse" ) then
				-- not walking anywhere and on bottom floor of house
				setBaseFaceDirection( name, 0, 1 ) ;
			end
		end
		wait( 10 ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_bonacieux( name, chatWith )
	if ( isMissionComplete( "missionparisb5" ) ) then
		-- after boot argument
		if ( randomInt( 0, 2 ) == 0 ) then
			--autoDeleteFaceChat( name, chatWith, getString( "bonacieux_d2" ) ) ;
			sayAndWait( name, getString( "bonacieux_d2" ) ) ;
		else
			--autoDeleteFaceChat( name, chatWith, getString( "bonacieux_d3" ) ) ;
			sayAndWait( name, getString( "bonacieux_d3" ) ) ;
		end
	elseif ( isMissionComplete( "missionparis4" ) ) then
		-- rented room
		--autoDeleteFaceChat( name, chatWith, getString( "bonacieux_d1" ) ) ;
		sayAndWait( name, getString( "bonacieux_d1" ) ) ;
	else
		-- don't know bonacieux yet
		--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
		sayAndWait( name, getString( "hello" ) ) ;
	end
end

-- weapondealer1
function init_weapondealer1( name )
end

function place_weapondealer1( name )
	placeCharacter( name, "parisstorea", 0, 0 ) ;
end

function dress_weapondealer1( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = .9 ;
	local skinB = .9 ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_torso", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_arm_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_arm_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "boot_plain_right", "7a6a4c" ) ;
	addCharacterPiece( name, "boot_plain_left", "7a6a4c" ) ;
	addCharacterPiece( name, "glove_plain_right", "7a6a4c" ) ;
	addCharacterPiece( name, "glove_plain_left", "7a6a4c" ) ;
	addCharacterPiece( name, "belt", "7a6a4c" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "91bb4e" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "91bb4e" ) ;
	addCharacterPiece( name, "hair_long", "30240d") ;
	addCharacterPiece( name, "mustache_b", "30240d" ) ;

end

function runAI_weapondealer1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
	
		local destX = 43 ;
		local destY = -54 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisstorea", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		
		local hitVolume = 1.0 ;
		if ( getFacingDirection( name ) == "up" ) then
			playPositionSound( "blacksmith", hitVolume, "parisstorea", destX, destY ) ;
		end
		wait( 0.3 ) ;
		if ( getFacingDirection( name ) == "up" ) then
			playPositionSound( "blacksmith", hitVolume, "parisstorea", destX, destY ) ;
		end
		wait( 0.3 ) ;
		if ( getFacingDirection( name ) == "up" ) then
			playPositionSound( "blacksmith", hitVolume, "parisstorea", destX, destY ) ;
		end
		wait( 2.0 ) ;
		if ( getFacingDirection( name ) == "up" ) then
			playPositionSound( "blacksmith", hitVolume, "parisstorea", destX, destY ) ;
		end
		wait( 0.3 ) ;
		if ( getFacingDirection( name ) == "up" ) then
			playPositionSound( "blacksmith", hitVolume, "parisstorea", destX, destY ) ;
		end
		wait( 0.3 ) ;
		if ( getFacingDirection( name ) == "up" ) then
			playPositionSound( "blacksmith", hitVolume, "parisstorea", destX, destY ) ;
		end 
		wait( 0.3 ) ;
		if ( getFacingDirection( name ) == "up" ) then
			playPositionSound( "blacksmith", hitVolume, "parisstorea", destX, destY ) ;
		end
		wait( 2.0 ) ;
		
		destX = 0 ;
		destY = -20 ;
		addGoalGetToPointInLevel( name, destX, destY, "parisstorea", false ) ;
		setBaseFaceDirection( name, -1, 0 ) ;
		waitForNoGoal( name ) ;
		
		wait( 5 ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function getRelevantItems( itemList, numPrevious, numNext, numBefore, numAfter )
	local playerLevel = getPlayerLevel( ) ;
			
	local numItems = table.getn( itemList ) ;
	local maxLevel = 30 ;
	
	if ( playerLevel > maxLevel ) then
		playerLevel = maxLevel ;
	end
	
	local playerToItemLevels = ( numItems + numAfter * 1.0 ) / ( maxLevel ) ;
	local itemNum = math.floor( playerLevel * playerToItemLevels) + numBefore ;
	if ( itemNum <= 1 ) then
		itemNum = 1 ;
	end
	if ( itemNum > numItems ) then
		itemNum = numItems ;
	end
	DEBUG_OUTPUT( itemNum ) ;
	
	local minItem = itemNum - numPrevious ;
	local maxItem = itemNum + numNext ;
	
	local showItemIndices = {} ;
	table.insert( showItemIndices, minItem - 18 ) ;
	table.insert( showItemIndices, minItem - 14 ) ;
	table.insert( showItemIndices, minItem - 10 ) ;
	table.insert( showItemIndices, minItem - 7 ) ;
	table.insert( showItemIndices, minItem - 4 ) ;
	table.insert( showItemIndices, minItem - 2 ) ;
	for i=minItem, maxItem do
		table.insert( showItemIndices, i ) ;
	end
	table.insert( showItemIndices, maxItem + 2 ) ;
	table.insert( showItemIndices, maxItem + 4 ) ;
	table.insert( showItemIndices, maxItem + 7 ) ;
	table.insert( showItemIndices, maxItem + 10 ) ;
	table.insert( showItemIndices, maxItem + 14 ) ;
	table.insert( showItemIndices, maxItem + 18 ) ;
	
	useItems = {} ;
	
	for i, v in pairs(showItemIndices) do
		if ( v >= 1 and v <= numItems ) then
			table.insert( useItems, itemList[ v ] ) ;
		end
	end
	
	return useItems ;
end

function chat_weapondealer1( name, chatWith )

	local swords = { 
		"sword_1", 
		"sword_2", 
		"sword_3", 
		"sword_4", 
		"sword_5", 
		"sword_6", 
		"sword_7", 
		"sword_8", 
		"sword_9", 
		"sword_10", 
		"sword_11", 
		"sword_12", 
		"sword_13", 
		"sword_14", 
		"sword_15",
		"sword_16", 
		"sword_18", 
		"sword_21", 
		"sword_23" } ;

	local pistols = { 
		"pistol_matchlock_1", 
		"pistol_matchlock_2", 
		"pistol_matchlock_3", 
		"pistol_matchlock_4", 
		"pistol_matchlock_5", 
		"pistol_wheellock_1", 
		"pistol_wheellock_2", 
		"pistol_wheellock_3", 
		"pistol_wheellock_4", 
		"pistol_wheellock_5", 
		"pistol_snaplock_1", 
		"pistol_snaplock_3", 
		"pistol_snaphance_1", 
		"pistol_snaphance_3" } ;

	local muskets = { 
		"musket_matchlock_1", 
		"musket_matchlock_2", 
		"musket_matchlock_3", 
		"musket_matchlock_4", 
		"musket_matchlock_5", 
		"musket_wheellock_1", 
		"musket_wheellock_2", 
		"musket_wheellock_3", 
		"musket_wheellock_4", 
		"musket_wheellock_5", 
		"musket_snaplock_1", 
		"musket_snaplock_3", 
		"musket_snaphance_1",
		"musket_snaphance_3" } ;

	chat_weapondealers( name, chatWith, swords, pistols, muskets ) ;
end

function chat_weapondealers( name, chatWith, swords, pistols, muskets )
	local hasUnbrokenSword = numOfItemType( "sword_broken" ) > 0 ;

	local bubInd = characterSay( name, true, -1, -1, true, getString( "vendor_d1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	
	if ( hasUnbrokenSword ) then
		bubInd = characterSay( chatWith, false, -1, -1, true, getString( "vendor_d2" ), getString( "vendor_d3" ), getString( "vendor_d4" ), getString( "weapondealer_d1" ), getString( "vendor_d5" ) ) ;
	else
		bubInd = characterSay( chatWith, false, -1, -1, true, getString( "vendor_d2" ), getString( "vendor_d3" ), getString( "vendor_d4" ), getString( "vendor_d5" ) ) ;
	end
	
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 0 ) then
		-- buy goods
		local items = { "ointment" } ;
		
		local showSwords = swords ; --getRelevantItems( swords, 5, 5, 0, 0 ) ;
		
		for i, v in pairs(showSwords) do
			table.insert( items, v ) ;
		end

		if ( getBoolean( "gunsAvailable" ) ) then
			local showPistols = pistols ; -- getRelevantItems( pistols, 5, 5, 1, 7 ) ;
			for i, v in pairs(showPistols) do
				table.insert( items, v ) ;
			end
			
			local showMuskets = muskets ; -- getRelevantItems( muskets, 5, 5, 1, 7 ) ;
			for i, v in pairs(showMuskets) do
				table.insert( items, v ) ;
			end
		end
		
		activateBuyScreen( items ) ;
		while ( isBuyScreenShowing( ) ) do
			coroutine.yield( ) ;
		end
		
		--local bubInd = characterSay( name, true, -1, BUBBLE_PROX_N, true, getString( "vendor_d6" ) ) ;
		--autoDeleteBubble( bubInd ) ;
		sayAndWait( name, getString( "vendor_d6" ) ) ;

	elseif ( option == 1 ) then
		-- sell goods
		activateSellScreen( ) ;
		while ( isSellScreenShowing( ) ) do
			coroutine.yield( ) ;
		end
		
		--local bubInd = characterSay( name, true, -1, BUBBLE_PROX_N, true, getString( "vendor_d6" ) ) ;
		--autoDeleteBubble( bubInd ) ;
		sayAndWait( name, getString( "vendor_d6" ) ) ;
	else
		if ( ( option == 2 ) and hasUnbrokenSword ) then
			local bubInd = characterSay( name, true, -1, -1, true, getString( "weapondealer_d2" ) ) ;
			waitForBubbleClosed( bubInd ) ;
			playSound( "blacksmith", 1.0 ) ;
			wait( 0.3 ) ;
			playSound( "blacksmith", 1.0 ) ;
			wait( 0.3 ) ;
			playSound( "blacksmith", 1.0 ) ;
			wait( 1.0 ) ;
			bubInd = characterSay( name, true, -1, -1, true, getString( "weapondealer_d3" ) ) ;
			waitForBubbleClosed( bubInd ) ;
			bubInd = characterSay( "dartagnan", true, -1, -1, true, getString( "weapondealer_d4" ) ) ;
			waitForBubbleClosed( bubInd ) ;
			
			-- switch out broken sword for father's sword
			if ( numOfItemType( "sword_broken" ) > 0 ) then
				local brokenWasEquipped = isItemEquipped( "sword_broken" ) ;
				if ( brokenWasEquipped ) then
					unequipItem( "sword_broken" ) ;
				end
				setInventoryItem( "sword_broken", 0 ) ;
				setInventoryItem( "sword_dart", 1 ) ;
				if ( brokenWasEquipped ) then
					-- only equip new sword if we had broken sword equipped
					equipItem( "sword_dart" ) ;
				end
			end
		else
			-- leave
			--local bubInd = characterSay( name, true, -1, BUBBLE_PROX_N, true, getString( "vendor_d7" ) ) ;
			--autoDeleteBubble( bubInd ) ;
			sayAndWait( name, getString( "vendor_d7" ) ) ;
		end
	end
	
	if ( isMissionActive( "missionparis16" ) and ( not hasRangedWeapon( ) ) ) then
		-- player needs to buy a ranged weapon, but they haven't done so
		--local bubInd = characterThink( "dartagnan", true, -1, BUBBLE_PROX_N, true, getString( "mp16d1" ) ) ;
		--autoDeleteBubble( bubInd ) ;
		local bubInd = characterThink( "dartagnan", true, -1, -1, true, getString( "mp16d1" ) ) ;
		waitForBubbleClosed( bubInd ) ;
	end
end

-- Athos
function init_athos( name )
	setAllowPermanentDeath( name, false ) ;
	setHasLootDrop( name, false ) ;
	setStatsCalculatorCustom( name, "athos" ) ;
	setStatsAlwaysRecalc( name, true ) ;
end

function getAthosALevel( )
	return "athoshouse2" ;
end

function getAthosAPosX( )
	return 37 ;
end

function getAthosAPosY( )
	return -133 ;
end

function place_athosA( name )
	placeCharacter( name, getAthosALevel( ), getAthosAPosX( ), getAthosAPosY( ) ) ;
end

function place_athosB( name )
	placeCharacter( name, "lirdorhouse3", -46, -222 ) ;
end

function dress_athosA( name )
	clearCharacterPieces( name ) ;
	local darkness = 0.85 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "glove_plain_right", "cec9c2" ) ;
	addCharacterPiece( name, "glove_plain_left", "cec9c2" ) ;
	addCharacterPiece( name, "boot_fancy_right", "adaaa4") ;
	addCharacterPiece( name, "boot_fancy_left", "adaaa4") ;
	addCharacterPiece( name, "hair_short", "2b2011" ) ;
	addCharacterPiece( name, "beardmus", "2b2011" ) ;
	addCharacterPiece( name, "belt", "adaaa4" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "a17b71" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "a17b71" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "baa999" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "baa999" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "baa999" ) ;
	--addCharacterPiece( name, "tabbard", 0.2, 0.2, 1.0, 1.0 ) ;
	--addCharacterPiece( name, "tabbard_overlay" ) ;
	
	setMeleeWeapon( name, "sword_1" ) ;
	removeRangedWeapon( name ) ;
end

function dress_athosB( name )
	dress_athosA( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function setownedhorse_athosA( name )
	setOwnedHorse( name, "athoshorse1" ) ;
end

function setownedhorse_athosB( name )
	removeOwnedHorse( name ) ;
end

function setownedhorse_athosC( name )
	setOwnedHorse( name, "grimaudhorse" ) ;
end

function runAI_athos( name )
	while ( true ) do
		if ( isMissionComplete( "missionparisb11" ) ) then
			-- back to default
			setBaseFaceDirection( name, 0, 1 ) ;
		elseif ( isMissionComplete( "missionlondon3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
		else
			setBaseFaceDirection( name, 0, 1 ) ;
		end
		
		wait( 1 ) ;
	end
end

function chat_athos( name, chatWith )
	if ( not chatBusy( name, chatWith ) ) then
		if ( getCharacterLevel( name ) == "athoshouse2" ) then
			if ( isMissionComplete( "missionparis8" ) ) then
				-- after athos fight
				local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "athos_d1" ), getString( "athos_d2" ), getString( "athos_d3" ), getString( "athos_d3_5" ) ) ;
				local option = waitForBubbleOption( bubInd ) ;
				if ( option == 0 ) then
					sayAndWait( name, getString( "athos_d4" ) ) ;
				elseif ( option == 1 ) then
					sayAndWait( name, getString( "athos_d5" ) ) ;
				elseif ( option == 2 ) then
					sayAndWait( name, getString( "athos_d6" ) ) ;
				else
					-- athos does nothing
				end
			else
				-- doesn't know dartagnan
				--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
				sayAndWait( name, getString( "hello" ) ) ;
			end
		end
	end
end

-- Grimaud
function init_grimaud( name )
	setAllowPermanentDeath( name, false ) ;
	setHasLootDrop( name, false ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function getGrimaudALevel( )
	return "athoshouse2" ;
end

function getGrimaudAPosX( )
	return 166 ;
end

function getGrimaudAPosY( )
	return -102 ;
end

function place_grimaudA( name )
	placeCharacter( name, getGrimaudALevel( ), getGrimaudAPosX( ), getGrimaudAPosY( ) ) ;
end

function place_grimaudB( name )
	placeCharacter( name, "lirdorhouse3", -208, -188 ) ;
end

function dress_grimaudA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt", "bd9826" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "boot_plain_right", "a0543d" ) ;
	addCharacterPiece( name, "boot_plain_left", "a0543d" );
	addCharacterPiece( name, "beard_b", "694431" ) ;
	addCharacterPiece( name, "hair_medium", "694431" ) ;
	addCharacterPiece( name, "mustache_a", "694431" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "b7887b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "b6b6b6" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "b6b6b6" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "d6cdb1" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "d6cdb1" ) ;
end

function setownedhorse_grimaudA( name )
	setOwnedHorse( name, "grimaudhorse" ) ;
end

function setownedhorse_grimaudB( name )
	removeOwnedHorse( name ) ;
end

function runAI_grimaud( name )
	while ( true ) do
		if ( isMissionComplete( "missionparisb11" ) ) then
			-- back to default
			setBaseFaceDirection( name, -1, 0 ) ;
		elseif ( isMissionComplete( "missionlondon3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
		else
			setBaseFaceDirection( name, -1, 0 ) ;
		end
		
		wait( 1 ) ;
	end
end

function chat_grimaud( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "grimaud_d1" ) ) ;
	sayAndWait( name, getString( "grimaud_d1" ) ) ;
end

-- Porthos
function init_porthos( name )
	setAllowPermanentDeath( name, false ) ;
	setHasLootDrop( name, false ) ;
	setStatsCalculatorCustom( name, "porthos" ) ;
	setStatsAlwaysRecalc( name, true ) ;
end

function getPorthosALevel( )
	return "france" ;
end

function getPorthosAPosX( )
	return 307 ;
end

function getPorthosAPosY( )
	return 2080 ;
end

function place_porthosA( name )
	placeCharacter( name, getPorthosALevel( ), getPorthosAPosX( ), getPorthosAPosY( ) ) ;
end

function place_porthosB( name )
	placeCharacter( name, "stmartinhouse2", -288, 53 ) ;
end

function place_porthosC( name )
	placeCharacter( name, "coquenardhouse", -291, 135 ) ;
end

function dress_porthosA( name )
	clearCharacterPieces( name ) ;
	local darkness = 0.90 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_fancy", 1,1, 1, .9 ) ;
	addCharacterPiece( name, "glove_plain_right", "8c7161" ) ;
	addCharacterPiece( name, "glove_plain_left", "8c7161" ) ;
	addCharacterPiece( name, "boot_fancy_right", "8c7161") ;
	addCharacterPiece( name, "boot_fancy_left", "8c7161") ;
	addCharacterPiece( name, "hair_curly", "593b29" ) ;
	addCharacterPiece( name, "beard_c", "593b29" ) ;
	addCharacterPiece( name, "mustache_b", "593b29" ) ;
	addCharacterPiece( name, "belt", "7c7571" ) ;
	addCharacterPiece( name, "sashbelt", "ddd142" ) ;
	addCharacterPiece( name, "cloak_mini", "ca3e3e" ) ;
	addCharacterPiece( name, "hat_plain", "7d6545" ) ;
	addCharacterPiece( name, "feather_hat_fancy" ) ;
	addCharacterPiece( name, "pant_baggy_right", "bb9b88" ) ;
	addCharacterPiece( name, "pant_baggy_left", "bb9b88" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left" ) ;
	addCharacterPiece( name, "stripe_plain_torso" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "4262c0" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "4262c0" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "4262c0" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "4262c0" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "4262c0" ) ;
	--addCharacterPiece( name, "tabbard", 0.2, 0.2, 1.0, 1.0 ) ;
	--addCharacterPiece( name, "tabbard_overlay" ) ;
	
	setMeleeWeapon( name, "sword_1" ) ;
	removeRangedWeapon( name ) ;
end

function dress_porthosB( name )
	clearCharacterPieces( name ) ;
	local darkness = 0.90 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_fancy", 1,1, 1, .9 ) ;
	addCharacterPiece( name, "glove_plain_right", "8c7161" ) ;
	addCharacterPiece( name, "glove_plain_left", "8c7161" ) ;
	addCharacterPiece( name, "boot_fancy_right", "8c7161") ;
	addCharacterPiece( name, "boot_fancy_left", "8c7161") ;
	addCharacterPiece( name, "hair_curly", "593b29" ) ;
	addCharacterPiece( name, "beard_c", "593b29" ) ;
	addCharacterPiece( name, "mustache_b", "593b29" ) ;
	addCharacterPiece( name, "belt", "7c7571" ) ;
	addCharacterPiece( name, "sashbelt", "8c7161" ) ;
	addCharacterPiece( name, "hat_plain", "7d6545" ) ;
	addCharacterPiece( name, "feather_hat_fancy" ) ;
	addCharacterPiece( name, "pant_baggy_right", "bb9b88" ) ;
	addCharacterPiece( name, "pant_baggy_left", "bb9b88" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left" ) ;
	addCharacterPiece( name, "stripe_plain_torso" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "4262c0" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "4262c0" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "4262c0" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "4262c0" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "4262c0" ) ;

	--addCharacterPiece( name, "tabbard", 0.2, 0.2, 1.0, 1.0 ) ;
	--addCharacterPiece( name, "tabbard_overlay" ) ;
	
	setMeleeWeapon( name, "sword_1" ) ;
	removeRangedWeapon( name ) ;
end

function dress_porthosC( name )
	dress_porthosB( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function setownedhorse_porthosA( name )
	setOwnedHorse( name, "porthoshorse1" ) ;
end

function setownedhorse_porthosB( name )
	removeOwnedHorse( name ) ;
end

function setownedhorse_porthosC( name )
	setOwnedHorse( name, "mousquetonhorse" ) ;
end

function runAI_porthos( name )
	while ( true ) do
		if ( isMissionComplete( "missionrochelle19" ) ) then
			-- in coquenard house
			setBaseFaceDirection( name, 1, 0 ) ;
		elseif ( isMissionComplete( "missionparisb11" ) ) then
			-- back to default
			setBaseFaceDirection( name, 0, 1 ) ;
		elseif ( isMissionComplete( "missionlondon1" ) ) then
			setBaseFaceDirection( name, 0, -1 ) ;
		else
			setBaseFaceDirection( name, 0, 1 ) ;
		end
		
		wait( 1 ) ;
	end
end

function chat_porthos( name, chatWith )
	local atHouse = distanceToPoint( name, getPorthosALevel( ), getPorthosAPosX( ), getPorthosAPosY( ) ) < 200 ;
	
	if ( not chatBusy( name, chatWith ) ) then
		if ( isMissionComplete( "missionrochelle19" ) ) then
			-- game over
			--autoDeleteFaceChat( name, chatWith, getString( "porthos_d9" ) ) ;
			sayAndWait( name, getString( "porthos_d9" ) ) ;
		elseif ( isMissionComplete( "missionparis8" ) ) then
			-- after athos fight
			if ( atHouse ) then
				local randTalk = randomInt( 1, 9 ) ;
				--autoDeleteFaceChat( name, chatWith, getString( "porthos_d" .. randTalk ) ) ;
				sayAndWait( name, getString( "porthos_d" .. randTalk ) ) ;
			end
		else	
			--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
			sayAndWait( name, getString( "hello" ) ) ;
		end
	end
end

-- Mousqueton
function init_mousqueton( name )
	setAllowPermanentDeath( name, false ) ;
	setHasLootDrop( name, false ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function getMousquetonALevel( )
	return "france" ;
end

function getMousquetonAPosX( )
	return 359 ;
end

function getMousquetonAPosY( )
	return 2068 ;
end

function place_mousquetonA( name )
	placeCharacter( name, getMousquetonALevel( ), getMousquetonAPosX( ), getMousquetonAPosY( ) ) ;
end

function place_mousquetonB( name )
	placeCharacter( name, "stmartinhouse2", -332, 30 ) ;
end

function place_mousquetonC( name )
	placeCharacter( name, "coquenardhouse", -235, -54 ) ;
end

function dress_mousquetonA( name )
	clearCharacterPieces( name ) ;
	local darkness = 0.90 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "boot_fancy_right", "8a713c" ) ;
	addCharacterPiece( name, "boot_fancy_left", "8a713c" );
	addCharacterPiece( name, "sashbelt", "927c51" ) ;
	addCharacterPiece( name, "belt", "8a713c" ) ;
	addCharacterPiece( name, "pant_baggy_right", "83714d" ) ;
	addCharacterPiece( name, "pant_baggy_left", "83714d" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "cba454" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "cba454" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "cba454" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "e2d3b3" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e2d3b3" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "c45436" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "c45436" ) ;
	addCharacterPiece( name, "mustache_a", "6d5a33" ) ;
	addCharacterPiece( name, "hat_simple", "8a713c" ) ;
	addCharacterPiece( name, "feather_hat_small", "c25235" ) ;
	
	setMeleeWeapon( name, "sword_1" ) ;
end

function setownedhorse_mousquetonA( name )
	setOwnedHorse( name, "mousquetonhorse" ) ;
end

function setownedhorse_mousquetonB( name )
	removeOwnedHorse( name ) ;
end

function runAI_mousqueton( name )
	while ( true ) do
		if ( isMissionComplete( "missionrochelle19" ) ) then
			-- in coquenard house
			setBaseFaceDirection( name, 0, 1 ) ;
		elseif ( isMissionComplete( "missionparisb11" ) ) then
			-- back to default
			setBaseFaceDirection( name, 0, 1 ) ;
		elseif ( isMissionComplete( "missionlondon1" ) ) then
			setBaseFaceDirection( name, 1, 1 ) ;
		else
			setBaseFaceDirection( name, 0, 1 ) ;
		end
		
		wait( 1 ) ;
	end
end

function chat_mousqueton( name, chatWith )
	local atHouse = distanceToPoint( name, getMousquetonALevel( ), getMousquetonAPosX( ), getMousquetonAPosY( ) ) < 200 ;
	
	if ( not chatBusy( name, chatWith ) ) then
		if ( isMissionComplete( "missionrochelle19" ) ) then
			-- game over
			--autoDeleteFaceChat( name, chatWith, getString( "mousqueton_d2" ) ) ;
			sayAndWait( name, getString( "mousqueton_d2" ) ) ;
		elseif ( isMissionComplete( "missionparis8" ) ) then
			-- after athos fight
			if ( atHouse ) then
				--autoDeleteFaceChat( name, chatWith, getString( "mousqueton_d1" ) ) ;
				sayAndWait( name, getString( "mousqueton_d1" ) ) ;
			end
		else
			-- doesn't know us
			--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
			sayAndWait( name, getString( "hello" ) ) ;
		end
	end
end

-- Aramis
function init_aramis( name )
	setAllowPermanentDeath( name, false ) ;
	setHasLootDrop( name, false ) ;
	setStatsCalculatorCustom( name, "aramis" ) ;
	setStatsAlwaysRecalc( name, true ) ;
end

function getAramisALevel( )
	return "aramishouse" ;
end

function getAramisAPosX( )
	return -9 ;
end

function getAramisAPosY( )
	return -163 ;
end

function place_aramisA( name )
	placeCharacter( name, getAramisALevel( ), getAramisAPosX( ), getAramisAPosY( ) ) ;
end

function place_aramisB( name )
	placeCharacter( name, "crevecoeurhousea2", -11, 61 ) ;
end

function setownedhorse_aramisC( name )
	setOwnedHorse( name, "bazinhorse" ) ;
end

function dress_aramisA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "glove_plain_right", "a9987b" ) ;
	addCharacterPiece( name, "glove_plain_left", "a9987b" ) ;
	addCharacterPiece( name, "boot_plain_right", "42352e") ;
	addCharacterPiece( name, "boot_plain_left", "42352e") ;
	addCharacterPiece( name, "hair_medium", "92773d" ) ;
	addCharacterPiece( name, "beard_b", "92773d" ) ;
	addCharacterPiece( name, "mustache_b", "92773d" ) ;
	addCharacterPiece( name, "belt", "a9987b" ) ;
	addCharacterPiece( name, "pant_baggy_right", "826739" ) ;
	addCharacterPiece( name, "pant_baggy_left", "826739" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "3d3d3d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "3d3d3d"  ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "3d3d3d" ) ;
	--addCharacterPiece( name, "tabbard", 0.2, 0.2, 1.0, 1.0 ) ;
	--addCharacterPiece( name, "tabbard_overlay" ) ;
	--addCharacterPiece( name, "feather_hat_plain", "e21f15" ) ;
	--addCharacterPiece( name, "hat_plain", "9b9393" ) ;

	setMeleeWeapon( name, "sword_1" ) ;
	removeRangedWeapon( name ) ;
end

function dress_aramisB( name )
	dress_aramisA( name ) ;
	setRangedWeapon( name, "musket_matchlock_1" ) ;
end

function setownedhorse_aramisA( name )
	setOwnedHorse( name, "aramishorse1" ) ;
end

function setownedhorse_aramisB( name )
	removeOwnedHorse( name ) ;
end

function runAI_aramis( name )
	while ( true ) do
		if ( isMissionComplete( "missionparisb11" ) ) then
			-- back to default
			setBaseFaceDirection( name, 0, -1 ) ;
		elseif ( isMissionComplete( "missionlondon2" ) ) then
			setBaseFaceDirection( name, 0, -1 ) ;
		else
			setBaseFaceDirection( name, 0, -1 ) ;
		end

		wait( 1 ) ;
	end
end

function chat_aramis( name, chatWith )
	if ( not chatBusy( name, chatWith ) ) then
		if ( getCharacterLevel( name ) == "aramishouse" ) then
			if ( isMissionComplete( "missionrochelle19" ) ) then
				-- game over
				--autoDeleteFaceChat( name, chatWith, getString( "aramis_d11" ) ) ;
				sayAndWait( name, getString( "aramis_d11" ) ) ;
			elseif ( isMissionComplete( "missionparis8" ) ) then
				-- after athos fight
				local randTalk = randomInt( 0, 3 ) ;
				if ( randTalk == 0 ) then
					-- aramis wants to recite poem
					sayAndWait( name, getString( "aramis_d1" ) ) ;
					
					local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "aramis_d2" ), getString( "aramis_d3" ) ) ;
					local option = waitForBubbleOption( bubInd ) ;
					if ( option == 1 ) then
						-- accept to hear about poem
						sayAndWait( name, getString( "aramis_d4" ) ) ;
						sayAndWait( name, getString( "aramis_d5" ) ) ;
						sayAndWait( "dartagnan", getString( "aramis_d6" ) ) ;
					else
						-- already heard about poem
					end
				elseif ( randTalk == 1 ) then
					--autoDeleteFaceChat( name, chatWith, getString( "aramis_d7" ) ) ;
					sayAndWait( name, getString( "aramis_d7" ) ) ;
				else
					sayAndWait( "dartagnan", getString( "aramis_d8" ) ) ;
					sayAndWait( name, getString( "aramis_d9" ) ) ;
				end
			else
				-- doesn't know dartagnan
				--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
				sayAndWait( name, getString( "hello" ) ) ;
			end
		end
	end
end

-- Bazin
function init_bazin( name )
	setAllowPermanentDeath( name, false ) ;
	setHasLootDrop( name, false ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function getBazinALevel( )
	return "aramishouse" ;
end

function getBazinAPosX( )
	return 113 ;
end

function getBazinAPosY( )
	return -146 ;
end

function place_bazinA( name )
	placeCharacter( name, getBazinALevel( ), getBazinAPosX( ), getBazinAPosY( ) ) ;
end

function place_bazinB( name )
	placeCharacter( name, "crevecoeurhousea2", -143, -232 ) ;
end

function dress_bazinA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "boot_sock_right", "928e87" ) ;
	addCharacterPiece( name, "boot_sock_left", "928e87" ) ;
	addCharacterPiece( name, "hair_short", "edc97b" ) ;	
	addCharacterPiece( name, "beard_b", "edc97b" ) ;	
	addCharacterPiece( name, "mustache_a", "edc97b" ) ;	
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "524a3a" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "524a3a" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "524a3a" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "251d0c" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "251d0c" ) ;

	setMeleeWeapon( name, "sword_1" ) ;
end

function setownedhorse_bazinA( name )
	setOwnedHorse( name, "bazinhorse" ) ;
end

function setownedhorse_bazinB( name )
	removeOwnedHorse( name ) ;
end

function runAI_bazin( name )
	while ( true ) do
		if ( isMissionComplete( "missionparisb11" ) ) then
			-- back to default
			setBaseFaceDirection( name, 0, 1 ) ;
		elseif ( isMissionComplete( "missionlondon2" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
		else
			setBaseFaceDirection( name, 0, 1 ) ;
		end

		wait( 1 ) ;
	end
end

function chat_bazin( name, chatWith )
	if ( not chatBusy( name, chatWith ) ) then
		if ( getCharacterLevel( name ) == "aramishouse" ) then
			if ( isMissionComplete( "missionrochelle19" ) ) then
				-- game over
				--autoDeleteFaceChat( name, chatWith, getString( "bazin_d4" ) ) ;
				sayAndWait( name, getString( "bazin_d4" ) ) ;
			elseif ( isMissionComplete( "missionparis21" ) ) then
				-- after mousetrap (when should Bazin begin to hate you?)
				local randTalk = randomInt( 0, 3 ) ;
				if ( randTalk == 0 ) then
					-- aramis wants to recite poem
					--autoDeleteFaceChat( name, chatWith, getString( "bazin_d1" ) ) ;
					sayAndWait( name, getString( "bazin_d1" ) ) ;
				elseif ( randTalk == 1 ) then
					--autoDeleteFaceChat( name, chatWith, getString( "bazin_d2" ) ) ;
					sayAndWait( name, getString( "bazin_d2" ) ) ;
				else
					--autoDeleteFaceChat( name, chatWith, getString( "bazin_d3" ) ) ;
					sayAndWait( name, getString( "bazin_d3" ) ) ;
				end
			elseif ( isMissionComplete( "missionparis8" ) ) then
				-- after athos fight
				--autoDeleteFaceChat( name, chatWith, getString( "bazin_d5" ) ) ;
				sayAndWait( name, getString( "bazin_d5" ) ) ;
			else
				-- doesn't know dartagnan
				--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
				sayAndWait( name, getString( "hello" ) ) ;
			end
		end
	end
end

-- Louis XIII
function init_louisxiii( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function getLouisXIIILevel( )
	return "louvrehouse2" ;
end

function getLouisXIIIPosX( )
	return -271 ;
end

function getLouisXIIIPosY( )
	return -249 ;
end

function place_louisxiiiA( name )
	placeCharacter( name, getLouisXIIILevel( ), getLouisXIIIPosX( ), getLouisXIIIPosY( ) ) ;
end

function place_louisxiiiB( name )
	-- rochelle
	placeCharacter( name, "france", -8480, 9630 ) ;
end

function dress_louisxiiiA( name )
	clearCharacterPieces( name ) ;
	local darkness = 1.0 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1, .80 ) ;
	addCharacterPiece( name, "glove_plain_right", "b29e63" ) ;
	addCharacterPiece( name, "glove_plain_left", "b29e63" ) ;
	addCharacterPiece( name, "hair_curly", 0, 0, 0) ;
	addCharacterPiece( name, "mustache_a", 0, 0, 0) ;
	addCharacterPiece( name, "beard_c", 0, 0, 0 ) ;
	addCharacterPiece( name, "boot_fancy_right", "b29e63" ) ;
	addCharacterPiece( name, "boot_fancy_left", "b29e63" );
	addCharacterPiece( name, "pant_baggy_right", "9e4831" ) ;
	addCharacterPiece( name, "pant_baggy_left", "9e4831" ) ;
	addCharacterPiece( name, "sashbelt", "96c0f2" ) ;
	addCharacterPiece( name, "belt", "b29e63" ) ;
	addCharacterPiece( name, "king", "577133" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "f4d67e" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "f4d67e"  ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "f4d67e"  ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "d3bf85" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "d3bf85" ) ;

end

function dress_louisxiiiB( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1, .80 ) ;
	addCharacterPiece( name, "glove_plain_right", "f0e5c2" ) ;
	addCharacterPiece( name, "glove_plain_left", "f0e5c2" ) ;
	addCharacterPiece( name, "hair_curly", 0, 0, 0) ;
	addCharacterPiece( name, "mustache_a", 0, 0, 0) ;
	addCharacterPiece( name, "beard_c", 0, 0, 0 ) ;
	addCharacterPiece( name, "boot_fancy_right", "afa996" ) ;
	addCharacterPiece( name, "boot_fancy_left", "afa996" );
	addCharacterPiece( name, "pant_baggy_right", "f4d67e" ) ;
	addCharacterPiece( name, "pant_baggy_left", "f4d67e" ) ;
	addCharacterPiece( name, "sashbelt", "f2cd65" ) ;
	addCharacterPiece( name, "belt", "eadcb4" ) ;
	addCharacterPiece( name, "king", "f5d064" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "c3ac97" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "c3ac97"  ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "c3ac97"  ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "c3ac97" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "c3ac97" ) ;

end

function runAI_louisxiii( name )
	if ( isMissionComplete( "missionrochelle7" ) ) then
		-- rochelle
		while ( true ) do
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, -1, -1 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_louisxiii( name, chatWith )
	if ( isMissionComplete( "missionrochelle19" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "louisxiii_d6" ) ) ;
		sayAndWait( name, getString( "louisxiii_d6" ) ) ;
	elseif ( isMissionComplete( "missionrochelle10" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "louisxiii_d5" ) ) ;
		sayAndWait( name, getString( "louisxiii_d5" ) ) ;
	elseif ( isMissionComplete( "missionrochelle7" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "louisxiii_d4" ) ) ;
		sayAndWait( name, getString( "louisxiii_d4" ) ) ;
	elseif ( isMissionComplete( "missionparisb2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "louisxiii_d3" ) ) ;
		sayAndWait( name, getString( "louisxiii_d3" ) ) ;
	elseif ( isMissionComplete( "missionparis13" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "louisxiii_d2" ) ) ;
		sayAndWait( name, getString( "louisxiii_d2" ) ) ;
	else
		-- king doesn't know him
		--autoDeleteFaceChat( name, chatWith, getString( "louisxiii_d1" ) ) ;
		sayAndWait( name, getString( "louisxiii_d1" ) ) ;
	end
end

-- Cardinal
function init_cardinal( name )
end

function getCardinalLevel( )
	return "cardinalhouse" ;
end

function getCardinalPosX( )
	return 18 ;
end

function getCardinalPosY( )
	return -967 ;
end

function place_cardinalA( name )
	placeCharacter( name, getCardinalLevel( ), getCardinalPosX( ), getCardinalPosY( ) ) ;
end

function getCardinalLevelB( )
	return "france" ;
end

function getCardinalPosXB( )
	return -9112 ;
end

function getCardinalPosYB( )
	return 9427 ;
end

function place_cardinalB( name )
	placeCharacter( name, getCardinalLevelB( ), getCardinalPosXB( ), getCardinalPosYB( ) ) ;
end

function dress_cardinalA( name )
	clearCharacterPieces( name ) ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "rich" ) ;
	addCharacterPiece( name, "beard_b", 0.63, 0.63, 0.63 ) ;
	addCharacterPiece( name, "hair_short", 0.63, 0.63, 0.63 ) ;
	addCharacterPiece( name, "mustache_b", 0.63, 0.63, 0.63 ) ;
	addCharacterPiece( name, "cloak_holy", 0.73, 0.06, 0.06) ;
	addCharacterPiece( name, "hat_holy", 0.73, 0.06, 0.06) ;
	addCharacterPiece( name, "shirt_plain_arm_right", 0.73, 0.06, 0.06) ;
	addCharacterPiece( name, "shirt_plain_arm_left", 0.73, 0.06, 0.06) ;
	addCharacterPiece( name, "shirt_plain_torso", 0.73, 0.06, 0.06) ;
	addCharacterPiece( name, "pant_monk_legs", 0.73, 0.06, 0.06) ;
end

function dress_cardinalB( name )
	clearCharacterPieces( name ) ;
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "hair_short", "a0a0a0" ) ;
	addCharacterPiece( name, "beard_b", "a0a0a0" ) ;
	addCharacterPiece( name, "mustache_b", "a0a0a0" ) ;
	addCharacterPiece( name, "belt" ) ;
	addCharacterPiece( name, "boot_fancy_right", "b91010") ;
	addCharacterPiece( name, "boot_fancy_left", "b91010") ;
	addCharacterPiece( name, "pant_musketeer_right", "4e4747" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "4e4747" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "b91010" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "b91010" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "b91010" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left" ) ;
	addCharacterPiece( name, "stripe_plain_torso" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "ae5bb6" ) ;
	addCharacterPiece( name, "hat_plain", "b91010" ) ;
	addCharacterPiece( name, "rich" ) ;
	
end

function runAI_cardinal( name )
	if ( isMissionComplete( "missionparisb34" ) ) then
		-- at La Rochelle
		while ( true ) do
			setBaseFaceDirection( name, -1, 1 ) ;
			wait( 1 ) ;
		end
	else
		-- normal
		while ( true ) do
			setBaseFaceDirection( name, 0, -1 ) ;
			wait( 1 ) ;
		end
	end
end

function chat_cardinal( name, chatWith )
	if ( isMissionComplete( "missionparisb34" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "cardinal_d5" ) ) ;
		sayAndWait( name, getString( "cardinal_d5" ) ) ;
	elseif ( isMissionComplete( "missionparisb33" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "cardinal_d4" ) ) ;
		sayAndWait( name, getString( "cardinal_d4" ) ) ;
	else
		-- doesn't know him
		--autoDeleteFaceChat( name, chatWith, getString( "cardinal_d" .. randomInt( 1, 4 ) ) ) ;
		sayAndWait( name, getString( "cardinal_d" .. randomInt( 1, 4 ) ) ) ;
	end
end

-- Baguette
function init_baguette( name )
end

function place_baguetteA( name )
	placeDead( name ) ;
end

function dress_baguetteA( name )
	clearCharacterPieces( name ) ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "boot_sock_right", "e2dbb2" ) ;
	addCharacterPiece( name, "boot_sock_left", "e2dbb2" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "e2dbb2" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "e2dbb2" ) ;
	addCharacterPiece( name, "beret", "e2dbb2" ) ;
	addCharacterPiece( name, "beard_c", "1e1d1a" ) ;
	addCharacterPiece( name, "hair_short", "1e1d1a" ) ;
	addCharacterPiece( name, "mustache_a", "1e1d1a" ) ;
	addCharacterPiece( name, "pant_baggy_left", "725c3a" ) ;
	addCharacterPiece( name, "pant_baggy_right", "725c3a" ) ;
	addCharacterPiece( name, "belt", "725c3a" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "cc8052" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "aaa48b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "aaa48b" ) ;

end

function runAI_baguette( name )
end

function chat_baguette( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- Baguette
function init_germain( name )
end

function getGermainALevel( )
	return "france" ;
end

function getGermainAPosX( )
	return 556 ;
end

function getGermainAPosY( )
	return 57 ;
end

function place_germainA( name )
	placeCharacter( name, getGermainALevel( ), getGermainAPosX( ), getGermainAPosY( ) ) ;
end

function dress_germainA( name )
		clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "boot_sock_right", "ecd091" ) ;
	addCharacterPiece( name, "boot_sock_left", "ecd091" );
	addCharacterPiece( name, "hair_curly", "64534c" ) ;
	addCharacterPiece( name, "mustache_a", "64534c" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "80775f" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "ecd091" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "ecd091" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "eac144" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "eac144" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "ecd091" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "ecd091" ) ;

end

function runAI_germain( name )
	while( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_germain( name, chatWith )
	if ( isMissionComplete( "missionparis23" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "germain_d1" ) ) ;
		sayAndWait( name, getString( "germain_d1" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
		sayAndWait( name, getString( "hello" ) ) ;
	end
end

-- Laporte
function init_laporte( name )
end

function place_laporteA( name )
	placeCharacter( name, "louvrehouse2", -559, -687 ) ;
end

function dress_laporteA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "boot_sock_right", "cddaf1" ) ;
	addCharacterPiece( name, "boot_sock_left", "cddaf1" );
	addCharacterPiece( name, "belt", "9e9073" ) ;
	addCharacterPiece( name, "pant_baggy_right", "b6a57f" ) ;
	addCharacterPiece( name, "pant_baggy_left", "b6a57f" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "b5caf2" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "fcedcc" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "fcedcc" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "fcedcc" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "fcedcc" ) ;
	addCharacterPiece( name, "beardmus", "9f9d98" ) ;
	addCharacterPiece( name, "hair_short", "9f9d98" ) ;


end


function runAI_laporte( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_laporte( name, chatWith )
	if ( isMissionComplete( "missionparis23" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "laporte_d1" ) ) ;
		sayAndWait( name, getString( "laporte_d1" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
		sayAndWait( name, getString( "hello" ) ) ;
	end
end

-- Constance
function init_constance( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
	setHasLootDrop( name, false ) ;
	setAllowPermanentDeath( name, false ) ;
end

function place_constanceA( name )
	placeDead( name ) ;
end

function place_constanceB( name )
	placeCharacter( name, "bonacieuxhouse", -40, -115 ) ;
end

function dress_constanceA( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_apron", "f1e5cc") ;
	addCharacterPiece( name, "w_dress_plain_torso", "d5b46d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "d5b46d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "d5b46d" ) ;
	addCharacterPiece( name, "w_stripe_torso", "768650" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "768650" ) ;
	addCharacterPiece( name, "w_hair_plain", "412d15" ) ;
end

function dress_constanceB( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_mask_3", "444444" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_apron", "f1e5cc") ;
	addCharacterPiece( name, "w_dress_plain_torso", "d5b46d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "d5b46d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "d5b46d" ) ;
	addCharacterPiece( name, "w_stripe_torso", "768650" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "768650" ) ;
	addCharacterPiece( name, "w_hair_plain", "412d15" ) ;
end

function runAI_constance( name )
	while ( true ) do
		setBaseFaceCharacter( name, "dartagnan" ) ;
		wait( 1 ) ;
	end	
end

function chat_constance( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- Queen
function init_queen( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_queenA( name )
	placeCharacter( name, "louvrehouse2", -820, -1050 ) ;
end

function dress_queenA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big", 1, 1, 1, 0.7 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, 0.7 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, 0.7 ) ;
	addCharacterPiece( name, "w_hair_short", "92671f" ) ;
	addCharacterPiece( name, "w_queen", "b39b55" ) ;
	addCharacterPiece( name, "w_stripe_torso" ) ;
	addCharacterPiece( name, "w_stripe_legs" ) ;
	addCharacterPiece( name, "w_stripe_arm_right" ) ;
	addCharacterPiece( name, "w_stripe_arm_left" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "5f88e4" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "5f88e4" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "5f88e4" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "5f88e4"  ) ;
end

function dress_queenB( name )
	clearCharacterPieces( name ) ;

	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;

--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1, 0.7 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, 0.7 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1, 0.7 ) ;
	addCharacterPiece( name, "w_hair_short", "92671f" ) ;
	addCharacterPiece( name, "w_mask_5", "8fb3d9" ) ;
	addCharacterPiece( name, "w_hat_plain", "cfe1f2" ) ;
	addCharacterPiece( name, "w_bow_torso", "94a954"  ) ;
	addCharacterPiece( name, "w_bow_arm_left", "92b8df" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "92b8df" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "92b8df" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "92b8df" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "92b8df" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "cfe1f2" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "cfe1f2" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "cfe1f2"  ) ;
	
end

function runAI_queen( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		wait( 1 ) ;
	end
end

function chat_queen( name, chatWith )	
	if ( isMissionComplete( "missionrochelle19" ) ) then
		sayAndWait( name, getString( "queen_d3" ) ) ;
		sayAndWait( "dartagnan", getString( "queen_d4" ) ) ;
	elseif ( isMissionComplete( "missionrochelle16" ) ) then
		-- right place for queen to know about buckingham?
		--autoDeleteFaceChat( name, chatWith, getString( "queen_d3" ) ) ;
		sayAndWait( name, getString( "queen_d3" ) ) ;
	elseif ( isMissionComplete( "missionparisb2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "queen_d2" ) ) ;
		sayAndWait( name, getString( "queen_d2" ) ) ;
	else
		-- doesn't know
		--autoDeleteFaceChat( name, chatWith, getString( "queen_d1" ) ) ;
		sayAndWait( name, getString( "queen_d1" ) ) ;
	end
end

-- Buckingham
function init_buckingham( name )
	setStatsCalculatorDynamic( name, 0, 0, 0, 1000, 0.5 ) ;
end

function place_buckinghamA( name )
	placeDead( name ) ;
end

function dress_buckinghamA( name )
	-- normal dress
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "hair_medium", "92773d" ) ;
	addCharacterPiece( name, "mustache_b", "92773d" ) ;
	addCharacterPiece( name, "beard_b", "92773d" ) ;
	addCharacterPiece( name, "collar_plain", 1, 1, 1, 0.85 ) ;
	addCharacterPiece( name, "glove_plain_right", "a9987b" ) ;
	addCharacterPiece( name, "glove_plain_left", "a9987b" ) ;
	addCharacterPiece( name, "boot_plain_right", "42352e" ) ;
	addCharacterPiece( name, "boot_plain_left", "42352e" );
	addCharacterPiece( name, "shirt_fancy_torso", "3d3d3d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "3d3d3d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "3d3d3d" ) ;
	addCharacterPiece( name, "pant_baggy_right", "72b2c2" ) ;
	addCharacterPiece( name, "pant_baggy_left", "72b2c2" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left" ) ;
	addCharacterPiece( name, "sashbelt", "72b2c2" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;

	
	setMeleeWeapon( name, "sword_1" ) ;
end

function dress_buckinghamB( name )
	-- looks like Aramis
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "hair_medium", "92773d" ) ;
	addCharacterPiece( name, "mustache_b", "92773d" ) ;
	addCharacterPiece( name, "beard_b", "92773d" ) ;
	addCharacterPiece( name, "collar_plain", 1, 1, 1, 0.85 ) ;
	addCharacterPiece( name, "glove_plain_right", "a9987b" ) ;
	addCharacterPiece( name, "glove_plain_left", "a9987b" ) ;
	addCharacterPiece( name, "boot_plain_right", "42352e" ) ;
	addCharacterPiece( name, "boot_plain_left", "42352e" );
	addCharacterPiece( name, "shirt_fancy_torso", "3d3d3d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "3d3d3d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "3d3d3d" ) ;
	addCharacterPiece( name, "pant_baggy_right", "72b2c2" ) ;
	addCharacterPiece( name, "pant_baggy_left", "72b2c2" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left" ) ;
	addCharacterPiece( name, "sashbelt", "72b2c2" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
	addCharacterPiece( name, "tabbard", 0.2, 0.2, 1.0, 1.0 ) ;
	addCharacterPiece( name, "tabbard_overlay" ) ;
	addCharacterPiece( name, "feather_hat_plain", "e21f15" ) ;
	addCharacterPiece( name, "hat_plain", "9b9393" ) ;
	
	setMeleeWeapon( name, "sword_1" ) ;
end

function setownedhorse_buckinghamA( name )
	removeOwnedHorse( name ) ;
end

function setownedhorse_buckinghamB( name )
	setOwnedHorse( name, "buckhorse1" ) ;
end

function runAI_buckingham( name )
end

function chat_buckingham( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- Magistrate
function init_magistrate( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_magistrate( name )
	placeCharacter( name, "bastillehouse", -78, -46 ) ;
end

function dress_magistrate( name )
	-- normal dress
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "boot_sock_right", "e0e0e0") ;
	addCharacterPiece( name, "boot_sock_left", "e0e0e0") ;
	addCharacterPiece( name, "doublet_plain_torso", "a4a4a4" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "a4a4a4" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "a4a4a4" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "c4d0df" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "c4d0df" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "c4d0df" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "c4d0df" ) ;
	addCharacterPiece( name, "belt", "e0e0e0" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "5c5c5c" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "5c5c5c" ) ;
	addCharacterPiece( name, "hair_curly", "cacaca" ) ;
	addCharacterPiece( name, "beard_c", "cacaca" ) ;
	addCharacterPiece( name, "mustache_a", "cacaca" ) ;
end

function runAI_magistrate( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_magistrate( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- lirdorkeeper ("Golden Lion" innkeeper)
function init_lirdorkeeper( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_lirdorkeeper( name )
	placeCharacter( name, "lirdorhouse", -163, -38 ) ;
end

function dress_lirdorkeeper( name )
	-- normal dress
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt", "ababab" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "boot_plain_right", "8e7d37" ) ;
	addCharacterPiece( name, "boot_plain_left", "8e7d37" );
	addCharacterPiece( name, "mustache_a", "6d583a" ) ;
	addCharacterPiece( name, "beard_a", "6d583a" ) ;
	addCharacterPiece( name, "hair_long", "6d583a" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "cdb450" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "cdb450" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "cdb450" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "956b1a" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "956b1a" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "956b1a" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "956b1a" ) ;
	addCharacterPiece( name, "pant_baggy_right", "e0e0e0" ) ;
	addCharacterPiece( name, "pant_baggy_left", "e0e0e0" ) ;


end

function runAI_lirdorkeeper( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_lirdorkeeper( name, chatWith )
	local items = { 
		"ointment", 
		"beret_1", 
		"gloves_poor_1",
		"pants_musk_poor_1",
		"pants_musk_ok_1" } ;
		
	chat_vendor( name, chatWith, items ) ;
end

-- amiensaman1
function init_amiensaman1( name )
end

function place_amiensaman1( name )
	placeCharacter( name, "amienshousea", -82, -47 ) ;
end

function dress_amiensaman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a", "6f675d" ) ;
	addCharacterPiece( name, "belt", "80633a" ) ;
	addCharacterPiece( name, "boot_plain_right", "80633a" ) ;
	addCharacterPiece( name, "boot_plain_left", "80633a" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "b1a885" ) ;
	addCharacterPiece( name, "hair_medium", "6f675d" ) ;
	addCharacterPiece( name, "mustache_b", "6f675d" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "654832" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "654832" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "b1a885" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "b1a885" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "80633a" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "80633a" ) ;
end

function runAI_amiensaman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_amiensaman1( name, chatWith )
	genericGreeting( name, chatWith, 0.32 ) ;
end

-- amienslady1
function init_amienslady1( name )
	setWoman( name, true ) ;
end

function place_amienslady1( name )
	placeCharacter( name, "france", 6849, -12410 ) ;
end

function dress_amienslady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_curly", "cab3a6" ) ;
	addCharacterPiece( name, "w_stripe_torso", "cab3a6" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "dc9168" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "dc9168" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "dc9168" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a39c93" ) ;
end


function runAI_amienslady1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_amienslady1( name, chatWith )
	genericGreeting( name, chatWith, 0.76 ) ;
end

-- hersedorhousebkeeper
function init_hersedorhousebkeeper( name )
	setWoman( name, true ) ;
end

function place_hersedorhousebkeeper( name )
	placeCharacter( name, "hersedorhouseb", -1, 86 ) ;
end

function dress_hersedorhousebkeeper( name )
clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "f0ebce" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_pinned", "a48056" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "9e8d2f" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "9e8d2f" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "9e8d2f" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6f7459" ) ;
	addCharacterPiece( name, "w_hat_plain", "b8a980" ) ;
end

function runAI_hersedorhousebkeeper( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_hersedorhousebkeeper( name, chatWith )
	local items = { 
		"ointment", 
		"pants_musk_poor_1",
		"pants_musk_ok_1",
		"pants_musk_best_1",
		"pants_baggy_poor_1",
		"pants_baggy_ok_1",
		"pants_baggy_best_1" } ;
			
	chat_vendor( name, chatWith, items ) ;
end

-- stmartinkeeper
function init_stmartinkeeper( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_stmartinkeeper( name )
	placeCharacter( name, "stmartinhouse", -78, -169 ) ;
end

function dress_stmartinkeeper( name )
	-- normal dress
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt", "afafaf" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "boot_sock_right", "efdede" ) ;
	addCharacterPiece( name, "boot_sock_left", "efdede" );
	addCharacterPiece( name, "beard_b", "271b0e" ) ;
	addCharacterPiece( name, "hair_short", "271b0e" ) ;
	addCharacterPiece( name, "sashbelt", "e3d241" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "9a7b66" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "9a7b66" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "9a7b66" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "bb3333" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "bb3333" ) ;
end

function runAI_stmartinkeeper( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_stmartinkeeper( name, chatWith )
	local items = { 
		"ointment", 
		"hat_simple_poor_1",
		"hat_simple_ok_1",
		"hat_simple_best_1",
		"hat_plain_poor_1",
		"hat_plain_ok_1",
		"hat_plain_best_1" } ;
	
	chat_vendor( name, chatWith, items ) ;
end

-- stmartinlady1
function init_stmartinlady1( name )
	setWoman( name, true ) ;
end

function place_stmartinlady1( name )
	placeCharacter( name, "stmartinhouse", 76, -139 ) ;
end

function dress_stmartinlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "e4debb" ) ;
	addCharacterPiece( name, "w_hair_pinned", "917749" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "7e9fb0" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "7e9fb0" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "7e9fb0" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "8a7029" ) ;
end

function runAI_stmartinlady1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		goalWalkToPoint( name, "stmartinhouse", 120, -127 ) ;
		wait( randomDouble( 1.0, 10.0 ) ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		goalWalkToPoint( name, "stmartinhouse", 32, -170 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_stmartinlady1( name, chatWith )
	genericGreeting( name, chatWith, 0.93 ) ;
end

-- stmartinman1
function init_stmartinman1( name )
end

function place_stmartinman1( name )
	placeCharacter( name, "stmartinhouse2", 138, -173 ) ;
end

function dress_stmartinman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "68450e" ) ;	
	addCharacterPiece( name, "belt" ) ;
	addCharacterPiece( name, "beret", "977545" ) ;
	addCharacterPiece( name, "boot_sock_right", "e8ddcd" ) ;
	addCharacterPiece( name, "boot_sock_left", "e8ddcd" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "748863" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "748863" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "748863" ) ;
	addCharacterPiece( name, "feather_hat_small", "666599" ) ;
	addCharacterPiece( name, "hair_long", "68450e" ) ;
	addCharacterPiece( name, "mustache_a", "68450e" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "6f6f6f" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "6f6f6f" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e0cb59" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e0cb59" ) ;
end

function runAI_stmartinman1( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_stmartinman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hellotraveller" ) ) ;
	sayAndWait( name, getString( "hellotraveller" ) ) ;
end

-- chantillyhouseaman1
function init_chantillyhouseaman1( name )
end

function place_chantillyhouseaman1( name )
	sitCharacter( name, "chantillyhouseabench1" ) ;
end

function dress_chantillyhouseaman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "93713a" ) ;	
	addCharacterPiece( name, "boot_plain_right", "5b5346" ) ;
	addCharacterPiece( name, "boot_plain_left", "5b5346" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_curly", "93713a" ) ;
	addCharacterPiece( name, "mustache_a", "93713a" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "aaaaa8" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "aaaaa8" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "8a954f" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "8a954f" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "8a954f" ) ;
	end

function runAI_chantillyhouseaman1( name )
end

function chat_chantillyhouseaman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "chantillyhouseaman1_d1" ) ) ;
	sayAndWait( name, getString( "chantillyhouseaman1_d1" ) ) ;
end

-- chantillyhousealady1
function init_chantillyhousealady1( name )
	setWoman( name, true ) ;
end

function place_chantillyhousealady1( name )
	placeCharacter( name, "chantillyhousea2", -62, 258 ) ;
end

function dress_chantillyhousealady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "eeebd7" ) ;
	addCharacterPiece( name, "w_hair_short", "91908a" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "443c34" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "443c34" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "443c34" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "443c34" ) ;
end

function runAI_chantillyhousealady1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_chantillyhousealady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "chantillyhousealady1_d1" ) ) ;
	sayAndWait( name, getString( "chantillyhousealady1_d1" ) ) ;
end

-- chantillyman1
function init_chantillyman1( name )
end

function place_chantillyman1( name )
	placeCharacter( name, "france", 6743, -3507 ) ;
end

function dress_chantillyman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_leg_left" ) ;
	addCharacterPiece( name, "nm_leg_right" ) 
	addCharacterPiece( name, "beard_a", "98713f" ) ;
	addCharacterPiece( name, "belt", "624827" ) ;
	addCharacterPiece( name, "feather_hat_small", "a2b5d4" ) ;
	addCharacterPiece( name, "hat_simple", "ae9e72" ) ;
	addCharacterPiece( name, "hair_long", "98713f" ) ;
	addCharacterPiece( name, "mustache_b", "98713f" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "7b664a" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "7b664a" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e0d9c5" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e0d9c5" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "e0d9c5" ) ;
end

function runAI_chantillyman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_chantillyman1( name, chatWith )
	if ( getHasShoes( "dartagnan" ) ) then
		-- player has shoes
		--autoDeleteFaceChat( name, chatWith, getString( "chantillyman1_d1" ) ) ;
		sayAndWait( name, getString( "chantillyman1_d1" ) ) ;
	else
		-- player doesn't have shoes
		--autoDeleteFaceChat( name, chatWith, getString( "chantillyman1_d2" ) ) ;
		sayAndWait( name, getString( "chantillyman1_d2" ) ) ;
	end
end

-- crevecoeurkeeper
function init_crevecoeurkeeper( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_crevecoeurkeeper( name )
	placeCharacter( name, "crevecoeurhousea", -135, -55 ) ;
end

function dress_crevecoeurkeeper( name )
	clearCharacterPieces( name ) ;

	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;

	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "e9e5d4" ) ;
	addCharacterPiece( name, "w_collar_plain", "e9e5d4" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", "e9e5d4" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", "e9e5d4" ) ;
	addCharacterPiece( name, "w_hat_cap", "e9e5d4" ) ;
	addCharacterPiece( name, "w_hair_pinned", "eddd92") ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "b7b6ee" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "b7b6ee" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "b7b6ee" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a88e6f" ) ;
end

function runAI_crevecoeurkeeper( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_crevecoeurkeeper( name, chatWith )
local items = { 
		"ointment", 
		"boot_plain_poor_1",
		"boot_plain_ok_1",
		"boot_plain_best_1",
		"boot_sock_poor_1",
		"boot_sock_ok_1",
		"boot_sock_best_1",
		"boot_fancy_poor_1",
		"boot_fancy_ok_1",
		"boot_fancy_best_1" } ;
		
	chat_vendor( name, chatWith, items ) ;
end

-- crevecoeuraman1
function init_crevecoeuraman1( name )
end

function place_crevecoeuraman1( name )
	sitCharacter( name, "crevecoeurabench1" ) ;
end

function dress_crevecoeuraman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "32210a" ) ;
	addCharacterPiece( name, "sashbelt", "835820" ) ;
	addCharacterPiece( name, "boot_fancy_right", "86673a" ) ;
	addCharacterPiece( name, "boot_fancy_left", "86673a" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "aea253" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "aea253" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "aea253" ) ;
	addCharacterPiece( name, "glove_plain_right", "513814" ) ;
	addCharacterPiece( name, "glove_plain_left", "513814" ) ;
	addCharacterPiece( name, "hair_curly", "32210a" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "706a44" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "706a44" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "86673a" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "86673a" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "aea253" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "aea253" ) ;
	end

function runAI_crevecoeuraman1( name )
end

function chat_crevecoeuraman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "longjourney" ) ) ;
	sayAndWait( name, getString( "longjourney" ) ) ;
end

-- crevecoeuraman2
function init_crevecoeuraman2( name )
end

function place_crevecoeuraman2( name )
	sitCharacter( name, "crevecoeurabench2" ) ;
end

function dress_crevecoeuraman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", "ded177" ) ;
	addCharacterPiece( name, "belt", "91713b" ) ;
	addCharacterPiece( name, "boot_plain_right", "6c5d45" ) ;
	addCharacterPiece( name, "boot_plain_left", "6c5d45" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "feather_hat_small", "6c91e4" ) ;
	addCharacterPiece( name, "hat_simple", "6c5d45" ) ;
	addCharacterPiece( name, "hair_short", "ded177" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "536072" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "536072" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d1c8bb" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d1c8bb" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "d1c8bb" ) ;
end

function runAI_crevecoeuraman2( name )
end

function chat_crevecoeuraman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hellotraveller" ) ) ;
	sayAndWait( name, getString( "hellotraveller" ) ) ;
end

-- Comte de Wardes
function init_dewardes( name )
	setAllowPermanentDeath( name, false ) ;
	setStatsCalculatorStatic( name, 23, 23, 23, 23 ) ;
end

function place_dewardesA( name )
	placeDead( name ) ;
end

function dress_dewardesA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "glove_plain_right", "9e886a" ) ;
	addCharacterPiece( name, "glove_plain_left", "9e886a" ) ;
	addCharacterPiece( name, "boot_fancy_right", "ce984e") ;
	addCharacterPiece( name, "boot_fancy_left", "ce984e") ;
	addCharacterPiece( name, "hair_long", "a28a69" ) ;
	addCharacterPiece( name, "mustache_a", "a28a69" ) ;
	addCharacterPiece( name, "belt", "d3b284" ) ;
	addCharacterPiece( name, "sashbelt", "a7a69c" ) ;
	addCharacterPiece( name, "pant_baggy_right", "9f967f" ) ;
	addCharacterPiece( name, "pant_baggy_left", "9f967f" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "b2623b" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "b2623b"  ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "b2623b" ) ;
	addCharacterPiece( name, "stripe_plain_torso" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right"  ) ;
	addCharacterPiece( name, "stripe_plain_arm_left" ) ;
	addCharacterPiece( name, "hat_plain", "a68867" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "efc943" ) ;
	
	setMeleeWeapon( name, "sword_1" ) ;
end

function runAI_dewardes( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_dewardes( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- Lubin (Comte de Wardes servant)
function init_lubin( name )
	setAllowPermanentDeath( name, false ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_lubinA( name )
	placeDead( name ) ;
end

function dress_lubinA( name )
	-- normal dress
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt", "685532" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "boot_sock_right" ) ;
	addCharacterPiece( name, "boot_sock_left" );
	addCharacterPiece( name, "hair_medium", "969280" ) ;
	addCharacterPiece( name, "beardmus", "969280" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "abb67d" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e2ddc6" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e2ddc6" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e0d853" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e0d853" ) ;	
	addCharacterPiece( name, "pant_musketeer_right", "cba253" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "cba253" ) ;
	addCharacterPiece( name, "hat_simple", "d7cb94" ) ;
end

function runAI_lubin( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_lubin( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- calaiscaptain
function init_calaiscaptain( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_calaiscaptain( name )
	placeCharacter( name, "france", 4846, -18978 ) ;
end

function dress_calaiscaptain( name )
	-- normal dress
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "boot_plain_right", "5c543d" ) ;
	addCharacterPiece( name, "boot_plain_left", "5c543d" ) ;
	addCharacterPiece( name, "pant_baggy_right", "b58b4d" ) ;
	addCharacterPiece( name, "pant_baggy_left", "b58b4d" ) ;
	addCharacterPiece( name, "hair_medium", "b58b4d" ) ;	
	addCharacterPiece( name, "mustache_b", "b58b4d" ) ;	
	addCharacterPiece( name, "hat_plain", "a4845f" ) ;	
	addCharacterPiece( name, "feather_hat_plain", "9fa56f" ) ;	
	addCharacterPiece( name, "belt", "9c9c9c" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "collar_plain", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "doublet_plain_torso", "7b87d2" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "7b87d2" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "7b87d2" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e8d426" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e8d426" ) ;
end

function runAI_calaiscaptain( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, -1 ) ;
		wait( 1 ) ;
	end
end

function chat_calaiscaptain( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "calaiscaptain_d1" ) ) ;
	sayAndWait( name, getString( "calaiscaptain_d1" ) ) ;
end

-- calaisgovernor
function init_calaisgovernor( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_calaisgovernor( name )
	placeCharacter( name, "france", 4234, -17002 ) ;
end

function dress_calaisgovernor( name )
	clearCharacterPieces( name ) ;
	
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "boot_sock_right" ) ;
	addCharacterPiece( name, "boot_sock_left" ) ;
	addCharacterPiece( name, "hair_short", "a2936b" ) ;
	addCharacterPiece( name, "beardmus", "a2936b" ) ;
	addCharacterPiece( name, "belt", "e0c24c" ) ;
	addCharacterPiece( name, "sashbelt", "e0c24c" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "877abf" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "877abf" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "877abf" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "877abf" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "877abf" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "a98746" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "a98746" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "a98746" ) ;
	addCharacterPiece( name, "pant_baggy_right", "a98746") ;
	addCharacterPiece( name, "pant_baggy_left", "a98746") ;
end

function runAI_calaisgovernor( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_calaisgovernor( name, chatWith )
	if ( isMissionComplete( "missionlondon6" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "calaisgovernor_d1" ) ) ;
		sayAndWait( name, getString( "calaisgovernor_d1" ) ) ;
	else
		genericGreeting( name, chatWith, 0.9 ) ;
	end
end

-- patrick
function init_patrick( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_patrick( name )
	placeCharacter( name, "buckinghamenglandhouse", -76, -121 ) ;
end

function dress_patrick( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "4a6971" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "4a6971" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "4a6971" ) ;
	addCharacterPiece( name, "boot_sock_right", "ced1b4" ) ;
	addCharacterPiece( name, "boot_sock_left", "ced1b4" );
	addCharacterPiece( name, "pant_musketeer_right", "897f64" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "897f64" ) ;
	addCharacterPiece( name, "belt", "e2c495" ) ;
	addCharacterPiece( name, "hair_long", "88724f" ) ;
	addCharacterPiece( name, "beard_b", "88724f" ) ;
	addCharacterPiece( name, "mustache_a", "88724f" ) ;
end

function runAI_patrick( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_patrick( name, chatWith )
	if ( isMissionComplete( "missionrochelle13" ) ) then
		-- buckingham dead
		--autoDeleteFaceChat( name, chatWith, getString( "patrick_d1" ) ) ;
		sayAndWait( name, getString( "patrick_d1" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
		sayAndWait( name, getString( "hello" ) ) ;
	end
end

-- oreilly
function init_oreilly( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_oreilly( name )
	placeDead( name ) ;
end

function dress_oreilly( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "boot_sock_right", "d6cebc" ) ;
	addCharacterPiece( name, "boot_sock_left", "d6cebc" );
	addCharacterPiece( name, "pant_baggy_right", "84733e" ) ;
	addCharacterPiece( name, "pant_baggy_left", "84733e" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "d2ba93" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e8e8e8" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e8e8e8" ) ;
	addCharacterPiece( name, "beardmus", "614a28" ) ;
	addCharacterPiece( name, "hair_long", "614a28" ) ;
end

function runAI_oreilly( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_oreilly( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- jackson
function init_jackson( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_jackson( name )
	placeCharacter( name, "buckinghamenglandhouse", -489, 44 ) ;
end

function dress_jackson( name )
	clearCharacterPieces( name ) ;
	
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt", "a78c62" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "boot_sock_right", "e4e0ca" ) ;
	addCharacterPiece( name, "boot_sock_left", "e4e0ca" );
	addCharacterPiece( name, "beard_c", "c1ad84" ) ;
	addCharacterPiece( name, "hair_curly", "c1ad84" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "629ca8" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e4e0ca" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e4e0ca" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "4a6971" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "4a6971" ) ;

end

function runAI_jackson( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_jackson( name, chatWith )
	if ( isMissionComplete( "missionrochelle13" ) ) then
		-- buckingham dead
		--autoDeleteFaceChat( name, chatWith, getString( "jackson_d1" ) ) ;
		sayAndWait( name, getString( "jackson_d1" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
		sayAndWait( name, getString( "hello" ) ) ;
	end
end

-- londonhousecman
function init_londonhousecman( name )
end

function place_londonhousecman( name )
	placeCharacter( name, "londonhousec2", 42, -66 ) ;
end

function dress_londonhousecman( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_c", "735d3d" ) ;	
	addCharacterPiece( name, "belt", "4e3717" ) ;
	addCharacterPiece( name, "beret", "917360" ) ;
	addCharacterPiece( name, "boot_sock_right", "e4d6cd" ) ;
	addCharacterPiece( name, "boot_sock_left", "e4d6cd" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "a4804d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "a4804d" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "a4804d" ) ;
	addCharacterPiece( name, "hair_short", "735d3d" ) ;
	addCharacterPiece( name, "mustache_b", "735d3d" ) ;
	addCharacterPiece( name, "pant_baggy_right", "be622b" ) ;
	addCharacterPiece( name, "pant_baggy_left", "be622b" ) ;	
	addCharacterPiece( name, "stripe_plain_leg_right", "d7ca5e" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "d7ca5e" ) ;
	end

function runAI_londonhousecman( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_londonhousecman( name, chatWith )
	if ( isMissionComplete( "missionbaguettedelivery1" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mbaguettedelivery1d6" ) ) ;
		sayAndWait( name, getString( "mbaguettedelivery1d6" ) ) ;
	elseif ( isMissionActive( "missionbaguettedelivery1" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mbaguettedelivery1d3" ) ) ;
		sayAndWait( name, getString( "mbaguettedelivery1d3" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "mbaguettedelivery0d8" ) ) ;
		sayAndWait( name, getString( "mbaguettedelivery0d8" ) ) ;
	end
end

-- frenchspy1
function init_frenchspy1( name )
end

function place_frenchspy1( name )
	placeCharacter( name, "england", -438, -534 ) ;
end

function dress_frenchspy1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "232323" ) ;	
	addCharacterPiece( name, "belt", "232323" ) ;
	addCharacterPiece( name, "beret", "2e2e2d" ) ;
	addCharacterPiece( name, "boot_plain_right", "606060" ) ;
	addCharacterPiece( name, "boot_plain_left", "606060" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "606060" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "606060" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "606060" ) ;
	addCharacterPiece( name, "glove_plain_right", "2e2e2d" ) ;
	addCharacterPiece( name, "glove_plain_left", "2e2e2d" ) ;
	addCharacterPiece( name, "hair_short", "232323" ) ;
	addCharacterPiece( name, "mustache_b", "232323" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "2e2e2d" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "2e2e2d" ) ;
end

function runAI_frenchspy1( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_frenchspy1( name, chatWith )
	local split1 = gameIsSplit( ) and getGameSplitPart( ) == 1 ;
	if ( split1 ) then
		sayAndWait( name, getString( "mespionage0d1" ) ) ;
		return ;
	end

	local requireHonour = 25 ;
	if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
		sayAndWait( name, getString( "mespionage0d1" ) ) ;
		setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
	elseif ( getTooManyActiveMissions( ) ) then
		sayAndWait( name, getString( "mespionage0d1" ) ) ;
		setQuickInfoTag( getString( "toomanymissions" ) ) ;
	else
		-- meets minimum requirements
		sayAndWait( name, getString( "mespionage0d2" ) ) ;
		sayAndWait( name, getString( "mespionage0d3" ) ) ;
		sayAndWait( name, getString( "mespionage0d4" ) ) ;
		sayAndWait( name, getString( "mespionage0d5" ) ) ;
		sayAndWait( name, getString( "mespionage0d6" ) ) ;
		
		local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mespionage0d7" ), getString( "mespionage0d8" ) ) ;
		local option = waitForBubbleOption( bubInd ) ;
		if ( option == 0 ) then
			-- accept
			sayAndWait( name, getString( "mespionage0d9" ) ) ;
			activateMission( "missionespionage1" ) ;
		else
			-- reject
		end
	end
end

-- dungeonman1
function init_dungeonman1( name )
end

function place_dungeonman1( name )
	placeCharacter( name, "crevecoeurhouseb", -47, -11 ) ;
end

function dress_dungeonman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", "d1c974" ) ;
	addCharacterPiece( name, "belt", "4e3315" ) ;
	addCharacterPiece( name, "boot_plain_right", "4e3315" ) ;
	addCharacterPiece( name, "boot_plain_left", "4e3315" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "glove_plain_right", "8c6a46" ) ;
	addCharacterPiece( name, "glove_plain_left", "8c6a46" ) ;
	addCharacterPiece( name, "hair_curly", "d1c974" ) ;
	addCharacterPiece( name, "mustache_b", "d1c974" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "575756" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "575756" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "c9bfb5" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "c9bfb5" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "c9bfb5" ) ;
end

function runAI_dungeonman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_dungeonman1( name, chatWith )
	local split1 = gameIsSplit( ) and getGameSplitPart( ) == 1 ;
	if ( split1 ) then
		sayAndWait( name, getString( "mdungeon0d1" ) ) ;
		return ;
	end
	
	local requireHonour = 25 ;
	if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
		sayAndWait( name, getString( "mdungeon0d1" ) ) ;
		setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
	elseif ( getTooManyActiveMissions( ) ) then
		sayAndWait( name, getString( "mdungeon0d1" ) ) ;
		setQuickInfoTag( getString( "toomanymissions" ) ) ;
	else
		-- meets minimum requirements
		sayAndWait( name, getString( "mdungeon0d2" ) ) ;
		sayAndWait( name, getString( "mdungeon0d3" ) ) ;
		
		local bubInd = characterSay( name, true, -1, -1, false, getString( "mdungeon0d4" ) ) ;
		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( name, getString( "mdungeon0d5" ) ) ;

			activateMission( "missiondungeon1" ) ;
		else
			-- no
			return ;
		end
	end
end

-- stvaleryinnkeeper
function init_stvaleryinnkeeper( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_stvaleryinnkeeper( name )
	placeCharacter( name, "stvaleryhouse", 33, -12 ) ;
end

function dress_stvaleryinnkeeper( name )
	clearCharacterPieces( name ) ;
	
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "beard_c", "715623" ) ;
	addCharacterPiece( name, "hair_medium", "715623" ) ;
	addCharacterPiece( name, "mustache_a", "715623" ) ;
	addCharacterPiece( name, "feather_hat_small", "d4c791" ) ;
	addCharacterPiece( name, "beret", "9f5e91" ) ;
	addCharacterPiece( name, "boot_fancy_right", "d4c791" ) ;
	addCharacterPiece( name, "boot_fancy_left", "d4c791" );
	addCharacterPiece( name, "doublet_plain_arm_right", "7d734d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "7d734d" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "7d734d" ) ;	
	addCharacterPiece( name, "pant_musketeer_right", "785c71" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "785c71" ) ;


end

function runAI_stvaleryinnkeeper( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_stvaleryinnkeeper( name, chatWith )
	local items = { 
		"ointment", 
		"hat_simple_poor_1",
		"hat_simple_ok_1",
		"hat_simple_best_1",
		"hat_plain_poor_1",
		"hat_plain_ok_1",
		"hat_plain_best_1" } ;
	
	chat_vendorCustom( name, chatWith, items, getString( "innkeeperwelcome_d1" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

-- stvaleryinnman1
function init_stvaleryinnman1( name )
end

function place_stvaleryinnman1( name )
	placeCharacter( name, "stvaleryhouse", 77, 183 ) ;
end

function dress_stvaleryinnman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "8f744b" ) ;	
	addCharacterPiece( name, "belt", "664b21" ) ;
	addCharacterPiece( name, "boot_plain_right", "674724" ) ;
	addCharacterPiece( name, "boot_plain_left", "674724" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "73925e" ) ;
	addCharacterPiece( name, "feather_hat_small", "9e8853" ) ;
	addCharacterPiece( name, "hat_simple", "9e8853" ) ;
	addCharacterPiece( name, "hair_medium", "8f744b" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "837b72" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "837b72" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "ded5c6" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "ded5c6" ) ;
end

function runAI_stvaleryinnman1( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_stvaleryinnman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hellotraveller" ) ) ;
	sayAndWait( name, getString( "hellotraveller" ) ) ;
end

-- stvaleryinnman2
function init_stvaleryinnman2( name )
end

function place_stvaleryinnman2( name )
	placeCharacter( name, "stvaleryhouse", 113, 183 ) ;
end

function dress_stvaleryinnman2( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "9d9792" ) ;
	addCharacterPiece( name, "sashbelt", "bda869" ) ;
	addCharacterPiece( name, "boot_sock_right", "dee2d6" ) ;
	addCharacterPiece( name, "boot_sock_left", "dee2d6" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "a8b68a" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "a8b68a" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "a8b68a" ) ;
	addCharacterPiece( name, "glove_plain_right", "9e9e9d" ) ;
	addCharacterPiece( name, "glove_plain_left", "9e9e9d" ) ;
	addCharacterPiece( name, "hair_curly", "9d9792" ) ;
	addCharacterPiece( name, "mustache_a", "9d9792" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "5e4633" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "5e4633" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "bfb18f" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "bfb18f" ) ;
end

function runAI_stvaleryinnman2( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_stvaleryinnman2( name, chatWith )
	genericGreeting( name, chatWith, 0.9 ) ;
end

-- hersedorinnkeeper
function init_hersedorinnkeeper( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_hersedorinnkeeper( name )
	placeCharacter( name, "hersedorhouse", 20, 84 ) ;
end

function dress_hersedorinnkeeper( name )
	clearCharacterPieces( name ) ;
	
		addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;

	addCharacterPiece( name, "beard_b", "a49066" ) ;
	addCharacterPiece( name, "hair_curly", "a49066" ) ;
	addCharacterPiece( name, "mustache_b", "a49066" ) ;
	addCharacterPiece( name, "sashbelt", "736044" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "f0ebca" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "f0ebca" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "e6d145" ) ;
	addCharacterPiece( name, "pant_baggy_right", "87735c" ) ;
	addCharacterPiece( name, "pant_baggy_left", "87735c" ) ;
	addCharacterPiece( name, "boot_sock_right", "f0ebca" ) ;
	addCharacterPiece( name, "boot_sock_left", "f0ebca" );
	addCharacterPiece( name, "stripe_plain_leg_right", "e6d145" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e6d145" ) ;

end

function runAI_hersedorinnkeeper( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_hersedorinnkeeper( name, chatWith )
	local items = { 
		"ointment",
		"boot_plain_poor_1",
		"boot_plain_ok_1",
		"boot_plain_best_1",
		"boot_sock_poor_1",
		"boot_sock_ok_1",
		"boot_sock_best_1",
		"sashbelt_poor_1" } ;
	
	chat_vendorCustom( name, chatWith, items, getString( "innkeeperwelcome_d1" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

-- hersedorman1
function init_hersedorman1( name )
end

function place_hersedorman1( name )
	sitCharacter( name, "hersedorbench1" ) ;
end

function dress_hersedorman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_c", "87857f" ) ;	
	addCharacterPiece( name, "belt", "9a8375" ) ;
	addCharacterPiece( name, "beret", "597085" ) ;
	addCharacterPiece( name, "boot_sock_right", "e2d5ce" ) ;
	addCharacterPiece( name, "boot_sock_left", "e2d5ce" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "a68931" ) ;
	addCharacterPiece( name, "hair_medium", "87857f" ) ;
	addCharacterPiece( name, "mustache_a", "87857f" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "273440" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "273440" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "dfd9c7" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "dfd9c7" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "9198a1" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "9198a1" ) ;
	end

function runAI_hersedorman1( name )
end

function chat_hersedorman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "eatingnum" ) ) ;
	sayAndWait( name, getString( "eatingnum" ) ) ;
end

-- hersedorman2
function init_hersedorman2( name )
end

function place_hersedorman2( name )
	placeCharacter( name, "hersedorhouse", 239, 84 ) ;
end

function dress_hersedorman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "785028" ) ;
	addCharacterPiece( name, "sashbelt", "84704c" ) ;
	addCharacterPiece( name, "boot_plain_right", "4f3b18" ) ;
	addCharacterPiece( name, "boot_plain_left", "4f3b18" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "ccca99" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "ccca99" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "ccca99" ) ;
	addCharacterPiece( name, "glove_plain_right", "8d8d8a" ) ;
	addCharacterPiece( name, "glove_plain_left", "8d8d8a" ) ;
	addCharacterPiece( name, "hat_simple", "b09d64" ) ;
	addCharacterPiece( name, "hair_short", "785028" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "627748" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "627748" ) ;
	end

function runAI_hersedorman2( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_hersedorman2( name, chatWith )
	genericGreeting( name, chatWith, 0.83 ) ;
end

-- ecudeinnkeeper
function init_ecudeinnkeeper( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_ecudeinnkeeper( name )
	placeCharacter( name, "ecudefrancehouse", -34, 30 ) ;
end

function dress_ecudeinnkeeper( name )
	clearCharacterPieces( name ) ;
	
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "beard_a", "d99246" ) ;
	addCharacterPiece( name, "hair_medium", "d99246" ) ;
	
	addCharacterPiece( name, "glove_plain_right", "92775b" ) ;
	addCharacterPiece( name, "glove_plain_left", "92775b" ) ;
	addCharacterPiece( name, "belt", "745c43" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "65864b" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "65864b" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "65864b" ) ;
	addCharacterPiece( name, "pant_baggy_right", "676d58" ) ;
	addCharacterPiece( name, "pant_baggy_left", "676d58" ) ;
	addCharacterPiece( name, "boot_plain_right", "745c43" ) ;
	addCharacterPiece( name, "boot_plain_left", "745c43" );

end

function runAI_ecudeinnkeeper( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_ecudeinnkeeper( name, chatWith )
	local items = { 
		"ointment", 
		"belt_poor_1",
		"belt_ok_1",
		"belt_best_1" } ;
	
	chat_vendorCustom( name, chatWith, items, getString( "innkeeperwelcome_d1" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

-- ecudeinnlady1
function init_ecudeinnlady1( name )
	setWoman( name, true ) ;
end

function place_ecudeinnlady1( name )
	placeCharacter( name, "ecudefrancehouse", -104, -19 ) ;
end

function dress_ecudeinnlady1( name )
clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "e5dccb" ) ;
	addCharacterPiece( name, "w_hair_pinned", "b69657" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "869f6e" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "869f6e" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "869f6e" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "7c6c4e" ) ;
	addCharacterPiece( name, "w_hat_cap", "e5dccb" ) ;

end

function runAI_ecudeinnlady1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		goalWalkToPoint( name, "ecudefrancehouse", -77, -16 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		goalWalkToPoint( name, "ecudefrancehouse", -210, 56 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
		goalWalkToPoint( name, "ecudefrancehouse", 78, -17 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_ecudeinnlady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "smellytraveller" ) ) ;
	sayAndWait( name, getString( "smellytraveller" ) ) ;
end

-- ecudeinnman1
function init_ecudeinnman1( name )
end

function place_ecudeinnman1( name )
	sitCharacter( name, "ecudeinnchair1" ) ;
end

function dress_ecudeinnman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "796b50" ) ;	
	addCharacterPiece( name, "belt", "7d6027" ) ;
	addCharacterPiece( name, "sashbelt", "9f782c" ) ;
	addCharacterPiece( name, "boot_fancy_right", "7b3f13" ) ;
	addCharacterPiece( name, "boot_fancy_left", "7b3f13" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "837b86" ) ;
	addCharacterPiece( name, "hair_medium", "796b50" ) ;
	addCharacterPiece( name, "pant_baggy_right", "664670" ) ;
	addCharacterPiece( name, "pant_baggy_left", "664670" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "837b86" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "837b86" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "d9aae9" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "d9aae9" ) ;
	end

function runAI_ecudeinnman1( name )
end

function chat_ecudeinnman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hellotraveller" ) ) ;
	sayAndWait( name, getString( "hellotraveller" ) ) ;
end

-- ecudeinnman2
function init_ecudeinnman2( name )
end

function place_ecudeinnman2( name )
	placeCharacter( name, "ecudefrancehouse", 83, -46 ) ;
end

function dress_ecudeinnman2( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "d0bc4d" ) ;
	addCharacterPiece( name, "belt", "7c5d28" ) ;
	addCharacterPiece( name, "boot_sock_right", "ddd4c4" ) ;
	addCharacterPiece( name, "boot_sock_left", "ddd4c4" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "glove_plain_right", "736040" ) ;
	addCharacterPiece( name, "glove_plain_left", "736040" ) ;
	addCharacterPiece( name, "hair_curly", "d0bc4d" ) ;
	addCharacterPiece( name, "mustache_b", "d0bc4d" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "635c51" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "635c51" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "bbd2e9" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "bbd2e9" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "bbd2e9" ) ;
end

function runAI_ecudeinnman2( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_ecudeinnman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "imtired" ) ) ;
	sayAndWait( name, getString( "imtired" ) ) ;
end

-- pontoiseinnkeeper
function init_pontoiseinnkeeper( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_pontoiseinnkeeper( name )
	placeCharacter( name, "pontoisehousea", 12, 15 ) ;
end

function dress_pontoiseinnkeeper( name )
	clearCharacterPieces( name ) ;
	

	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "collar_big", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, 0.8 ) ;
	
	addCharacterPiece( name, "beardmus", "1c1609" ) ;
	addCharacterPiece( name, "hair_long", "1c1609" ) ;
	addCharacterPiece( name, "belt", "887249" ) ;
	addCharacterPiece( name, "boot_fancy_right", "887249" ) ;
	addCharacterPiece( name, "boot_fancy_left", "887249" );
	addCharacterPiece( name, "hat_simple", "887249" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "dedab7" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "dedab7" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "8084dc" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "8084dc" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "dedab7" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "414770" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "414770" ) ;
	
end

function runAI_pontoiseinnkeeper( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_pontoiseinnkeeper( name, chatWith )
	local items = { 
		"ointment", 
		"beret_1", 
		"pants_musk_poor_1" } ;
	
	chat_vendorCustom( name, chatWith, items, getString( "innkeeperwelcome_d1" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

-- pontoiseinnlady1
function init_pontoiseinnlady1( name )
	setWoman( name, true ) ;
end

function place_pontoiseinnlady1( name )
	placeCharacter( name, "pontoisehousea", 64, 17 ) ;
end

function dress_pontoiseinnlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "e4ddd1" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "766343" ) ;
	addCharacterPiece( name, "w_stripe_torso", "a9a495" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "8aa9c8" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "8aa9c8" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "8aa9c8" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "978146" ) ;
	addCharacterPiece( name, "w_hat_cap", "e4ddd1" ) ;
end


function runAI_pontoiseinnlady1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, -1 ) ;
		goalWalkToPoint( name, "pontoisehousea", 58, -14 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		goalWalkToPoint( name, "pontoisehousea", 85, 12 ) ;
		wait( randomDouble( 4.0, 10.0 ) ) ;
		
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_pontoiseinnlady1( name, chatWith )
	genericGreeting( name, chatWith, 0.59 ) ;
end

-- pontoiseinnman1
function init_pontoiseinnman1( name )
end

function place_pontoiseinnman1( name )
	placeCharacter( name, "pontoisehousea", 42, 195 ) ;
end

function dress_pontoiseinnman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", "d8cb83" ) ;	
	addCharacterPiece( name, "sashbelt", "7b5e38" ) ;
	addCharacterPiece( name, "boot_fancy_right", "3d3327" ) ;
	addCharacterPiece( name, "boot_fancy_left", "3d3327" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "8a4055" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "8a4055" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "8a4055" ) ;
	addCharacterPiece( name, "feather_hat_plain", "c08999" ) ;
	addCharacterPiece( name, "glove_plain_right", "b59a73" ) ;
	addCharacterPiece( name, "glove_plain_left", "b59a73" ) ;
	addCharacterPiece( name, "hat_plain", "b59a73" ) ;
	addCharacterPiece( name, "hair_short", "d8cb83" ) ;
	addCharacterPiece( name, "mustache_a", "d8cb83" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "a2a29e" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "a2a29e" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "c08999" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "c08999" ) ;
end

function runAI_pontoiseinnman1( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_pontoiseinnman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "longjourney" ) ) ;
	sayAndWait( name, getString( "longjourney" ) ) ;
end

-- pontoiseinnman2
function init_pontoiseinnman2( name )
end

function place_pontoiseinnman2( name )
	placeCharacter( name, "pontoisehousea", -99, 222 ) ;
end

function dress_pontoiseinnman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "be8c45" ) ;	
	addCharacterPiece( name, "belt", "7d6646" ) ;
	addCharacterPiece( name, "boot_plain_right", "4f3a1b" ) ;
	addCharacterPiece( name, "boot_plain_left", "4f3a1b" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_medium", "be8c45" ) ;
	addCharacterPiece( name, "pant_baggy_right", "a4732c" ) ;
	addCharacterPiece( name, "pant_baggy_left", "a4732c" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "dbc426" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "dbc426" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "dbc426" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e3dfc2" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e3dfc2" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "e3dfc2" ) ;
end

function runAI_pontoiseinnman2( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_pontoiseinnman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "imtired" ) ) ;
	sayAndWait( name, getString( "imtired" ) ) ;
end

-- curatemont
function init_curatemont( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_curatemontA( name )
	placeDead( name ) ;
end

function dress_curatemont( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	
	addCharacterPiece( name, "pant_monk_legs", "373535" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "373535" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "373535" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "373535" ) ;
	addCharacterPiece( name, "tabbard", "5c5c5c" ) ;
	addCharacterPiece( name, "tabbard_overlay" ) ;
	addCharacterPiece( name, "hair_long", "dcd080" ) ;
	addCharacterPiece( name, "beard_b", "dcd080" ) ;
	addCharacterPiece( name, "mustache_a", "dcd080" ) ;
	
end

function runAI_curatemont( name )
	while ( true ) do
		setBaseFaceCharacter( name, "aramis" ) ;
		wait( 1 ) ;
	end
end

function chat_curatemont( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- principalamiens
function init_principalamiens( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_principalamiensA( name )
	placeDead( name ) ;
end

function dress_principalamiens( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "belt", "ba996e" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "5c5c5c" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "5c5c5c" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "5c5c5c" ) ;
	addCharacterPiece( name, "pant_monk_legs", "5c5c5c" ) ;
	addCharacterPiece( name, "hat_holy", "373535" ) ;
	addCharacterPiece( name, "hair_medium", "c5c4b5" ) ;
	addCharacterPiece( name, "cloak_holy", "373535" ) ;
end

function runAI_principalamiens( name )
	while ( true ) do
		setBaseFaceCharacter( name, "aramis" ) ;
		wait( 1 ) ;
	end
end

function chat_principalamiens( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- lord de winter
function init_lordwinter( name )
	setAllowPermanentDeath( name, false ) ;
	setStatsCalculatorStatic( name, 25, 25, 25, 25 ) ;
	setHasLootDrop( name, false ) ;
end

function place_lordwinterA( name )
	placeDead( name ) ;
end

function dress_lordwinterA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "sashbelt", "806440" ) ;
	addCharacterPiece( name, "collar_plain", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "boot_fancy_right", "ab916f" ) ;
	addCharacterPiece( name, "boot_fancy_left", "ab916f" );
	addCharacterPiece( name, "hair_short", "ab916f" ) ;
	addCharacterPiece( name, "beard_c", "ab916f" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "86a47b" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "86a47b" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "86a47b" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "e1c923" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "e1c923" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "e1c923" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e1c923" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e1c923" ) ;	
	addCharacterPiece( name, "pant_baggy_right", "383a4c" ) ;
	addCharacterPiece( name, "pant_baggy_left", "383a4c" ) ;
	addCharacterPiece( name, "hat_plain", "383a4c" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "7a9ceb" ) ;
	
	setMeleeWeapon( name, "sword_1" ) ;
end

function setownedhorse_lordwinterA( name )
	removeOwnedHorse( name ) ;
end

function setownedhorse_lordwinterB( name )
	setOwnedHorse( name, "posthorse3" ) ;
end

function runAI_lordwinter( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_lordwinter( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- Milady
function init_milady( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_miladyA( name )
	placeDead( name ) ;
end

function dress_miladyA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big", 1, 1, 1, 0.7 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, 0.7 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, 0.7 ) ;
	addCharacterPiece( name, "w_hair_curly", "f5e691" ) ;
	addCharacterPiece( name, "w_stripe_torso", "a1814d" ) ;
	addCharacterPiece( name, "w_stripe_legs", "a1814d" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "bba47d" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "bba47d" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "f5e691" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "f5e691" ) ;
	addCharacterPiece( name, "w_bow_torso", "f5e691" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "542d28" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "542d28" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "542d28" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "542d28"  ) ;
end

function setownedhorse_miladyA( name )
	setOwnedHorse( name, "miladyhorse" ) ;
end

function runAI_milady( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_milady( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- Kitty
function init_kitty( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_kittyA( name )
	placeDead( name ) ;
end

function dress_kittyA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_bow_arm_right", "77b6dd" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "77b6dd" ) ;
	addCharacterPiece( name, "w_hair_plain", "ab924f" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "77b6dd" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "ededed" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "ededed" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "ededed" ) ;
	addCharacterPiece( name, "w_stripe_torso", "d7bc71" ) ;
end

function setownedhorse_kittyA( name )
	setOwnedHorse( name, "kittyhorse" ) ;
end

function runAI_kitty( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_kitty( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- Madame Coquenard
function init_madamecoquenard( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_madamecoquenardA( name )
	placeCharacter( name, "coquenardhouse2", -281, -87 ) ;
end

function dress_madamecoquenardA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_hair_plain", "949494" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "415b33" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "415b33" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "415b33" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "415b33" ) ;
	addCharacterPiece( name, "w_stripe_torso", "d5daa9" ) ;
	addCharacterPiece( name, "w_stripe_legs", "d5daa9" ) ;
	addCharacterPiece( name, "w_collar_fancy", "a74342" ) ;
	addCharacterPiece( name, "w_bow_torso", "a74342" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "a74342" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "a74342" ) ;
end

function runAI_madamecoquenard( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_madamecoquenard( name, chatWith )
	if ( isMissionComplete( "missionrochelle19" ) ) then
		addTimedHeartMaker( name, 0.5 ) ;
		--autoDeleteFaceChat( name, chatWith, getString( "madamecoquenard_d3" ) ) ;
		sayAndWait( name, getString( "madamecoquenard_d3" ) ) ;
	elseif ( isMissionComplete( "missionparis23" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "madamecoquenard_d2" ) ) ;
		sayAndWait( name, getString( "madamecoquenard_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "madamecoquenard_d1" ) ) ;
		sayAndWait( name, getString( "madamecoquenard_d1" ) ) ;
	end
end

-- Monsieur Coquenard
function init_monsieurcoquenard( name )
end

function place_monsieurcoquenardA( name )
	sitCharacter( name, "coquenardchair1" ) ;
end

function place_monsieurcoquenardB( name )
	placeDead( name ) ;
end

function dress_monsieurcoquenard( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "cuff_plain_arm_right", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "cuff_plain_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "boot_sock_right", "dbdbc7" ) ;
	addCharacterPiece( name, "boot_sock_left", "dbdbc7" );
	addCharacterPiece( name, "belt", "adadad" ) ;
	addCharacterPiece( name, "pant_baggy_right", "757575" ) ;
	addCharacterPiece( name, "pant_baggy_left", "757575" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "1d0d06" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "757575" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "757575" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "1d0d06" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "1d0d06" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "dbdbc7" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "dbdbc7" ) ;
	addCharacterPiece( name, "beard_b", "adadad" ) ;
	addCharacterPiece( name, "hair_curly", "adadad" ) ;
end


function runAI_monsieurcoquenard( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_monsieurcoquenard( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "monsieurcoquenard_d1" ) ) ;
	sayAndWait( name, getString( "monsieurcoquenard_d1" ) ) ;
end

-- coquenardservant1
function init_coquenardservant1( name )
end

function place_coquenardservant1( name )
	placeCharacter( name, "coquenardhouse", 145, 160 ) ;
end

function dress_coquenardservant1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt", "4b351c" ) ;
	addCharacterPiece( name, "boot_sock_right", "d5d5d5" ) ;
	addCharacterPiece( name, "boot_sock_left", "d5d5d5" ) ;
	addCharacterPiece( name, "collar_plain", "818181" ) ;
	addCharacterPiece( name, "hair_long", "896944" ) ;
	addCharacterPiece( name, "mustache_a", "896944" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "473e38" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "473e38" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "646464" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "646464" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "646464" ) ;
end

function runAI_coquenardservant1( name )
	while ( true ) do
		local destX = 155 ;
		local destY = 179 ;
		addGoalGetToPointInLevel( name, destX, destY, "coquenardhouse", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 189 ;
		local destY = 233 ;
		addGoalGetToPointInLevel( name, destX, destY, "coquenardhouse", false ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 191 ;
		local destY = 121 ;
		addGoalGetToPointInLevel( name, destX, destY, "coquenardhouse", false ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_coquenardservant1( name, chatWith )
	if ( isMissionComplete( "missionrochelle19" ) ) then
		sayAndWait( name, getString( "coquenardservant1_d2" ) ) ;
		sayAndWait( chatWith, getString( "coquenardservant1_d3" ) ) ;
		sayAndWait( name, getString( "coquenardservant1_d4" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "coquenardservant1_d1" ) ) ;
		sayAndWait( name, getString( "coquenardservant1_d1" ) ) ;
	end
end

-- chevsouveray
function init_chevsouveray( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_chevsouverayA( name )
	placeCharacter( name, "louvrehouse", 464, -830 ) ;
end

function dress_chevsouverayA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "cc3543" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "f4e162" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "f4e162" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "cc3543" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "cc3543" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "f4e162" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "f4e162" ) ;
	addCharacterPiece( name, "boot_plain_right", "9b9b9b" ) ;
	addCharacterPiece( name, "boot_plain_left", "9b9b9b" ) ;
	addCharacterPiece( name, "glove_plain_left", "9b9b9b" ) ;
	addCharacterPiece( name, "glove_plain_right", "9b9b9b" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "817b54" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "817b54" ) ;
	addCharacterPiece( name, "hair_long", "ac996b" ) ;	
end

function dress_chevsouverayB( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "mask_1", "94a954" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "94a954" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "94a954" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "94a954" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "94a954" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "94a954" ) ;
	addCharacterPiece( name, "boot_plain_right", "d28b3e" ) ;
	addCharacterPiece( name, "boot_plain_left", "d28b3e" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "d28b3e" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "d28b3e" ) ;
	addCharacterPiece( name, "glove_plain_right", "4c351d" ) ;
	addCharacterPiece( name, "glove_plain_left", "4c351d" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "c44940" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "c44940" ) ;
	addCharacterPiece( name, "hair_long", "ac996b" ) ;	
end

function runAI_chevsouveray( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_chevsouveray( name, chatWith )
	genericGreeting( name, chatWith, 0.53 ) ;
end

-- comtecramail
function init_comtecramail( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_comtecramailA( name )
	placeCharacter( name, "louvrehouse", 505, -830 ) ;
end

function dress_comtecramailA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "pant_baggy_right", "add690" ) ;
	addCharacterPiece( name, "pant_baggy_left", "add690" ) ;
	addCharacterPiece( name, "belt", "ebcf48" ) ;
	addCharacterPiece( name, "boot_plain_right", "83672a") ;
	addCharacterPiece( name, "boot_plain_left", "83672a") ;
	addCharacterPiece( name, "hair_medium", "b4873e" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "d8f2f4" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "d8f2f4" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "75a552" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "75a552" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "75a552" ) ;
end

function dress_comtecramailB( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "mask_4", "dabe5a" ) ;
	addCharacterPiece( name, "pant_baggy_right", "dabe5a" ) ;
	addCharacterPiece( name, "pant_baggy_left", "dabe5a" ) ;
	addCharacterPiece( name, "belt", "4c351d" ) ;
	addCharacterPiece( name, "boot_plain_right", "4c351d") ;
	addCharacterPiece( name, "boot_plain_left", "4c351d") ;
	addCharacterPiece( name, "hair_medium", "b4873e" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "b6924d" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "b6924d" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "c44940" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "c44940" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "c44940" ) ;
end

function runAI_comtecramail( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_comtecramail( name, chatWith )
	genericGreeting( name, chatWith, 0.72 ) ;
end

-- comteroche
function init_comteroche( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_comterocheA( name )
	placeCharacter( name, "louvrehouse", -623, -619 ) ;
end

function dress_comterocheA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "glove_plain_right", "8f8c6b" ) ;
	addCharacterPiece( name, "glove_plain_left", "8f8c6b" ) ;
	addCharacterPiece( name, "boot_sock_right", "f6f4dc" ) ;
	addCharacterPiece( name, "boot_sock_left", "f6f4dc" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "8f8c6b" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "8f8c6b" ) ;
	addCharacterPiece( name, "hair_long", "765f42" ) ;
	addCharacterPiece( name, "beardmus", "765f42" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "3a3f9c" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "3a3f9c"  ) ;
	addCharacterPiece( name, "stripe_plain_torso", "3a3f9c"  ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "3a3f9c" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "3a3f9c" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "cdcaa7" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "cdcaa7" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "cdcaa7" ) ;
end

function dress_comterocheB( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "glove_plain_right", "b6924d" ) ;
	addCharacterPiece( name, "glove_plain_left", "b6924d" ) ;
	addCharacterPiece( name, "boot_sock_right", "b6924d") ;
	addCharacterPiece( name, "boot_sock_left", "b6924d") ;
	addCharacterPiece( name, "pant_musketeer_right", "94a954" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "94a954" ) ;
	addCharacterPiece( name, "hair_long", "765f42" ) ;
	addCharacterPiece( name, "beardmus", "765f42" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "dbbe5a" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "dbbe5a"  ) ;
	addCharacterPiece( name, "stripe_plain_torso", "dbbe5a"  ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "dbbe5a" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "dbbe5a" ) ;
	addCharacterPiece( name, "mask_3", "dbbe5a" ) ;
	addCharacterPiece( name, "mask_5", "c34940" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "d28b3e" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "d28b3e" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "d28b3e" ) ;
	
end

function runAI_comteroche( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_comteroche( name, chatWith )
	fameGreeting( name, chatWith ) ;
end

-- comteharcourt
function init_comteharcourt( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_comteharcourtA( name )
	placeCharacter( name, "louvrehouse", -570, -619 ) ;
end

function dress_comteharcourtA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "boot_sock_right", "d3c7b8") ;
	addCharacterPiece( name, "boot_sock_left", "d3c7b8") ;
	addCharacterPiece( name, "shirt_plain_torso", "a07a4d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "a07a4d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "a07a4d" ) ;
	addCharacterPiece( name, "beret", "a07a4d") ;
	addCharacterPiece( name, "feather_hat_small", "db000a" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "db000a" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "db000a" ) ;
	addCharacterPiece( name, "hair_curly", "ebe244" ) ;
	addCharacterPiece( name, "beard_c", "ebe244" ) ;
	addCharacterPiece( name, "mustache_b", "ebe244" ) ;
	addCharacterPiece( name, "sashbelt", "4c3112" ) ;
	addCharacterPiece( name, "pant_baggy_right", "5a8441" ) ;
	addCharacterPiece( name, "pant_baggy_left", "5a8441" ) ;
end

function dress_comteharcourtB( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "boot_sock_right", "c44940") ;
	addCharacterPiece( name, "boot_sock_left", "c44940") ;
	addCharacterPiece( name, "beret", "c44940") ;
	addCharacterPiece( name, "stripe_plain_leg_right", "c44940" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "c44940" ) ;
	addCharacterPiece( name, "hair_curly", "ebe244" ) ;
	addCharacterPiece( name, "beard_c", "ebe244" ) ;
	addCharacterPiece( name, "mustache_b", "ebe244" ) ;
	addCharacterPiece( name, "sashbelt", "94a954" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "94a954" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "94a954" ) ;
	addCharacterPiece( name, "feather_hat_small", "94a954" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "b6924d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "b6924d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "b6924d" ) ;
	addCharacterPiece( name, "mask_2", "b6924d" ) ;
end

function runAI_comteharcourt( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_comteharcourt( name, chatWith )
	genericGreeting( name, chatWith, 0.83 ) ;
end

-- ducelboeuf
function init_ducelboeuf( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_ducelboeufA( name )
	placeCharacter( name, "louvrehouse", -773, -113 ) ;
end

function dress_ducelboeufA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "glove_plain_right", "c8c8c8" ) ;
	addCharacterPiece( name, "glove_plain_left", "c8c8c8" ) ;
	addCharacterPiece( name, "hair_medium", "978973" ) ;
	addCharacterPiece( name, "beard_b", "978973" ) ;
	addCharacterPiece( name, "belt", "8f8054" ) ;
	addCharacterPiece( name, "sashbelt", "4177aa" ) ;
	addCharacterPiece( name, "boot_fancy_right", "8e8054" ) ;
	addCharacterPiece( name, "boot_fancy_left", "8e8054" );
	addCharacterPiece( name, "pant_musketeer_right", "c2b032" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "c2b032" ) ;
	addCharacterPiece( name, "hat_plain", "8f8054" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "8ad2f3" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "8ad2f3"  ) ;
	addCharacterPiece( name, "shirt_plain_torso", "8ad2f3" ) ;
	addCharacterPiece( name, "feather_hat_plain", "f5db28" ) ;
	
end

function dress_ducelboeufB( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "glove_plain_right", "c44940" ) ;
	addCharacterPiece( name, "glove_plain_left", "c44940" ) ;
	addCharacterPiece( name, "mask_2", "c44940" ) ;
	addCharacterPiece( name, "hair_medium", "978973" ) ;
	addCharacterPiece( name, "beard_b", "978973" ) ;
	addCharacterPiece( name, "belt", "b6924d" ) ;
	addCharacterPiece( name, "sashbelt", "b6924d" ) ;
	addCharacterPiece( name, "boot_fancy_right", "b6924d" ) ;
	addCharacterPiece( name, "boot_fancy_left", "b6924d" );
	addCharacterPiece( name, "pant_musketeer_right", "4c351d" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "4c351d" ) ;
	addCharacterPiece( name, "hat_plain", "4c351d" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "dbbe5a" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "dbbe5a"  ) ;
	addCharacterPiece( name, "shirt_plain_torso", "dbbe5a" ) ;
	addCharacterPiece( name, "feather_hat_plain", "dbbe5a" ) ;
end

function runAI_ducelboeuf( name )
	setBaseFaceDirection( name, -1, 1 ) ;
end

function chat_ducelboeuf( name, chatWith )
	genericGreeting( name, chatWith, 0.62 ) ;
end

-- duclongueville
function init_duclongueville( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_duclonguevilleA( name )
	placeCharacter( name, "louvrehouse", -810, -85 ) ;
end

function dress_duclonguevilleA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "hair_long", "dad394" ) ;
	addCharacterPiece( name, "mustache_a", "dad394" ) ;
	addCharacterPiece( name, "beard_c", "dad394" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "boot_plain_right", "dacfc3" ) ;
	addCharacterPiece( name, "boot_plain_left", "dacfc3" );
	addCharacterPiece( name, "doublet_plain_torso", "8d7051" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "8d7051" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "8d7051" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "7a562f" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "7a562f" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "efcb21" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "efcb21" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "efcb21" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "efcb21" ) ;
	addCharacterPiece( name, "belt", "efcb21" ) ;
	addCharacterPiece( name, "hat_simple", "22211f" ) ;
	addCharacterPiece( name, "feather_hat_small", "5c92ca" ) ;
end

function dress_duclonguevilleB( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "hair_long", "dad394" ) ;
	addCharacterPiece( name, "mustache_a", "dad394" ) ;
	addCharacterPiece( name, "beard_c", "dad394" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "boot_plain_right", "b6924d" ) ;
	addCharacterPiece( name, "boot_plain_left", "b6924d" );
	addCharacterPiece( name, "doublet_plain_torso", "dbbe5a" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "dbbe5a" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "dbbe5a" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "dbbe5a" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "dbbe5a" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "94a954" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "94a954" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "c44940" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "c44940" ) ;
	addCharacterPiece( name, "belt", "b6924d" ) ;
	addCharacterPiece( name, "hat_simple", "b6924d" ) ;
	addCharacterPiece( name, "mask_3", "94a954" ) ;
	addCharacterPiece( name, "feather_hat_small", "c44940" ) ;
end

function runAI_duclongueville( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_duclongueville( name, chatWith )
	genericGreeting( name, chatWith, 0.79 ) ;
end

-- baradas
function init_baradas( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_baradasA( name )
	placeCharacter( name, "france", -1108, -513 ) ;
end

function dress_baradasA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "boot_sock_right", "969b9e" ) ;
	addCharacterPiece( name, "boot_sock_left", "969b9e" );
	addCharacterPiece( name, "belt", "969b9e" ) ;
	addCharacterPiece( name, "hat_simple", "969b9e" ) ;
	addCharacterPiece( name, "pant_baggy_right", "a6cfec" ) ;
	addCharacterPiece( name, "pant_baggy_left", "a6cfec" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "a6cfec" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "a6cfec" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "a6cfec" ) ;
	addCharacterPiece( name, "sashbelt", "c44940" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "e8d92b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e8d92b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e8d92b" ) ;
end

function dress_baradasB( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "boot_sock_right", "94a954" ) ;
	addCharacterPiece( name, "boot_sock_left", "94a954" );
	addCharacterPiece( name, "belt", "94a954" ) ;
	addCharacterPiece( name, "hat_simple", "94a954" ) ;
	addCharacterPiece( name, "mask_4", "b6924d" ) ;
	addCharacterPiece( name, "pant_baggy_right", "b6924d" ) ;
	addCharacterPiece( name, "pant_baggy_left", "b6924d" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "4c351d" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "4c351d" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "4c351d" ) ;
	addCharacterPiece( name, "sashbelt", "c44940" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left" ) ;
end

function runAI_baradas( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_baradas( name, chatWith )
	genericGreeting( name, chatWith, 0.63 ) ;
end

-- liancout
function init_liancout( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_liancoutA( name )
	placeCharacter( name, "france", -1191, -35 ) ;
end

function dress_liancoutA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "boot_fancy_right", "9c883a" ) ;
	addCharacterPiece( name, "boot_fancy_left", "9c883a" );
	addCharacterPiece( name, "beret", "3a587d" ) ;
	addCharacterPiece( name, "belt", "deb544" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "3a587d" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "3a587d" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "88afde" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "88afde" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "88afde" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
	addCharacterPiece( name, "beardmus", "735f4a" ) ;
end

function dress_liancoutB( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
		
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "boot_fancy_right", "94a954" ) ;
	addCharacterPiece( name, "boot_fancy_left", "94a954" );
	addCharacterPiece( name, "beret", "94a954" ) ;
	addCharacterPiece( name, "belt", "c44940" ) ;
	addCharacterPiece( name, "mask_4", "c44940" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "dbbe5a" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "dbbe5a" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "d28b3e" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "d28b3e" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "d28b3e" ) ;
	addCharacterPiece( name, "shirt_plain_torso" ) ;
	addCharacterPiece( name, "beardmus", "735f4a" ) ;

end

function runAI_liancout( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_liancout( name, chatWith )
	genericGreeting( name, chatWith, 0.05 ) ;
end

-- donnaestefania
function init_donnaestefania( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_donnaestefaniaA( name )
	placeCharacter( name, "louvrehouse2", -738, -607 ) ;
end

function dress_donnaestefaniaA( name )
	clearCharacterPieces( name ) ;

	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;

	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1,1, 0.8 ) ;
	addCharacterPiece( name, "w_bow_torso", "f6c356") ;
	addCharacterPiece( name, "w_bow_arm_right", "f6c356") ;
	addCharacterPiece( name, "w_bow_arm_left", "f6c356") ;
	addCharacterPiece( name, "w_hair_curly", "bb7350") ;
	addCharacterPiece( name, "w_stripe_torso", "efdaab" ) ;
	addCharacterPiece( name, "w_stripe_legs", "efdaab" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "faa4cb" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "faa4cb" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "faa4cb" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "faa4cb" ) ;
end

function dress_donnaestefaniaB( name )
	clearCharacterPieces( name ) ;

	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;

	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_fancy", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1,1, 0.8 ) ;
	addCharacterPiece( name, "w_bow_torso", "f6c356") ;
	addCharacterPiece( name, "w_bow_arm_right", "f6c356") ;
	addCharacterPiece( name, "w_bow_arm_left", "f6c356") ;
	addCharacterPiece( name, "w_stripe_torso", "dbbe5a" ) ;
	addCharacterPiece( name, "w_stripe_legs", "dbbe5a" ) ;
	addCharacterPiece( name, "w_mask_3", "dbbe5a" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "c44940" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "c44940" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "c44940" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "c44940" ) ;
	addCharacterPiece( name, "w_mask_5", "c44940" ) ;
	addCharacterPiece( name, "w_hair_curly", "bb7350") ;
end

function runAI_donnaestefania( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_donnaestefania( name, chatWith )
	if ( isMissionComplete( "missionrochelle16" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "donnaestefania_d2" ) ) ;
		sayAndWait( name, getString( "donnaestefania_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "donnaestefania_d1" ) ) ;
		sayAndWait( name, getString( "donnaestefania_d1" ) ) ;
	end
end

-- madameguemenee
function init_madameguemenee( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_madameguemeneeA( name )
	placeCharacter( name, "france", -1126, -371 ) ;
end

function dress_madameguemeneeA( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_hair_plain", "e5e2a5" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "46844d" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "7abd81" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "7abd81" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "7abd81" ) ;
	addCharacterPiece( name, "w_stripe_torso", "ede258" ) ;
	addCharacterPiece( name, "w_stripe_legs", "ede258" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "ede258" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "ede258" ) ;
end

function dress_madameguemeneeB( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_hair_plain", "e5e2a5" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e5e2a5" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "e5e2a5" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "e5e2a5" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "e5e2a5" ) ;
	addCharacterPiece( name, "w_mask_5", "e5e2a5"  ) ;
	addCharacterPiece( name, "w_mask_4", "b6924d"  ) ;
	addCharacterPiece( name, "w_stripe_torso", "b6924d" ) ;
	addCharacterPiece( name, "w_stripe_legs", "b6924d" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "b6924d" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "b6924d" ) ;
end

function runAI_madameguemenee( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_madameguemenee( name, chatWith )
	genericGreeting( name, chatWith, 0.99 ) ;
end

-- madameguitaut
function init_madameguitaut( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_madameguitautA( name )
	placeCharacter( name, "france", -1037, -841 ) ;
end

function dress_madameguitautA( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1, 0.8  ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, 0.8  ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, 0.8  ) ;
	addCharacterPiece( name, "w_hair_curly", "70522d" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "deb544" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "deb544" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "deb544" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "deb544" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "ee6189" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "ee6189" ) ;
	addCharacterPiece( name, "w_bow_torso", "ee6189" ) ;
end

function dress_madameguitautB( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, 0.8  ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, 0.8  ) ;
	addCharacterPiece( name, "w_hair_curly", "70522d" ) ;
	addCharacterPiece( name, "w_mask_2", "b6924d" ) ;
	addCharacterPiece( name, "w_mask_6", "94a954" );
	addCharacterPiece( name, "w_dress_plain_torso", "b6924d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "b6924d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "b6924d" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "4c351d" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "4c351d" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "4c351d" ) ;
	addCharacterPiece( name, "w_bow_torso", "4c351d" ) ;
end

function runAI_madameguitaut( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_madameguitaut( name, chatWith )
	genericGreeting( name, chatWith, 0.78 ) ;
end

-- madamelannoy
function init_madamelannoy( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_madamelannoyA( name )
	placeCharacter( name, "louvrehouse", -766, -932 ) ;
end

function dress_madamelannoyA( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_hair_plain", "f5c865" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "dd4e84" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "dd4e84" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "dd4e84" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "fdfe7a" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "fdfe7a" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "a5c8e5" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "a5c8e5" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "a5c8e5"  ) ;
	addCharacterPiece( name, "w_stripe_legs", "a5c8e5"  ) ;
end

function dress_madamelannoyB( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_hair_plain", "f5c865" ) ;
	addCharacterPiece( name, "w_mask_1", "b6924d" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "b6924d" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "b6924d" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "b6924d" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "b6924d" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "b6924d" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "94a954" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "94a954" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "94a954"  ) ;
	addCharacterPiece( name, "w_stripe_legs", "94a954"  ) ;
end

function runAI_madamelannoy( name )
	setBaseFaceDirection( name, 1, -1 ) ;
	wait( 1 ) ;
end

function chat_madamelannoy( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "madamelannoy_d1" ) ) ;
	sayAndWait( name, getString( "madamelannoy_d1" ) ) ;
end

-- madamemontbazon
function init_madamemontbazon( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_madamemontbazonA( name )
	placeCharacter( name, "louvrehouse", -602, -975 ) ;
end

function dress_madamemontbazonA( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_hair_short", "24221f" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "75279d" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "75279d" ) ;
	addCharacterPiece( name, "w_stripe_torso", "a56fc1" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a56fc1" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "b5b6f0" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "b5b6f0" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "b5b6f0"  ) ;
	addCharacterPiece( name, "w_stripe_legs", "b5b6f0"  ) ;
end

function dress_madamemontbazonB( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left", 1, 1, 1, 0.9 ) ;
	addCharacterPiece( name, "w_hair_short", "24221f" ) ;
	addCharacterPiece( name, "w_mask_2", "c44940" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "c44940" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "c44940" ) ;
	addCharacterPiece( name, "w_stripe_torso", "c44940" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "c44940" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "d28b3e" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "d28b3e" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "d28b3e"  ) ;
	addCharacterPiece( name, "w_stripe_legs", "d28b3e"  ) ;
end

function runAI_madamemontbazon( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_madamemontbazon( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "madamemontbazon_d1" ) ) ;
	sayAndWait( name, getString( "madamemontbazon_d1" ) ) ;
end

-- madamesable
function init_madamesable( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_madamesableA( name )
	placeCharacter( name, "france", -1205, -465 ) ;
end

function dress_madamesableA( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "ede082" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "5a8e8e" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "5a8e8e" ) ;
	addCharacterPiece( name, "w_bow_torso", "5a8e8e" ) ;
	addCharacterPiece( name, "w_stripe_legs", "5a8e8e"  ) ;
	addCharacterPiece( name, "w_stripe_torso", "d13b49" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "d13b49"  ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "d13b49"  ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "d13b49" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "f4d8e0" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "f4d8e0" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "f4d8e0"  ) ;
end

function dress_madamesableB( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "ede082" ) ;
	addCharacterPiece( name, "w_mask_3", "94a954" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "94a954" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "94a954" ) ;
	addCharacterPiece( name, "w_bow_torso", "94a954" ) ;
	addCharacterPiece( name, "w_mask_6", "bf473e" ) ;
	addCharacterPiece( name, "w_stripe_torso", "bf473e" ) ;
	addCharacterPiece( name, "w_stripe_legs", "bf473e"  ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "bf473e"  ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "bf473e"  ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "dbbe5a" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "dbbe5a" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "dbbe5a" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "dbbe5a"  ) ;
end

function runAI_madamesable( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_madamesable( name, chatWith )
	genericGreeting( name, chatWith, 0.54 ) ;
end

-- madamesurgis
function init_madamesurgis( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_madamesurgisA( name )
	placeCharacter( name, "france", -1125, -28 ) ;
end

function dress_madamesurgisA( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_hair_pinned", "787059" ) ;
	addCharacterPiece( name, "w_stripe_legs", "ded184"  ) ;
	addCharacterPiece( name, "w_hat_plain", "ded184" ) ;
	addCharacterPiece( name, "w_stripe_torso", "d093d7" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "d093d7" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "ded184" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "ded184" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "ded184"  ) ;
end

function dress_madamesurgisB( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "w_hair_pinned", "787059" ) ;
	addCharacterPiece( name, "w_mask_4", "94a954" ) ;
	addCharacterPiece( name, "w_stripe_legs", "94a954"  ) ;
	addCharacterPiece( name, "w_hat_plain", "d28b3e" ) ;
	addCharacterPiece( name, "w_stripe_torso", "d28b3e" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "d28b3e" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "dbbe5a" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "dbbe5a" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "dbbe5a"  ) ;
end

function runAI_madamesurgis( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_madamesurgis( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "likefountains" ) ) ;
	sayAndWait( name, getString( "likefountains" ) ) ;
end

-- stcloudman1
function init_stcloudman1( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_stcloudman1( name )
	placeCharacter( name, "stcloudhouseb", 21, 146 ) ;
end

function dress_stcloudman1( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt", "a1813b" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "boot_sock_right", "dde9f3" ) ;
	addCharacterPiece( name, "boot_sock_left", "dde9f3" );
	addCharacterPiece( name, "hair_short", "7d7268" ) ;
	addCharacterPiece( name, "mustache_b", "7d7268" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "657b9b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "dde9f3" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "dde9f3" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "817c70" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "817c70" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "e6d860" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "e6d860" ) ;

end

function runAI_stcloudman1( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_stcloudman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "stcloudman1_d1" ) ) ;
	sayAndWait( name, getString( "stcloudman1_d1" ) ) ;
end

-- stcloudman2
function init_stcloudman2( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_stcloudman2( name )
	placeCharacter( name, "france", -3918, 2395 ) ;
end

function dress_stcloudman2( name )
	clearCharacterPieces( name ) ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beret", "859d73" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "boot_sock_right", "e9e1cf" ) ;
	addCharacterPiece( name, "boot_sock_left", "e9e1cf" );
	addCharacterPiece( name, "hair_long", "927542" ) ;
	addCharacterPiece( name, "beardmus", "927542" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "b1a487" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "b1a487" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "b1a487" ) ;
	addCharacterPiece( name, "pant_baggy_right", "484236" ) ;
	addCharacterPiece( name, "pant_baggy_left", "484236" ) ;
end

function runAI_stcloudman2( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_stcloudman2( name, chatWith )
	genericGreeting( name, chatWith, 0.97 ) ;
end

-- stcloudlady1
function init_stcloudlady1( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_stcloudlady1( name )
	placeCharacter( name, "france", -4826, 2455 ) ;
end

function dress_stcloudlady1( name )
	clearCharacterPieces( name ) ;

	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "98364a" ) ;
	addCharacterPiece( name, "w_stripe_torso", "98364a" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "dacb8d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "dacb8d" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso","dacb8d" ) ;
	addCharacterPiece( name, "w_hair_short", "81634a"  ) ;

end

function runAI_stcloudlady1( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_stcloudlady1( name, chatWith )
	genericGreeting( name, chatWith, 0.89 ) ;
end

-- stcloudhousecman1
function init_stcloudhousecman1( name )
end

function place_stcloudhousecman1( name )
	placeCharacter( name, "stcloudhousec2", 109, -48 ) ;
end

function dress_stcloudhousecman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "ad6c20" ) ;
	addCharacterPiece( name, "belt", "715e47" ) ;
	addCharacterPiece( name, "sashbelt", "553c1f" ) ;
	addCharacterPiece( name, "boot_fancy_right", "715e47" ) ;
	addCharacterPiece( name, "boot_fancy_left", "715e47" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "8c8e50" ) ;
	addCharacterPiece( name, "hair_medium", "ad6c20" ) ;
	addCharacterPiece( name, "mustache_a", "ad6c20" ) ;
	addCharacterPiece( name, "pant_baggy_right", "68834b" ) ;
	addCharacterPiece( name, "pant_baggy_left", "68834b" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "8c8e50" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "8c8e50" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "68834b" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "68834b" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "8c8e50" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "8c8e50" ) ;
end

function runAI_stcloudhousecman1( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_stcloudhousecman1( name, chatWith )
	if ( isMissionComplete( "missionsinglepuppy4" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "msinglepuppy4d2" ) ) ;
		sayAndWait( name, getString( "msinglepuppy4d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "msinglepuppy0d2" ) ) ;
		sayAndWait( name, getString( "msinglepuppy0d2" ) ) ;
	end
end

-- stcloudhouseclady1
function init_stcloudhouseclady1( name )
	setWoman( name, true ) ;
end

function place_stcloudhouseclady1( name )
	placeCharacter( name, "stcloudhousec", 221, -14 ) ;
end

function dress_stcloudhouseclady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "c66abe" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "c66abe" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "c66abe" ) ;
	addCharacterPiece( name, "w_hair_curly", "d2c256" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "eca1cd" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "eca1cd" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "eca1cd" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "eca1cd" ) ;
end

function runAI_stcloudhouseclady1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_stcloudhouseclady1( name, chatWith )
	if ( isMissionComplete( "missionsinglepuppy4" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "msinglepuppy4d3" ) ) ;
		sayAndWait( name, getString( "msinglepuppy4d3" ) ) ;
	else
		sayAndWait( name, getString( "msinglepuppy0d1" ) ) ;
	
		local requireHonour = 10 ;
		if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
			setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
		elseif ( getTooManyActiveMissions( ) ) then
			setQuickInfoTag( getString( "toomanymissions" ) ) ;
		else
			-- meets minimum requirements
			local bubInd = characterSay( name, true, -1, -1, false, getString( "msinglepuppy0d3" ) ) ;
			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( name, getString( "msinglepuppy0d4" ) ) ;
				
				activateMission( "missionsinglepuppy1" ) ;
			else
				-- no
			end
		end
	end
end

-- stcloudhousecservant1
function init_stcloudhousecservant1( name )
	setWoman( name, true ) ;
end

function place_stcloudhousecservant1( name )
	placeCharacter( name, "stcloudhousec", 305, 172 ) ;
end

function dress_stcloudhousecservant1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "dedede" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "563e2c" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "6f5d50" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "6f5d50" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "6f5d50" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "5e5d5d" ) ;
	addCharacterPiece( name, "w_hat_cap", "dedede" ) ;
end

function runAI_stcloudhousecservant1( name )
	while ( true ) do
		local destX = 320 ;
		local destY = 148 ;
		addGoalGetToPointInLevel( name, destX, destY, "stcloudhousec", false ) ;
		setBaseFaceDirection( name, 1, -1 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;

		local destX = 325 ;
		local destY = 187 ;
		addGoalGetToPointInLevel( name, destX, destY, "stcloudhousec", false ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		waitForNoGoal( name ) ;
		wait( randomDouble( 2, 6 ) ) ;
	end
end

function chat_stcloudhousecservant1( name, chatWith )
	if ( isMissionComplete( "missionsinglepuppy4" ) ) then
		addTimedHeartMaker( name, 4.0 ) ;
		--autoDeleteFaceChat( name, chatWith, getString( "stcloudhousecservant1_d2" ) ) ;
		sayAndWait( name, getString( "stcloudhousecservant1_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "stcloudhousecservant1_d1" ) ) ;
		sayAndWait( name, getString( "stcloudhousecservant1_d1" ) ) ;
	end
end

-- stgermainhousealady
function init_stgermainhousealady( name )
	setWoman( name, true ) ;
end

function place_stgermainhousealady( name )
	placeCharacter( name, "stgermainhousea", -145, 93 ) ;
end

function dress_stgermainhousealady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "ede2e2" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "d9b249" ) ;
	addCharacterPiece( name, "w_stripe_torso", "e9c5c7" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "955255" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "955255" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "955255" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "322215" ) ;
	addCharacterPiece( name, "w_hat_cap", "ede2e2" ) ;
end

function runAI_stgermainhousealady( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		if ( isMissionComplete( "missionfencers3" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 4 ) ;
		else
			local destX = -198 ;
			local destY = 67 ;
			setBaseFaceDirection( name, -1, 0 ) ;
			addGoalGetToPointInLevel( name, destX, destY, "stgermainhousea", false ) ;
			waitForNoGoal( name ) ;
			wait( randomDouble( 3.0, 5.0 ) ) ;
			
			destX = -109 ;
			destY = 29 ;
			setBaseFaceDirection( name, 0, -1 ) ;
			addGoalGetToPointInLevel( name, destX, destY, "stgermainhousea", false ) ;
			waitForNoGoal( name ) ;
			wait( randomDouble( 1.0, 2.0 ) ) ;
	
			destX = -196 ;
			destY = 193 ;
			setBaseFaceDirection( name, -1, 0 ) ;
			addGoalGetToPointInLevel( name, destX, destY, "stgermainhousea", false ) ;
			waitForNoGoal( name ) ;
			wait( randomDouble( 3.0, 5.0 ) ) ;
		
			destX = -197 ;
			destY = 27 ;
			setBaseFaceDirection( name, -1, -1 ) ;
			addGoalGetToPointInLevel( name, destX, destY, "stgermainhousea", false ) ;
			waitForNoGoal( name ) ;
			wait( randomDouble( 1.0, 2.0 ) ) ;
		end
				
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_stgermainhousealady( name, chatWith )
	if ( isMissionComplete( "missionfencers3" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "stcloudhousecservant1_d1" ) ) ;
		sayAndWait( name, getString( "stcloudhousecservant1_d1" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "stgermainhousealady_d1" ) ) ;
		sayAndWait( name, getString( "stgermainhousealady_d1" ) ) ;
	end
end

-- stgermainhouseapaul
function init_stgermainhouseapaul( name )
end

function place_stgermainhouseapaul( name )
	placeCharacter( name, "stgermainhousea", 123, 133 ) ;
end

function dress_stgermainhouseapaul( name )
	randomDressEnemy( name, 1.0, 1369912 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_stgermainhouseapaul( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_stgermainhouseapaul( name, chatWith )
	local requireHonour = 10 ;
	if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
		sayAndWait( name, getString( "mfencers0d1" ) ) ;
		setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
	elseif ( getTooManyActiveMissions( ) ) then
		sayAndWait( name, getString( "mfencers0d1" ) ) ;
		setQuickInfoTag( getString( "toomanymissions" ) ) ;
	else
		-- meets minimum requirements
		sayAndWait( name, getString( "mfencers0d1" ) ) ;

		local bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "mfencers0d2" ), getString( "mfencers0d3" ) ) ;
		local option = waitForBubbleOption( bubInd ) ;
		if ( option == 0 ) then
			-- accept
			activateMission( "missionfencers1" ) ;
		else
			-- reject
		end
	end
end

-- stgermainhouseapierre
function init_stgermainhouseapierre( name )
end

function place_stgermainhouseapierre( name )
	placeCharacter( name, "stgermainhousea", 36, 25 ) ;
end

function dress_stgermainhouseapierre( name )
	randomDressEnemy( name, 1.0, 77912 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_stgermainhouseapierre( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_stgermainhouseapierre( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "jetter_d1" ) ) ;
	sayAndWait( name, getString( "jetter_d1" ) ) ;
end

-- stgermainhouseajacques
function init_stgermainhouseajacques( name )
end

function place_stgermainhouseajacques( name )
	placeCharacter( name, "stgermainhousea", 491, 179 ) ;
end

function dress_stgermainhouseajacques( name )
	randomDressEnemy( name, 1.0, 1345912 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_stgermainhouseajacques( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_stgermainhouseajacques( name, chatWith )
	if ( isMissionComplete( "missionfencers1" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "jetter_d2" ) ) ;
		sayAndWait( name, getString( "jetter_d2" ) ) ;
	else
		--autoDeleteFaceChat( name, chatWith, getString( "jetter_d1" ) ) ;
		sayAndWait( name, getString( "jetter_d1" ) ) ;
	end
end

-- stgermainstoreaman
function init_stgermainstoreaman( name )
end

function place_stgermainstoreaman( name )
	placeCharacter( name, "stgermainstorea", 48, -47 ) ;
end

function dress_stgermainstoreaman( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a", "808080" ) ;
	addCharacterPiece( name, "belt", "90755d" ) ;
	addCharacterPiece( name, "boot_fancy_right", "3e3226" ) ;
	addCharacterPiece( name, "boot_fancy_left", "3e3226" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "73665a" ) ;
	addCharacterPiece( name, "hair_long", "808080" ) ;
	addCharacterPiece( name, "mustache_a", "808080" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "73684c" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "73684c" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "ded8d4" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "ded8d4" ) ;
end

function runAI_stgermainstoreaman( name )
	setBaseFaceDirection( name, -1, 1 ) ;
end

function chat_stgermainstoreaman( name, chatWith )

	local swords = {
		"sword_6",
		"sword_8", 
		"sword_10", 
		"sword_11", 
		"sword_12", 
		"sword_13", 
		"sword_14", 
		"sword_15",
		"sword_16", 
		"sword_17", 
		"sword_18", 
		"sword_19", 
		"sword_20", 
		"sword_21",
		"sword_23",
		"sword_25" } ;

	local pistols = { 
		"pistol_matchlock_3", 
		"pistol_wheellock_1", 
		"pistol_wheellock_3", 
		"pistol_snaplock_1", 
		"pistol_snaplock_2", 
		"pistol_snaplock_3", 
		"pistol_snaplock_4", 
		"pistol_snaplock_5", 
		"pistol_snaphance_1", 
		"pistol_snaphance_2", 
		"pistol_snaphance_3", 
		"pistol_snaphance_4", 
		"pistol_snaphance_5" } ;

	local muskets = { 
		"musket_matchlock_3", 
		"musket_wheellock_1", 
		"musket_wheellock_3", 
		"musket_snaplock_1", 
		"musket_snaplock_2", 
		"musket_snaplock_3", 
		"musket_snaplock_4", 
		"musket_snaplock_5", 
		"musket_snaphance_1", 
		"musket_snaphance_2",
		"musket_snaphance_3", 
		"musket_snaphance_4", 
		"musket_snaphance_5" } ;

	chat_weapondealers( name, chatWith, swords, pistols, muskets ) ;
end

-- stgermainhousecman1
function init_stgermainhousecman1( name )
end

function place_stgermainhousecman1( name )
	placeCharacter( name, "stgermainhousec", 200, 73 ) ;
end

function dress_stgermainhousecman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "hat_holy", "bd251a" ) ;
	addCharacterPiece( name, "cloak_holy", "bd251a" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_short", "959595" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "bd251a" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "bd251a" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "bd251a" ) ;
	addCharacterPiece( name, "pant_monk_legs", "bd251a" ) ;
end

function runAI_stgermainhousecman1( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_stgermainhousecman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "priest_d1" ) ) ;
	sayAndWait( name, getString( "priest_d1" ) ) ;
end

-- stgermainhousecman2
function init_stgermainhousecman2( name )
end

function place_stgermainhousecman2( name )
	placeCharacter( name, "stgermainhousec", 240, 73 ) ;
end

function dress_stgermainhousecman2( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "9f9888" ) ;
	addCharacterPiece( name, "mustache_b", "9f9888" ) ;
	addCharacterPiece( name, "hat_holy", "885294" ) ;
	addCharacterPiece( name, "cloak_holy", "885294" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "885294" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "885294" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "885294" ) ;
	addCharacterPiece( name, "pant_monk_legs", "885294" ) ;
end

function runAI_stgermainhousecman2( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_stgermainhousecman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "priest_d4" ) ) ;
	sayAndWait( name, getString( "priest_d4" ) ) ;
end

-- calaishousecman
function init_calaishousecman( name )
end

function place_calaishousecman( name )
	placeCharacter( name, "calaishousec", -15, -13 ) ;
end

function dress_calaishousecman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;

	addCharacterPiece( name, "beard_c", "0e0610" ) ;	
	addCharacterPiece( name, "belt", "cfb436" ) ;
	addCharacterPiece( name, "sashbelt", "e0c754" ) ;
	addCharacterPiece( name, "boot_sock_right"  ) ;
	addCharacterPiece( name, "boot_sock_left" ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, .9 ) ;
	addCharacterPiece( name, "hair_long", "0e0610" ) ;
	addCharacterPiece( name, "mustache_b", "0e0610" ) ;
	addCharacterPiece( name, "pant_baggy_right", "e7c93e" ) ;
	addCharacterPiece( name, "pant_baggy_left", "e7c93e" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "617dd7" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "617dd7" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "617dd7" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "e7c93e" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "e7c93e" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "e7c93e" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "617dd7" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "617dd7" ) ;
end

function unlockDartOnNoGoals( )
	waitForNoGoal( "dartagnan" ) ;
	unlockPlayerInPlace( ) ;
	gCalaisHouseCManDartLeft = true ;
end

function runAI_calaishousecman( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;

	while ( true ) do
		if ( gCalaisHouseCManDartLeft and ( getCharacterFunctionalLevel( "dartagnan" ) == "calaishousec" ) ) then
			gCalaisHouseCManDartLeft = false ;
			lockPlayerInPlace( ) ;
			
			setBaseFaceCharacter( "dartagnan", name ) ;
			addGoalGetToPointInLevel( "dartagnan", 59, 55, "calaishousec", false, true ) ;
			waitForNoGoal( "dartagnan" ) ;
			
			sayAndWait( name, getString( "calaishousecman_d1" ) ) ;

			setBaseFaceNone( "dartagnan" ) ;				

			addGoalGetToPointInLevel( "dartagnan", 5693, -18878, "france", false, true ) ;
			activateScriptMessage( "unlockDartOnNoGoals" ) ;
		end
		
		coroutine.yield( ) ;
	end
end

function chat_calaishousecman( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- calaishousedman
function init_calaishousedman( name )
end

function place_calaishousedman( name )
	placeCharacter( name, "calaishoused", 26, -30 ) ;
end

function dress_calaishousedman( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "906a3e" ) ;
	addCharacterPiece( name, "sashbelt", "a9a9a9" ) ;
	addCharacterPiece( name, "boot_sock_right", "f0ddf1" ) ;
	addCharacterPiece( name, "boot_sock_left", "f0ddf1" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "c992cc" ) ;
	addCharacterPiece( name, "hair_curly", "906a3e" ) ;
	addCharacterPiece( name, "pant_baggy_right", "834687" ) ;
	addCharacterPiece( name, "pant_baggy_left", "834687" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "c992cc" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "c992cc" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "834687" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "834687" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "c992cc" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "c992cc" ) ;
 end


function runAI_calaishousedman( name )
	while ( true ) do
		if ( isMissionActive( "missionmultipuppy2" ) or isMissionComplete( "missionmultipuppy2" ) ) then
			setBaseFaceCharacter( name, "dartagnan" ) ;
			wait( 1 ) ;
		else
			addGoalGetToPointInLevel( name, -15, -35, "calaishoused", false ) ;
			waitForNoGoal( name ) ;
			
			wait( 0.5 ) ;
			
			addGoalGetToPointInLevel( name, 119, -77, "calaishoused", false ) ;
			waitForNoGoal( name ) ;
			
			wait( 0.5 ) ;
			
			addGoalGetToPointInLevel( name, 46, 33, "calaishoused", false ) ;
			waitForNoGoal( name ) ;
			
			wait( 0.5 ) ;
		end
		
		coroutine.yield( ) ;
	end
end

function chat_calaishousedman( name, chatWith )
	local split1 = gameIsSplit( ) and getGameSplitPart( ) == 1 ;
	if ( split1 ) then
		sayAndWait( name, getString( "mmultipuppy0d1" ) ) ;
		return ;
	end
		
	if ( isMissionComplete( "missionmultipuppy2" ) ) then
		--autoDeleteFaceChat( name, chatWith, getString( "mmultipuppy2d2" ) ) ;
		sayAndWait( name, getString( "mmultipuppy2d2" ) ) ;
	else
		sayAndWait( name, getString( "mmultipuppy0d1" ) ) ;
	
		local requireHonour = 25 ;
		if ( getCharacterHonour( "dartagnan" ) < requireHonour ) then
			setQuickInfoTag( getString( "requirehonour", requireHonour ) ) ;
		elseif ( getTooManyActiveMissions( ) ) then
			setQuickInfoTag( getString( "toomanymissions" ) ) ;
		else
			-- meets minimum requirements
			local bubInd = characterSay( name, true, -1, -1, false, getString( "mmultipuppy0d2" ) ) ;
			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( name, getString( "mmultipuppy0d3" ) ) ;
				
				activateMission( "missionmultipuppy1" ) ;
			else
				-- no
			end
		end
	end
end

-- calaishouseblady
function init_calaishouseblady( name )
	setWoman( name, true ) ;
end

function place_calaishouseblady( name )
	placeCharacter( name, "calaishouseb", 30, -64 ) ;
end

function dress_calaishouseblady( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_plain", "7d684b" ) ;
	addCharacterPiece( name, "w_stripe_torso", "d2c78b" ) ;
	addCharacterPiece( name, "w_stripe_legs", "d2c78b" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "c9b12d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "c9b12d" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "c9b12d" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6e4b26" ) ;
end

function runAI_calaishouseblady( name )
	setBaseFaceDirection( name, -1, -1 ) ;
end

function chat_calaishouseblady( name, chatWith )
	local chestID = getClickObjectID( "puppychest" ) ;
	if ( getClickObjectTileState( chestID ) == 1 ) then
		-- chest closed
		--autoDeleteFaceChat( name, chatWith, getString( "calaishouseblady_d1" ) ) ;
		sayAndWait( name, getString( "calaishouseblady_d1" ) ) ;
	else
		-- chest opened
		--autoDeleteFaceChat( name, chatWith, getString( "calaishouseblady_d2" ) ) ;
		sayAndWait( name, getString( "calaishouseblady_d2" ) ) ;
	end
end

-- calaishouseeman
function init_calaishouseeman( name )
end

function place_calaishouseeman( name )
	placeCharacter( name, "calaishousee", 2, 36 ) ;
end

function dress_calaishouseeman( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "e1c35a" ) ;	
	addCharacterPiece( name, "boot_plain_right", "625e51" ) ;
	addCharacterPiece( name, "boot_plain_left", "625e51" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_short", "e1c35a" ) ;
	addCharacterPiece( name, "mustache_a", "e1c35a" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "8d863a" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "8d863a" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "c2ddbf" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "c2ddbf" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "c2ddbf" ) ;
end

function runAI_calaishouseeman( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_calaishouseeman( name, chatWith )
	genericGreeting( name, chatWith, 0.23 ) ;
end

-- calaishouseaman1
function init_calaishouseaman1( name )
end

function place_calaishouseaman1( name )
	placeCharacter( name, "calaishousea", 108, 39 ) ;
end

function dress_calaishouseaman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a", "4e3f2f" ) ;
	addCharacterPiece( name, "belt", "a8937d" ) ;
	addCharacterPiece( name, "boot_plain_right", "543a1c" ) ;
	addCharacterPiece( name, "boot_plain_left", "543a1c" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "b4ac6a" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "b4ac6a" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "b4ac6a" ) ;
	addCharacterPiece( name, "hair_medium", "4e3f2f" ) ;
	addCharacterPiece( name, "mustache_b", "4e3f2f" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "53371a" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "53371a" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "a8937d" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "a8937d" ) ;
end

function runAI_calaishouseaman1( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_calaishouseaman1( name, chatWith )
	local items = { 
		"ointment", 
		"gloves_poor_1",
		"gloves_ok_1",
		"gloves_best_1" } ;
	
	chat_vendorCustom( name, chatWith, items, getString( "calaishouseaman1_d1" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

-- calaishouseaman2
function init_calaishouseaman2( name )
end

function place_calaishouseaman2( name )
	sitCharacter( name, "calaisabench1" ) ;
end

function dress_calaishouseaman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "ebdc8c" ) ;
	addCharacterPiece( name, "sashbelt", "857251" ) ;
	addCharacterPiece( name, "boot_fancy_right", "857251" ) ;
	addCharacterPiece( name, "boot_fancy_left", "857251" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "feather_hat_small", "a641a7" ) ;
	addCharacterPiece( name, "hat_simple", "9e8c6c" ) ;
	addCharacterPiece( name, "hair_long", "ebdc8c" ) ;
	addCharacterPiece( name, "pant_baggy_right", "605740") ;
	addCharacterPiece( name, "pant_baggy_left", "605740" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "a08e64" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "a08e64" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "a08e64" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e6ddc6" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e6ddc6" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "e6ddc6" ) ;
end

function runAI_calaishouseaman2( name )
end

function chat_calaishouseaman2( name, chatWith )
	genericGreeting( name, chatWith, 0.36 ) ;
end

-- calaishousealady1
function init_calaishousealady1( name )
	setWoman( name, true ) ;
end

function place_calaishousealady1( name )
	placeCharacter( name, "calaishousea", 70, 39 ) ;
end

function dress_calaishousealady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_apron", "f2e9d3" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_curly", "6b4a22" ) ;
	addCharacterPiece( name, "w_stripe_torso", "95c4df" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "a9967e" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "a9967e" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "a9967e" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "3c6089" ) ;
end

function runAI_calaishousealady1( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_calaishousealady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "welcome" ) ) ;
	sayAndWait( name, getString( "welcome" ) ) ;
end

-- calaisman1
function init_calaisman1( name )
end

function place_calaisman1( name )
	placeCharacter( name, "france", 6305, -19067 ) ;
end

function dress_calaisman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a", "78746d" ) ;
	addCharacterPiece( name, "boot_plain_right", "6f5a39" ) ;
	addCharacterPiece( name, "boot_plain_left", "6f5a39" ) ;
	addCharacterPiece( name, "glove_plain_right" ) ;
	addCharacterPiece( name, "glove_plain_left" ) ;
	addCharacterPiece( name, "hat_simple", "6f5a39" ) ;
	addCharacterPiece( name, "hair_short", "78746d" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "5b5341" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "5b5341" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "a78e67" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "a78e67" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "a78e67" ) ;
end

function runAI_calaisman1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "france", 6121, -19067 ) ;
		wait( randomDouble( 1.0, 2.0 ) ) ;
		goalWalkToPoint( name, "france", 6210, -19067 ) ;
		wait( randomDouble( 1.0, 2.0 ) ) ;
		goalWalkToPoint( name, "france", 6408, -19074 ) ;
		wait( randomDouble( 1.0, 2.0 ) ) ;
		goalWalkToPoint( name, "france", 6292, -19069 ) ;
		wait( randomDouble( 1.0, 2.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_calaisman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "calaisman1_d1" ) ) ;
	sayAndWait( name, getString( "calaisman1_d1" ) ) ;
end

-- calaisman2
function init_calaisman2( name )
end

function place_calaisman2( name )
	placeCharacter( name, "france", 5255, -18571 ) ;
end

function dress_calaisman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "belt", "b37f3c" ) ;
	addCharacterPiece( name, "beret", "b37f3c" ) ;
	addCharacterPiece( name, "boot_plain_right", "5f3a19" ) ;
	addCharacterPiece( name, "boot_plain_left", "5f3a19" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "856a46" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "856a46" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "856a46" ) ;
	addCharacterPiece( name, "feather_hat_small", "578341" ) ;
	addCharacterPiece( name, "glove_plain_right", "5f3a19" ) ;
	addCharacterPiece( name, "glove_plain_left", "5f3a19" ) ;
	addCharacterPiece( name, "hair_curly", "28211b" ) ;
	addCharacterPiece( name, "mustache_a", "28211b" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "466a36" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "466a36" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e4ddae" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e4ddae" ) ;
end

function runAI_calaisman2( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_calaisman2( name, chatWith )
	genericGreeting( name, chatWith, 0.67 ) ;
end

-- calaisman3
function init_calaisman3( name )
end

function place_calaisman3( name )
	placeCharacter( name, "france", 5858, -18894 ) ;
end

function dress_calaisman3( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "c28147" ) ;
	addCharacterPiece( name, "belt", "462b2e" ) ;
	addCharacterPiece( name, "boot_fancy_right", "462b2e" ) ;
	addCharacterPiece( name, "boot_fancy_left", "462b2e" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "hair_short", "c28147" ) ;
	addCharacterPiece( name, "mustache_b", "c28147" ) ;
	addCharacterPiece( name, "pant_baggy_right", "945157" ) ;
	addCharacterPiece( name, "pant_baggy_left", "945157" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "dbc6c8" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "dbc6c8" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "dbc6c8" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "945157" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "945157" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "945157" ) ;
end

function runAI_calaisman3( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_calaisman3( name, chatWith )
	genericGreeting( name, chatWith, 0.79 ) ;
end

-- calaislady1
function init_calaislady1( name )
	setWoman( name, true ) ;
end

function place_calaislady1( name )
	placeCharacter( name, "france", 5553, -19523 ) ;
end

function dress_calaislady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "534532" ) ;
	addCharacterPiece( name, "w_hair_pinned", "1e1b16" ) ;
	addCharacterPiece( name, "w_stripe_torso", "94846d" ) ;
	addCharacterPiece( name, "w_stripe_legs", "94846d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "416f9a" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "416f9a" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "416f9a" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "416f9a" ) ;
	addCharacterPiece( name, "w_hat_plain", "94846d" ) ;
end

function runAI_calaislady1( name )
	setBaseFaceDirection( name, -1, -1 ) ;
end

function chat_calaislady1( name, chatWith )
	genericGreeting( name, chatWith, 0.47 ) ;
end

-- calaislady2
function init_calaislady2( name )
	setWoman( name, true ) ;
end

function place_calaislady2( name )
	placeCharacter( name, "france", 5617, -18817 ) ;
end

function dress_calaislady2( name )
clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_apron", "f0e7d9" ) ;
	addCharacterPiece( name, "w_hair_pinned", "95928d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "a18c6f" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "a18c6f" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "a18c6f" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "51483c" ) ;
	addCharacterPiece( name, "w_hat_cap", "f0e7d9" ) ;
end

function runAI_calaislady2( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 1, -1 ) ;
		goalWalkToPoint( name, "france", 5818, -18862 ) ;
		wait( randomDouble( 4.0, 10.0 ) ) ;
		setBaseFaceNone( name ) ;
		goalWalkToPoint( name, "france", 5781, -18680 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		goalWalkToPoint( name, "france", 5769, -18817 ) ;
		goalWalkToPoint( name, "france", 5468, -18821 ) ;
		wait( randomDouble( 1.0, 2.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_calaislady2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "helloonlytraveller" ) ) ;
	sayAndWait( name, getString( "helloonlytraveller" ) ) ;
end

-- doveraman1
function init_doveraman1( name )
end

function place_doveraman1( name )
	sitCharacter( name, "doverachair1" ) ;
end

function dress_doveraman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "belt", "5d4e42" ) ;
	addCharacterPiece( name, "boot_sock_right", "d3cfc7" ) ;
	addCharacterPiece( name, "boot_sock_left", "d3cfc7" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "312d25" ) ;
	addCharacterPiece( name, "hat_simple", "312d25" ) ;
	addCharacterPiece( name, "hair_long", "796036" ) ;
	addCharacterPiece( name, "pant_baggy_right", "312d25" ) ;
	addCharacterPiece( name, "pant_baggy_left", "312d25" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "312d25" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "312d25" ) ;
end

function runAI_doveraman1( name )
end

function chat_doveraman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d1" ) ) ;
	sayAndWait( name, getString( "england_d1" ) ) ;
end

-- doveralady1
function init_doveralady1( name )
	setWoman( name, true ) ;
end

function place_doveralady1( name )
	placeCharacter( name, "doverhousea", 81, -50 ) ;
end

function dress_doveralady1( name )
clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_apron", "d3cfc7" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "5d4e42" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "5d4e42" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "5d4e42" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "312d25" ) ;
	addCharacterPiece( name, "w_hat_cap", "d3cfc7" ) ;
end

function runAI_doveralady1( name )
	setBaseFaceDirection( name, 1, -1 ) ;
end

function chat_doveralady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d2" ) ) ;
	sayAndWait( name, getString( "england_d2" ) ) ;
end

-- dovercman1
function init_dovercman1( name )
end

function place_dovercman1( name )
	placeCharacter( name, "doverhousec", -88, 3 ) ;
end

function dress_dovercman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "9d7837" ) ;
	addCharacterPiece( name, "boot_plain_right", "4e4b46" ) ;
	addCharacterPiece( name, "boot_plain_left", "4e4b46" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "62481b" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "62481b" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "62481b" ) ;
	addCharacterPiece( name, "hair_curly", "9d7837" ) ;
	addCharacterPiece( name, "mustache_a", "9d7837" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "3b2808" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "3b2808" ) ;
end

function runAI_dovercman1( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_dovercman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d3" ) ) ;
	sayAndWait( name, getString( "england_d3" ) ) ;
end

-- doverblady1
function init_doverblady1( name )
	setWoman( name, true ) ;
end

function place_doverblady1( name )
	placeCharacter( name, "doverhouseb", 110, 60 ) ;
end

function dress_doverblady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "e4dac8" ) ;
	addCharacterPiece( name, "w_hair_pinned", "9f814d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "64745b" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "64745b" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "64745b" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "64745b" ) ;

end

function runAI_doverblady1( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_doverblady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d4" ) ) ;
	sayAndWait( name, getString( "england_d4" ) ) ;
end

-- doverman1
function init_doverman1( name )
end

function place_doverman1( name )
	placeCharacter( name, "england", -44, -176 ) ;
end

function dress_doverman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "c4b669" ) ;	
	addCharacterPiece( name, "belt", "604624" ) ;
	addCharacterPiece( name, "boot_plain_right", "604624" ) ;
	addCharacterPiece( name, "boot_plain_left", "604624" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "74655b" ) ;
	addCharacterPiece( name, "feather_hat_small", "698bc4" ) ;
	addCharacterPiece( name, "hat_simple", "35251b" ) ;
	addCharacterPiece( name, "hair_medium", "c4b669" ) ;
	addCharacterPiece( name, "mustache_a", "c4b669" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "35251b" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "35251b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "74655b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "74655b" ) ;
end

function runAI_doverman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_doverman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d5" ) ) ;
	sayAndWait( name, getString( "england_d5" ) ) ;
end

-- doverman2
function init_doverman2( name )
end

function place_doverman2( name )
	placeCharacter( name, "england", -287, -137 ) ;
end

function dress_doverman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "b8b7b7" ) ;
	addCharacterPiece( name, "sashbelt", "927546" ) ;
	addCharacterPiece( name, "boot_sock_right", "e7e3dd" ) ;
	addCharacterPiece( name, "boot_sock_left", "e7e3dd" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "glove_plain_right", "927546" ) ;
	addCharacterPiece( name, "glove_plain_left", "927546" ) ;
	addCharacterPiece( name, "hat_plain", "6a6254" ) ;
	addCharacterPiece( name, "hair_curly", "b8b7b7" ) ;
	addCharacterPiece( name, "mustache_b", "b8b7b7" ) ;
	addCharacterPiece( name, "pant_baggy_right", "6a6254" ) ;
	addCharacterPiece( name, "pant_baggy_left", "6a6254" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "a28557" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "a28557" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "a28557" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e7e3dd" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e7e3dd" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "e7e3dd" ) ;
end

function runAI_doverman2( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		goalWalkToPoint( name, "england", -312, -235 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		goalWalkToPoint( name, "england", -109, -21 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_doverman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d6" ) ) ;
	sayAndWait( name, getString( "england_d6" ) ) ;
end

-- roadhouseenglandman1
function init_roadhouseenglandman1( name )
end

function place_roadhouseenglandman1( name )
	placeCharacter( name, "roadhouseengland", -106, 7 ) ;
end

function dress_roadhouseenglandman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_c", "8f560d" ) ;	
	addCharacterPiece( name, "belt", "78644a" ) ;
	addCharacterPiece( name, "boot_plain_right", "9b9a97" ) ;
	addCharacterPiece( name, "boot_plain_left", "9b9a97" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "bebaa2" ) ;
	addCharacterPiece( name, "hair_medium", "8f560d" ) ;
	addCharacterPiece( name, "mustache_b", "8f560d" ) ;
	addCharacterPiece( name, "pant_baggy_right", "566a7a" ) ;
	addCharacterPiece( name, "pant_baggy_left", "566a7a" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "bebaa2" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "bebaa2" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "bebaa2" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "bebaa2" ) ;
end

function runAI_roadhouseenglandman1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 1, -1 ) ;
		goalWalkToPoint( name, "roadhouseengland", -87, -12 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		setBaseFaceDirection( name, -1, -1 ) ;
		goalWalkToPoint( name, "roadhouseengland", -181, 3 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_roadhouseenglandman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d7" ) ) ;
	sayAndWait( name, getString( "england_d7" ) ) ;
end

-- roadhouseenglandlady1
function init_roadhouseenglandlady1( name )
	setWoman( name, true ) ;
end

function place_roadhouseenglandlady1( name )
	sitCharacter( name, "roadhouseenglandchair1" ) ;
end

function dress_roadhouseenglandlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "978460" ) ;
	addCharacterPiece( name, "w_stripe_torso", "94928f" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "6e5779" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "6e5779" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "6e5779" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "765921" ) ;
	addCharacterPiece( name, "w_hat_cap", "e6e0d5" ) ;
end

function runAI_roadhouseenglandlady1( name )
end

function chat_roadhouseenglandlady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d9" ) ) ;
	sayAndWait( name, getString( "england_d9" ) ) ;
end

-- londonaman1
function init_londonaman1( name )
end

function place_londonaman1( name )
	placeCharacter( name, "londonhousea", 0, 11 ) ;
end

function dress_londonaman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "744e17" ) ;
	addCharacterPiece( name, "belt", "9b7043" ) ;
	addCharacterPiece( name, "boot_sock_right", "dccdbe" ) ;
	addCharacterPiece( name, "boot_sock_left", "dccdbe" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "bcb174" ) ;
	addCharacterPiece( name, "hair_medium", "744e17" ) ;
	addCharacterPiece( name, "mustache_a", "744e17" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "5c6e43" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "5c6e43" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "bcb174" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "bcb174" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "9b7043" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "9b7043" ) ;
end


function runAI_londonaman1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		goalWalkToPoint( name, "londonhousea", -97, 35 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "londonhousea", -62, 108 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_londonaman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d8" ) ) ;
	sayAndWait( name, getString( "england_d8" ) ) ;
end

-- londoneman1
function init_londoneman1( name )
end

function place_londoneman1( name )
	placeCharacter( name, "londonhousee", 18, -1 ) ;
end

function dress_londoneman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "e9e8de" ) ;
	addCharacterPiece( name, "sashbelt", "c9be47" ) ;
	addCharacterPiece( name, "boot_sock_right", "b8c7a9" ) ;
	addCharacterPiece( name, "boot_sock_left", "b8c7a9" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "hair_long", "e9e8de" ) ;
	addCharacterPiece( name, "mustache_a", "e9e8de" ) ;
	addCharacterPiece( name, "pant_baggy_right", "82af78" ) ;
	addCharacterPiece( name, "pant_baggy_left", "82af78" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "b8c7a9" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "b8c7a9" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "b8c7a9" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "d6bd32" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "d6bd32" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "d6bd32" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "d6bd32" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "d6bd32" ) ;
end

function runAI_londoneman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_londoneman1( name, chatWith )
	local items = { 
		"ointment", 
		"hat_simple_poor_1", 
		"hat_simple_ok_1", 
		"hat_simple_ok_2", 
		"hat_simple_best_2", 
		"hat_simple_best_1", 
		"hat_plain_poor_1", 
		"hat_plain_ok_2",
		"boot_plain_poor_1", 
		"boot_plain_ok_1", 
		"boot_plain_best_1", 
		"boot_sock_poor_1", 
		"boot_sock_ok_1", 
		"boot_sock_best_1",
		"belt_ok_1", 
		"belt_best_1",
		"sashbelt_ok_1",
		"gloves_ok_1", 
		"cuff_plain_1",
		"collar_plain_1", 
		"collar_big_1",
		"pants_musk_ok_1", 
		"pants_musk_ok_2", 
		"pants_musk_best_1",
		"doublet_poor_1", 
		"doublet_poor_2",
		"shirt_plain_ok_1", 
		"doublet_plain_ok_2", 
		"doublet_best_1", 
		"doublet_best_2" } ;
		
	chat_vendorCustom( name, chatWith, items, getString( "frenchvendor_d1" ), getString( "vendor_d6" ), getString( "vendor_d7" ) ) ;
end

-- londondman1
function init_londondman1( name )
end

function place_londondman1( name )
	placeCharacter( name, "londonhoused2", -100, -131 ) ;
end

function dress_londondman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", "838681" ) ;
	addCharacterPiece( name, "belt", "887435" ) ;
	addCharacterPiece( name, "sashbelt", "b28e22" ) ;
	addCharacterPiece( name, "boot_fancy_right", "b28e22" ) ;
	addCharacterPiece( name, "boot_fancy_left", "b28e22" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "hair_medium", "838681" ) ;
	addCharacterPiece( name, "mustache_b", "838681" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "130b05" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "130b05" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "30231a" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "30231a" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "30231a" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "c9c9c9" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "c9c9c9" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "c9c9c9" ) ;
end

function runAI_londondman1( name )
	setBaseFaceDirection( name, -1, -1 ) ;
end

function chat_londondman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d10" ) ) ;
	sayAndWait( name, getString( "england_d10" ) ) ;
end

-- chat_londondlady1
function init_londondlady1( name )
	setWoman( name, true ) ;
end

function place_londondlady1( name )
	placeCharacter( name, "londonhoused2", -39, 39 ) ;
end

function dress_londondlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_short", "0e0b03" ) ;
	addCharacterPiece( name, "w_stripe_torso", "cdb36d" ) ;
	addCharacterPiece( name, "w_stripe_legs", "cdb36d" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "cdb36d" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "cdb36d" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "a84855" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "a84855" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "a84855" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a84855" ) ;
end

function runAI_londondlady1( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_londondlady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d1" ) ) ;
	sayAndWait( name, getString( "england_d1" ) ) ;
end

-- buckinghamservant1
function init_buckinghamservant1( name )
end

function place_buckinghamservant1( name )
	placeCharacter( name, "buckinghamenglandhouse2", -494, -291 ) ;
end

function dress_buckinghamservant1( name )
	clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "897f64" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d5e5e9" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d5e5e9" ) ;
	addCharacterPiece( name, "boot_sock_right", "d5e5e9" ) ;
	addCharacterPiece( name, "boot_sock_left", "d5e5e9" );
	addCharacterPiece( name, "pant_musketeer_right", "4a6971" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "4a6971" ) ;
	addCharacterPiece( name, "belt", "b9a684" ) ;
	addCharacterPiece( name, "hair_curly", "e7d76b" ) ;
	addCharacterPiece( name, "beard_a", "e7d76b" ) ;
	addCharacterPiece( name, "mustache_b", "e7d76b" ) ;
end

function runAI_buckinghamservant1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_buckinghamservant1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d2" ) ) ;
	sayAndWait( name, getString( "england_d2" ) ) ;
end

-- buckinghamservant2
function init_buckinghamservant2( name )
end

function place_buckinghamservant2( name )
	placeCharacter( name, "buckinghamenglandhouse", 324, -131 ) ;
end

function dress_buckinghamservant2( name )
clearCharacterPieces( name ) ;
	
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "897f64" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d5e5e9" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d5e5e9" ) ;
	addCharacterPiece( name, "boot_sock_right", "d5e5e9" ) ;
	addCharacterPiece( name, "boot_sock_left", "d5e5e9" );
	addCharacterPiece( name, "pant_musketeer_right", "4a6971" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "4a6971" ) ;
	addCharacterPiece( name, "belt", "b9a684" ) ;
	addCharacterPiece( name, "hair_medium", "191603" ) ;
end

function runAI_buckinghamservant2( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_buckinghamservant2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d3" ) ) ;
	sayAndWait( name, getString( "england_d3" ) ) ;
end

-- chat_buckinghamservant3
function init_buckinghamservant3( name )
	setWoman( name, true ) ;
end

function place_buckinghamservant3( name )
	placeCharacter( name, "buckinghamenglandhouse", 258, -308 ) ;
end

function dress_buckinghamservant3( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "d5e5e9" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_pinned", "d9c858" ) ;
	addCharacterPiece( name, "w_stripe_torso", "4a6971" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "897f64" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "897f64" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "897f64" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "4a6971" ) ;
	addCharacterPiece( name, "w_hat_cap", "d5e5e9" ) ;
end


function runAI_buckinghamservant3( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		goalWalkToPoint( name, "buckinghamenglandhouse", 243, -295 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
		setBaseFaceDirection( name, 0, -1 ) ;
		goalWalkToPoint( name, "buckinghamenglandhouse", 246, -333 ) ;
		wait( randomDouble( 1.0, 4.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_buckinghamservant3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d5" ) ) ;
	sayAndWait( name, getString( "england_d5" ) ) ;
end

-- chat_buckinghamservant4
function init_buckinghamservant4( name )
	setWoman( name, true ) ;
end

function place_buckinghamservant4( name )
	placeCharacter( name, "buckinghamenglandhouse", 428, -294 ) ;
end

function dress_buckinghamservant4( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "d5e5e9" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "7e6739" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "4a6971" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "4a6971" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "4a6971" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "897f64" ) ;
	addCharacterPiece( name, "w_hat_cap", "d5e5e9" ) ;
end

function runAI_buckinghamservant4( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_buckinghamservant4( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d7" ) ) ;
	sayAndWait( name, getString( "england_d7" ) ) ;
end

-- chat_buckinghamservant5
function init_buckinghamservant5( name )
	setWoman( name, true ) ;
end

function place_buckinghamservant5( name )
	placeCharacter( name, "buckinghamenglandhouse2", -237, -214 ) ;
end

function dress_buckinghamservant5( name )
clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "d5e5e9" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_curly", "c29236" ) ;
	addCharacterPiece( name, "w_stripe_torso", "897f64" ) ;
	addCharacterPiece( name, "w_stripe_legs", "897f64" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "4a6971" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "4a6971" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "4a6971" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "4a6971" ) ;
end


function runAI_buckinghamservant5( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_buckinghamservant5( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d9" ) ) ;
	sayAndWait( name, getString( "england_d9" ) ) ;
end

-- londonman1
function init_londonman1( name )
end

function place_londonman1( name )
	placeCharacter( name, "england", -4143, -2407 ) ;
end

function dress_londonman1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "1a130a" ) ;
	addCharacterPiece( name, "boot_plain_right", "6a4e17" ) ;
	addCharacterPiece( name, "boot_plain_left", "6a4e17" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "849368" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "849368" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "849368" ) ;
	addCharacterPiece( name, "hat_plain", "6a4e17" ) ;
	addCharacterPiece( name, "hair_long", "1a130a" ) ;
	addCharacterPiece( name, "mustache_a", "1a130a" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "625947" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "625947" ) ;
end

function runAI_londonman1( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "england", -4220, -2415 ) ;
		wait( randomDouble( 3.0, 10.0 ) ) ;
		goalWalkToPoint( name, "england", -4089, -2413 ) ;
		wait( randomDouble( 3.0, 10.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_londonman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d2" ) ) ;
	sayAndWait( name, getString( "england_d2" ) ) ;
end

-- londonman2
function init_londonman2( name )
end

function place_londonman2( name )
	placeCharacter( name, "england", -3581, -3042 ) ;
end

function dress_londonman2( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "927651" ) ;	
	addCharacterPiece( name, "beret", "6f8f45" ) ;
	addCharacterPiece( name, "boot_plain_right", "6a6968" ) ;
	addCharacterPiece( name, "boot_plain_left", "6a6968" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "978b7c" ) ;
	addCharacterPiece( name, "hair_curly", "927651" ) ;
	addCharacterPiece( name, "mustache_a", "927651" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "40382d" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "40382d" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e4ddd3" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e4ddd3" ) ;
end

function runAI_londonman2( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "england", -3747, -3050 ) ;
		wait( randomDouble( 3.0, 10.0 ) ) ;
		setBaseFaceDirection( name, 1, 0 ) ;
		goalWalkToPoint( name, "england", -3406, -3065 ) ;
		wait( randomDouble( 3.0, 10.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_londonman2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d3" ) ) ;
	sayAndWait( name, getString( "england_d3" ) ) ;
end

-- londonman3
function init_londonman3( name )
end

function place_londonman3( name )
	placeCharacter( name, "england", -4657, -3053 ) ;
end

function dress_londonman3( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "d8c372" ) ;
	addCharacterPiece( name, "belt", "787772" ) ;
	addCharacterPiece( name, "sashbelt", "957451" ) ;
	addCharacterPiece( name, "boot_sock_right" ) ;
	addCharacterPiece( name, "boot_sock_left" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "feather_hat_fancy" ) ;
	addCharacterPiece( name, "hat_plain", "957451" ) ;
	addCharacterPiece( name, "hair_short", "d8c372" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "5c4927" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "5c4927" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "57728b" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "57728b" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "57728b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "cad3db" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "cad3db" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "cad3db" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "cad3db" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "cad3db" ) ;
end

function runAI_londonman3( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_londonman3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d4" ) ) ;
	sayAndWait( name, getString( "england_d4" ) ) ;
end

-- londonman4
function init_londonman4( name )
end

function place_londonman4( name )
	placeCharacter( name, "england", -4875, -3408 ) ;
end

function dress_londonman4( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "cf883b" ) ;
	addCharacterPiece( name, "sashbelt", "515151" ) ;
	addCharacterPiece( name, "boot_plain_right", "515151" ) ;
	addCharacterPiece( name, "boot_plain_left", "515151" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "b1999d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "b1999d" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "b1999d" ) ;
	addCharacterPiece( name, "feather_hat_plain", "f6f4e1" ) ;
	addCharacterPiece( name, "glove_plain_right", "7c7c7c" ) ;
	addCharacterPiece( name, "glove_plain_left", "7c7c7c" ) ;
	addCharacterPiece( name, "hat_plain", "515151" ) ;
	addCharacterPiece( name, "hair_medium", "cf883b" ) ;
	addCharacterPiece( name, "mustache_a", "cf883b" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "84525a" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "84525a" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "84525a" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "84525a" ) ;
end

function runAI_londonman4( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		goalWalkToPoint( name, "england", -4861, -3417 ) ;
		wait( randomDouble( 10.0, 20.0 ) ) ;
		setBaseFaceNone( name ) ;
		goalWalkToPoint( name, "england", -5260, -3409 ) ;
		goalWalkToPoint( name, "england", -5280, -3576 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_londonman4( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d5" ) ) ;
	sayAndWait( name, getString( "england_d5" ) ) ;
end

-- londonman5
function init_londonman5( name )
end

function place_londonman5( name )
	placeCharacter( name, "england", -4347, -3694 ) ;
end

function dress_londonman5( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a", "5b3f12" ) ;
	addCharacterPiece( name, "belt", "6a5d49" ) ;
	addCharacterPiece( name, "boot_plain_right", "62513a" ) ;
	addCharacterPiece( name, "boot_plain_left", "62513a" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hat_simple", "b9ad73" ) ;
	addCharacterPiece( name, "hair_long", "5b3f12" ) ;
	addCharacterPiece( name, "pant_baggy_right", "756956" ) ;
	addCharacterPiece( name, "pant_baggy_left", "756956" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "d0ccc5" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d0ccc5" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "d0ccc5" ) ;
end

function runAI_londonman5( name )
	DEBUG_OUTPUT( name .. " AI started" ) ;

	while ( true ) do
		goalWalkToPoint( name, "england", -4439, -3675 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
		goalWalkToPoint( name, "england", -4291, -3675 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
		goalWalkToPoint( name, "england", -4291, -3700 ) ;
		goalWalkToPoint( name, "england", -4439, -3700 ) ;
		wait( randomDouble( 1.0, 3.0 ) ) ;
	
		coroutine.yield( ) ;
	end

	DEBUG_OUTPUT( name .. " AI finished" ) ;
end

function chat_londonman5( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d6" ) ) ;
	sayAndWait( name, getString( "england_d6" ) ) ;
end

-- londonman6
function init_londonman6( name )
end

function place_londonman6( name )
	placeCharacter( name, "england", -4093, -4534 ) ;
end

function dress_londonman6( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_b", "916429" ) ;
	addCharacterPiece( name, "belt", "997a5e" ) ;
	addCharacterPiece( name, "sashbelt", "cabf43" ) ;
	addCharacterPiece( name, "boot_fancy_right", "542e0c" ) ;
	addCharacterPiece( name, "boot_fancy_left", "542e0c" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "feather_hat_fancy" ) ;
	addCharacterPiece( name, "hat_plain", "542e0c" ) ;
	addCharacterPiece( name, "hair_curly", "916429" ) ;
	addCharacterPiece( name, "mustache_a", "916429" ) ;
	addCharacterPiece( name, "pant_baggy_right", "542e0c" ) ;
	addCharacterPiece( name, "pant_baggy_left", "542e0c" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "ca8c56" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "ca8c56" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "ca8c56" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e5dacf" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e5dacf" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "e5dacf" ) ;
end

function runAI_londonman6( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_londonman6( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d7" ) ) ;
	sayAndWait( name, getString( "england_d7" ) ) ;
end

-- londonman7
function init_londonman7( name )
end

function place_londonman7( name )
	placeCharacter( name, "england", -3710, -4797 ) ;
end

function dress_londonman7( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "a5a293" ) ;
	addCharacterPiece( name, "belt", "8a673e" ) ;
	addCharacterPiece( name, "beret", "6a655b" ) ;
	addCharacterPiece( name, "boot_plain_right", "504632" ) ;
	addCharacterPiece( name, "boot_plain_left", "504632" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "b4965c" ) ;
	addCharacterPiece( name, "feather_hat_small", "b86942" ) ;
	addCharacterPiece( name, "glove_plain_right", "716856" ) ;
	addCharacterPiece( name, "glove_plain_left", "716856" ) ;
	addCharacterPiece( name, "hair_medium", "a5a293" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "6a655b" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "6a655b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "e2dbce" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "e2dbce" ) ;
end

function runAI_londonman7( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_londonman7( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d8" ) ) ;
	sayAndWait( name, getString( "england_d8" ) ) ;
end

-- londonman8
function init_londonman8( name )
end

function place_londonman8( name )
	placeCharacter( name, "england", -3473, -5721 ) ;
end

function dress_londonman8( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beardmus", "c5a74c" ) ;
	addCharacterPiece( name, "belt", "808080" ) ;
	addCharacterPiece( name, "boot_fancy_right", "6e5a34" ) ;
	addCharacterPiece( name, "boot_fancy_left", "6e5a34" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "c4b1a0" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "c4b1a0" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "c4b1a0" ) ;
	addCharacterPiece( name, "hat_simple", "6e5a34" ) ;
	addCharacterPiece( name, "hair_long", "c5a74c" ) ;
	addCharacterPiece( name, "pant_baggy_right", "7e4d21" ) ;
	addCharacterPiece( name, "pant_baggy_left", "7e4d21" ) ;	
end

function runAI_londonman8( name )
	setBaseFaceDirection( name, 1, 1 ) ;
end

function chat_londonman8( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d9" ) ) ;
	sayAndWait( name, getString( "england_d9" ) ) ;
end

-- londonman9
function init_londonman9( name )
end

function place_londonman9( name )
	placeCharacter( name, "england", -3300, -5497 ) ;
end

function dress_londonman9( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_c", "1e1405" ) ;
	addCharacterPiece( name, "belt", "5d3e12" ) ;
	addCharacterPiece( name, "boot_plain_right", "483a26" ) ;
	addCharacterPiece( name, "boot_plain_left", "483a26" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "glove_plain_right", "7d6645" ) ;
	addCharacterPiece( name, "glove_plain_left", "7d6645" ) ;
	addCharacterPiece( name, "hat_plain", "7d6645" ) ;
	addCharacterPiece( name, "hair_short", "1e1405" ) ;
	addCharacterPiece( name, "mustache_a", "1e1405" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "678243" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "678243" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d0cab6" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d0cab6" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "d0cab6" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "7d6645" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "7d6645" ) ;
end

function runAI_londonman9( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_londonman9( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d10" ) ) ;
	sayAndWait( name, getString( "england_d10" ) ) ;
end

-- londonman10
function init_londonman10( name )
end

function place_londonman10( name )
	placeCharacter( name, "england", -3679, -5537 ) ;
end

function dress_londonman10( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "6a5327" ) ;
	addCharacterPiece( name, "sashbelt", "574422" ) ;
	addCharacterPiece( name, "boot_sock_right", "d5c7c7" ) ;
	addCharacterPiece( name, "boot_sock_left", "d5c7c7" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "6a5353" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "dc0b0b" ) ;
	addCharacterPiece( name, "hat_plain", "574422" ) ;
	addCharacterPiece( name, "hair_curly", "6a5327" ) ;
	addCharacterPiece( name, "pant_baggy_right", "852828" ) ;
	addCharacterPiece( name, "pant_baggy_left", "852828" ) ;	
	addCharacterPiece( name, "shirt_plain_arm_right", "d7cccc" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d7cccc" ) ;	
end


function runAI_londonman10( name )
	setBaseFaceDirection( name, -1, 1 ) ;
end

function chat_londonman10( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d1" ) ) ;
	sayAndWait( name, getString( "england_d1" ) ) ;
end

-- londonman11
function init_londonman11( name )
end

function place_londonman11( name )
	placeCharacter( name, "england", -4395, -5783 ) ;
end

function dress_londonman11( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_c", "624116" ) ;	
	addCharacterPiece( name, "belt", "67563f" ) ;
	addCharacterPiece( name, "beret", "796553" ) ;
	addCharacterPiece( name, "boot_sock_right", "e2dbd1" ) ;
	addCharacterPiece( name, "boot_sock_left", "e2dbd1" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "406db8" ) ;
	addCharacterPiece( name, "feather_hat_small", "dcc924" ) ;
	addCharacterPiece( name, "hair_short", "624116" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "776f66" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "776f66" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "406db8" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "406db8" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "cfd8e5" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "cfd8e5" ) ;
end


function runAI_londonman11( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_londonman11( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d2" ) ) ;
	sayAndWait( name, getString( "england_d2" ) ) ;
end

-- londonman12
function init_londonman12( name )
end

function place_londonman12( name )
	placeCharacter( name, "england", -4959, -5733 ) ;
end

function dress_londonman12( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", "7a542c" ) ;
	addCharacterPiece( name, "sashbelt", "544535" ) ;
	addCharacterPiece( name, "boot_plain_right", "7a634a" ) ;
	addCharacterPiece( name, "boot_plain_left", "7a634a" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "ae9b86" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "ae9b86" ) ;
	addCharacterPiece( name, "glove_plain_right", "634729" ) ;
	addCharacterPiece( name, "glove_plain_left", "634729" ) ;
	addCharacterPiece( name, "hat_simple", "55504a" ) ;
	addCharacterPiece( name, "hair_medium", "7a542c" ) ;
	addCharacterPiece( name, "mustache_b", "7a542c" ) ;
	addCharacterPiece( name, "pant_baggy_right", "636255" ) ;
	addCharacterPiece( name, "pant_baggy_left", "636255" ) ;	
	addCharacterPiece( name, "shirt_plain_torso", "ae9b86" ) ;
end


function runAI_londonman12( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_londonman12( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d3" ) ) ;
	sayAndWait( name, getString( "england_d3" ) ) ;
end

-- londonman13
function init_londonman13( name )
end

function place_londonman13( name )
	placeCharacter( name, "england", -5543, -5696 ) ;
end

function dress_londonman13( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "1a1005" ) ;
	addCharacterPiece( name, "belt", "ab8959" ) ;
	addCharacterPiece( name, "boot_sock_right", "e9e2c2" ) ;
	addCharacterPiece( name, "boot_sock_left", "e9e2c2" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "feather_hat_plain", "e2cb61" ) ;
	addCharacterPiece( name, "hat_plain", "b29b2d" ) ;
	addCharacterPiece( name, "hair_long", "1a1005" ) ;
	addCharacterPiece( name, "mustache_a", "1a1005" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "b29b2d" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "b29b2d" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "e2cb61" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "e2cb61" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "e2cb61" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "b29b2d" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "b29b2d" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "b29b2d" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "e2cb61" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "e2cb61" ) ;
end

function runAI_londonman13( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_londonman13( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d4" ) ) ;
	sayAndWait( name, getString( "england_d4" ) ) ;
end

-- londonman14
function init_londonman14( name )
end

function place_londonman14( name )
	placeCharacter( name, "england", -6813, -5521 ) ;
end

function dress_londonman14( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_a", "ddc95d" ) ;
	addCharacterPiece( name, "belt", "483519" ) ;
	addCharacterPiece( name, "sashbelt", "755c38" ) ;
	addCharacterPiece( name, "boot_plain_right", "826c13" ) ;
	addCharacterPiece( name, "boot_plain_left", "826c13" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "4d7e80" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "4d7e80" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "4d7e80" ) ;
	addCharacterPiece( name, "mustache_a", "ddc95d" ) ;
	addCharacterPiece( name, "pant_baggy_right", "636150" ) ;
	addCharacterPiece( name, "pant_baggy_left", "636150" ) ;	
end

function runAI_londonman14( name )
	setBaseFaceDirection( name, 1, 1 ) ;
end

function chat_londonman14( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d5" ) ) ;
	sayAndWait( name, getString( "england_d5" ) ) ;
end

-- londonman15
function init_londonman15( name )
end

function place_londonman15( name )
	placeCharacter( name, "england", -6485, -4878 ) ;
end

function dress_londonman15( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "625d58" ) ;
	addCharacterPiece( name, "sashbelt", "6e5234" ) ;
	addCharacterPiece( name, "boot_fancy_right", "6e5234" ) ;
	addCharacterPiece( name, "boot_fancy_left", "6e5234" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "c9b723" ) ;
	addCharacterPiece( name, "hat_plain", "6e5234" ) ;
	addCharacterPiece( name, "hair_medium", "625d58" ) ;
	addCharacterPiece( name, "mustache_b", "625d58" ) ;
	addCharacterPiece( name, "pant_baggy_right", "671c6e" ) ;
	addCharacterPiece( name, "pant_baggy_left", "671c6e" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_right", "c9b723" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "c9b723" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "c9b723" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "671c6e" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "671c6e" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "671c6e" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "c9b723" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "c9b723" ) ;
end

function runAI_londonman15( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_londonman15( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d6" ) ) ;
	sayAndWait( name, getString( "england_d6" ) ) ;
end

-- londonman16
function init_londonman16( name )
end

function place_londonman16( name )
	placeCharacter( name, "england", -6445, -4878 ) ;
end

function dress_londonman16( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "725d36" ) ;
	addCharacterPiece( name, "belt", "818181" ) ;
	addCharacterPiece( name, "boot_sock_right", "d7d9ea" ) ;
	addCharacterPiece( name, "boot_sock_left", "d7d9ea" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "b9bff8" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "b9bff8" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "b9bff8" ) ;
	addCharacterPiece( name, "feather_hat_plain", "444c95" ) ;
	addCharacterPiece( name, "glove_plain_right", "818181" ) ;
	addCharacterPiece( name, "glove_plain_left", "818181" ) ;
	addCharacterPiece( name, "hat_plain", "818181" ) ;
	addCharacterPiece( name, "hair_short", "725d36" ) ;
	addCharacterPiece( name, "mustache_a", "725d36" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "8b91c5" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "8b91c5" ) ;
end

function runAI_londonman16( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_londonman16( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d7" ) ) ;
	sayAndWait( name, getString( "england_d7" ) ) ;
end

-- londonman17
function init_londonman17( name )
end

function place_londonman17( name )
	placeCharacter( name, "england", -4637, -5253 ) ;
end

function dress_londonman17( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a", "bf871b" ) ;
	addCharacterPiece( name, "belt", "5b4c2e" ) ;
	addCharacterPiece( name, "boot_plain_right", "88795b" ) ;
	addCharacterPiece( name, "boot_plain_left", "88795b" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "feather_hat_small", "677fb0" ) ;
	addCharacterPiece( name, "hat_simple", "b3a17e" ) ;
	addCharacterPiece( name, "hair_short", "bf871b" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "817a68" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "817a68" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "c5bfaf" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "c5bfaf" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "c5bfaf" ) ;
end

function runAI_londonman17( name )
	setBaseFaceDirection( name, 1, 1 ) ;
end

function chat_londonman17( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d8" ) ) ;
	sayAndWait( name, getString( "england_d8" ) ) ;
end

-- londonman18
function init_londonman18( name )
end

function place_londonman18( name )
	placeCharacter( name, "england", -4612, -5228 ) ;
end

function dress_londonman18( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_c", "a58843" ) ;	
	addCharacterPiece( name, "belt", "47433d" ) ;
	addCharacterPiece( name, "sashbelt", "611920" ) ;
	addCharacterPiece( name, "boot_fancy_right", "47433d" ) ;
	addCharacterPiece( name, "boot_fancy_left", "47433d" ) ;
	addCharacterPiece( name, "collar_fancy" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "611920" ) ;
	addCharacterPiece( name, "glove_plain_right", "47433d" ) ;
	addCharacterPiece( name, "glove_plain_left", "47433d" ) ;
	addCharacterPiece( name, "hat_plain", "47433d" ) ;
	addCharacterPiece( name, "hair_curly", "a58843" ) ;
	addCharacterPiece( name, "mustache_a", "a58843" ) ;
	addCharacterPiece( name, "pant_baggy_right", "862020" ) ;
	addCharacterPiece( name, "pant_baggy_left", "862020" ) ;	
	addCharacterPiece( name, "shirt_fancy_arm_right", "9f9393" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "9f9393" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "9f9393" ) ;
	addCharacterPiece( name, "stripe_plain_torso", "862020" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "862020" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "862020" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "9f9393" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "9f9393" ) ;
end

function runAI_londonman18( name )
	setBaseFaceDirection( name, -1, -1 ) ;
end

function chat_londonman18( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d9" ) ) ;
	sayAndWait( name, getString( "england_d9" ) ) ;
end

-- londonlady1
function init_londonlady1( name )
	setWoman( name, true ) ;
end

function place_londonlady1( name )
	placeCharacter( name, "england", -3868, -2797 ) ;
end

function dress_londonlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "d9c464" ) ;
	addCharacterPiece( name, "w_stripe_torso", "6c4f25" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "9c7d1d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "9c7d1d" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "9c7d1d" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6c4f25" ) ;
	addCharacterPiece( name, "w_hat_plain", "a68e6b" ) ;

end

function runAI_londonlady1( name )
	setBaseFaceDirection( name, -1, 1 ) ;
end

function chat_londonlady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d10" ) ) ;
	sayAndWait( name, getString( "england_d10" ) ) ;
end

-- londonlady2
function init_londonlady2( name )
	setWoman( name, true ) ;
end

function place_londonlady2( name )
	placeCharacter( name, "england", -5280, -2970 ) ;
end

function dress_londonlady2( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "ebe4da" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "806c4b" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "b9863d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "b9863d" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "b9863d" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6f5b46" ) ;
	addCharacterPiece( name, "w_hat_cap", "ebe4da" ) ;
end

function runAI_londonlady2( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_londonlady2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d1" ) ) ;
	sayAndWait( name, getString( "england_d1" ) ) ;
end

-- londonlady3
function init_londonlady3( name )
	setWoman( name, true ) ;
end

function place_londonlady3( name )
	placeCharacter( name, "england", -4908, -4304 ) ;
end

function dress_londonlady3( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "59462d" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "859365" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "859365" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "859365" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a9a5a2" ) ;
	addCharacterPiece( name, "w_hat_plain", "958248" ) ;
end

function runAI_londonlady3( name )
	setBaseFaceDirection( name, 0, -1 ) ;
end

function chat_londonlady3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d2" ) ) ;
	sayAndWait( name, getString( "england_d2" ) ) ;
end

-- londonlady4
function init_londonlady4( name )
	setWoman( name, true ) ;
end

function place_londonlady4( name )
	placeCharacter( name, "england", -4250, -4083 ) ;
end

function dress_londonlady4( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "e3d5ce" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "ccbd77" ) ;
	addCharacterPiece( name, "w_stripe_torso", "814426" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "a8876a" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "a8876a" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "a8876a" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "814426" ) ;
	addCharacterPiece( name, "w_hat_cap", "e3d5ce" ) ;
end

function runAI_londonlady4( name )
	setBaseFaceDirection( name, 1, 1 ) ;
end

function chat_londonlady4( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d3" ) ) ;
	sayAndWait( name, getString( "england_d3" ) ) ;
end

-- londonlady5
function init_londonlady5( name )
	setWoman( name, true ) ;
end

function place_londonlady5( name )
	placeCharacter( name, "england", -4092, -4569 ) ;
end

function dress_londonlady5( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "e0d3b7" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "e0d3b7" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "e0d3b7" ) ;
	addCharacterPiece( name, "w_hair_curly", "e7cf5f" ) ;
	addCharacterPiece( name, "w_stripe_torso", "d2b475" ) ;
	addCharacterPiece( name, "w_stripe_legs", "d2b475" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "7591d2" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "7591d2" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "7591d2" ) ;
	addCharacterPiece( name, "w_hat_plain", "d2b475" ) ;
end


function runAI_londonlady5( name )
	setBaseFaceDirection( name, -1, 0 ) ;
end

function chat_londonlady5( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d4" ) ) ;
	sayAndWait( name, getString( "england_d4" ) ) ;
end

-- londonlady6
function init_londonlady6( name )
	setWoman( name, true ) ;
end

function place_londonlady6( name )
	placeCharacter( name, "england", -3313, -5895 ) ;
end

function dress_londonlady6( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "dcd4dd" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_curly", "ca9626" ) ;
	addCharacterPiece( name, "w_stripe_torso", "a58843" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "d2abd4" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "d2abd4" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "d2abd4" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "a58843" ) ;
end

function runAI_londonlady6( name )
	setBaseFaceDirection( name, -1, 1 ) ;
end

function chat_londonlady6( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d5" ) ) ;
	sayAndWait( name, getString( "england_d5" ) ) ;
end

-- londonlady7
function init_londonlady7( name )
	setWoman( name, true ) ;
end

function place_londonlady7( name )
	placeCharacter( name, "england", -3790, -5927 ) ;
end

function dress_londonlady7( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "453615" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "987d44" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "987d44" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "987d44" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "666562" ) ;
	addCharacterPiece( name, "w_hat_cap" ) ;
end


function runAI_londonlady7( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_londonlady7( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d6" ) ) ;
	sayAndWait( name, getString( "england_d6" ) ) ;
end

-- londonlady8
function init_londonlady8( name )
	setWoman( name, true ) ;
end

function place_londonlady8( name )
	placeCharacter( name, "england", -4994, -5733 ) ;
end

function dress_londonlady8( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_pinned" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "4b80a8" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "4b80a8" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "4b80a8" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "453615" ) ;
	addCharacterPiece( name, "w_hat_plain", "82775f" ) ;
end

function runAI_londonlady8( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_londonlady8( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d7" ) ) ;
	sayAndWait( name, getString( "england_d7" ) ) ;
end

-- londonlady9
function init_londonlady9( name )
	setWoman( name, true ) ;
end

function place_londonlady9( name )
	placeCharacter( name, "england", -6175, -5533 ) ;
end

function dress_londonlady9( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "6f592b" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "6f592b" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "6f592b" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "6f592b" ) ;
	addCharacterPiece( name, "w_hat_holy", "6f592b" ) ;
end

function runAI_londonlady9( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_londonlady9( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d8" ) ) ;
	sayAndWait( name, getString( "england_d8" ) ) ;
end

-- londonlady10
function init_londonlady10( name )
	setWoman( name, true ) ;
end

function place_londonlady10( name )
	placeCharacter( name, "england", -5426, -4805 ) ;
end

function dress_londonlady10( name )
clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "bdaa82" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "bdaa82" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "bdaa82" ) ;
	addCharacterPiece( name, "w_hair_plain", "9b741f" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "98bb5b" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "98bb5b" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "98bb5b" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "98bb5b" ) ;
	addCharacterPiece( name, "w_hat_plain", "bdaa82" ) ;
end

function runAI_londonlady10( name )
	setBaseFaceDirection( name, 1, 1 ) ;
end

function chat_londonlady10( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d9" ) ) ;
	sayAndWait( name, getString( "england_d9" ) ) ;
end

-- londonlady11
function init_londonlady11( name )
	setWoman( name, true ) ;
end

function place_londonlady11( name )
	placeCharacter( name, "england", -3766, -5216 ) ;
end

function dress_londonlady11( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "dfd7cc" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hair_pinned", "d2cc8a" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "98aa83" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "98aa83" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "98aa83" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "bb985b" ) ;
	addCharacterPiece( name, "w_hat_cap", "dfd7cc" ) ;
end

function runAI_londonlady11( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_londonlady11( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d10" ) ) ;
	sayAndWait( name, getString( "england_d10" ) ) ;
end

-- londonlady12
function init_londonlady12( name )
	setWoman( name, true ) ;
end

function place_londonlady12( name )
	placeCharacter( name, "england", -5016, -5310 ) ;
end

function dress_londonlady12( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_short", "ddc649" ) ;
	addCharacterPiece( name, "w_stripe_torso", "385aa9" ) ;
	addCharacterPiece( name, "w_stripe_legs", "385aa9" ) ;
	addCharacterPiece( name, "w_stripe_arm_left", "385aa9" ) ;
	addCharacterPiece( name, "w_stripe_arm_right", "385aa9" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "d890a6" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "d890a6" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "d890a6" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "d890a6" ) ;
	addCharacterPiece( name, "w_hat_plain", "385aa9" ) ;
end

function runAI_londonlady12( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_londonlady12( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d1" ) ) ;
	sayAndWait( name, getString( "england_d1" ) ) ;
end

-- londonguard1
function init_londonguard1( name )
end

function place_londonguard1( name )
	placeCharacter( name, "england", -3144, -4735 ) ;
end

function dress_londonguard1( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "694916" ) ;
	addCharacterPiece( name, "belt", "6a4c25" ) ;
	addCharacterPiece( name, "sashbelt", "c74113" ) ;
	addCharacterPiece( name, "boot_plain_right", "6a4c25" ) ;
	addCharacterPiece( name, "boot_plain_left", "6a4c25" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "979797" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "c74113" ) ;
	addCharacterPiece( name, "glove_plain_right", "6a4c25" ) ;
	addCharacterPiece( name, "glove_plain_left", "6a4c25" ) ;
	addCharacterPiece( name, "hat_plain", "4e3e25" ) ;
	addCharacterPiece( name, "hair_short", "694916" ) ;
	addCharacterPiece( name, "mustache_b", "694916" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "514839" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "514839" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "dad3c8" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "dad3c8" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "b06354" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "b06354" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "b06354" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "b06354" ) ;
end

function londonGuardUnlockDartOnNoGoals( )
	waitForNoGoal( "dartagnan" ) ;
	unlockPlayerInPlace( ) ;
	gLondonGuardDartLeft = true ;
end

function runAI_londonguard1( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;

	while ( true ) do
		local distToTower = distanceToPoint( "dartagnan", "england", -3023, -4699 ) ;
		local playerCloseToTower = distToTower < 200 ;
		
		if ( gLondonGuardDartLeft and playerCloseToTower ) then
			gLondonGuardDartLeft = false ;
			lockPlayerInPlace( ) ;
			
			setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
			
			addGoalGetToPointInLevel( "dartagnan", -3241, -4795, "england", false, true ) ;
			
			--autoDeleteFaceChat( name, "dartagnan", getString( "londonguard_d1" ) ) ;
			autoDeleteTimeFaceChat( name, "dartagnan", getString( "londonguard_d1" ) ) ;
			
			waitForNoGoal( "dartagnan" ) ;
			
			
			activateScriptMessage( "londonGuardUnlockDartOnNoGoals" ) ;
		end
		
		coroutine.yield( ) ;
	end
end

function chat_londonguard1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "londonguard_d1" ) ) ;
	sayAndWait( name, getString( "londonguard_d1" ) ) ;
end

-- londonguard2
function init_londonguard2( name )
end

function place_londonguard2( name )
	placeCharacter( name, "england", -3144, -4644 ) ;
end

function dress_londonguard2( name )
clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "belt", "5d4b2a" ) ;
	addCharacterPiece( name, "boot_plain_right", "5d4b2a" ) ;
	addCharacterPiece( name, "boot_plain_left", "5d4b2a" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "979797" ) ;
	addCharacterPiece( name, "feather_hat_fancy", "c74113" ) ;
	addCharacterPiece( name, "glove_plain_right", "5d4b2a" ) ;
	addCharacterPiece( name, "glove_plain_left", "5d4b2a" ) ;
	addCharacterPiece( name, "hat_plain", "5d4b2a" ) ;
	addCharacterPiece( name, "hair_long", "ac7b1c" ) ;
	addCharacterPiece( name, "mustache_a", "ac7b1c" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "6f634c" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "6f634c" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "dad3c8" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "dad3c8" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "b06354" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "b06354" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "b06354" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "b06354" ) ;
end

function runAI_londonguard2( name )
	setBaseFaceCharacter( name, "dartagnan" ) ;
end

function chat_londonguard2( name, chatWith )
--	autoDeleteFaceChat( name, chatWith, getString( "londonguard_d1" ) ) ;
	sayAndWait( name, getString( "londonguard_d1" ) ) ;
end

-- windsorman1
function init_windsorman1( name )
end

function place_windsorman1( name )
	placeCharacter( name, "england", -10021, -4698 ) ;
end

function dress_windsorman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beardmus", "827c71" ) ;
	addCharacterPiece( name, "belt", "4c3d1f" ) ;
	addCharacterPiece( name, "boot_plain_right", "4c3d1f" ) ;
	addCharacterPiece( name, "boot_plain_left", "4c3d1f" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hat_simple", "ac9e79" ) ;
	addCharacterPiece( name, "hair_long", "827c71" ) ;
	addCharacterPiece( name, "mustache_b", "827c71" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "886811" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "886811" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "d7ceb5" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "d7ceb5" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "d7ceb5" ) ;
end

function runAI_windsorman1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_windsorman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d2" ) ) ;
	sayAndWait( name, getString( "england_d2" ) ) ;
end

-- windsorlady1
function init_windsorlady1( name )
	setWoman( name, true ) ;
end

function place_windsorlady1( name )
	placeCharacter( name, "england", -9585, -4296 ) ;
end

function dress_windsorlady1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_apron", "e5dfd0" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "cf7f21" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "89816a" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "89816a" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "89816a" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "88784d" ) ;
	addCharacterPiece( name, "w_hat_cap", "dcd5c1" ) ;
end

function runAI_windsorlady1( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_windsorlady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "england_d3" ) ) ;
	sayAndWait( name, getString( "england_d3" ) ) ;
end

-- bethuneabbess
function init_bethuneabbess( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_bethuneabbess( name )
	placeCharacter( name, "bethuneconventhouse", -975, 208 ) ;
end

function dress_bethuneabbess( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_hat_holy", "27190d" ) ;
	addCharacterPiece( name, "w_stripe_torso", "b33a3a" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e7e2d1" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "e7e2d1" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "e7e2d1" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "e7e2d1"  ) ;
end

function runAI_bethuneabbess( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_bethuneabbess( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- bethunenun1
function init_bethunenun1( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_bethunenun1( name )
	placeCharacter( name, "bethuneconventhouse", -264, -246 ) ;
end

function dress_bethunenun1( name )
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_hat_holy", "e7e2d1" ) ;
	addCharacterPiece( name, "w_apron", "e7e2d1" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "e7e2d1" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "e7e2d1" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "e7e2d1" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "e7e2d1"  ) ;
end

function runAI_bethunenun1( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_bethunenun1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- bethunenun2
function init_bethunenun2( name )
	setWoman( name, true ) ;
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_bethunenun2( name )
	placeCharacter( name, "bethuneconventhouse", -849, 149 ) ;
end

function dress_bethunenun2( name )
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_hat_holy", "4d3e18" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "4d3e18" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "4d3e18" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "4d3e18" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "4d3e18"  ) ;
end

function runAI_bethunenun2( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_bethunenun2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "hello" ) ) ;
	sayAndWait( name, getString( "hello" ) ) ;
end

-- bethuneman1
function init_bethuneman1( name )
end

function place_bethuneman1( name )
	placeCharacter( name, "france", 8880, -19883 ) ;
end

function dress_bethuneman1( name )
	clearCharacterPieces( name ) ;

	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "beard_a", "705f36" ) ;
	addCharacterPiece( name, "sashbelt", "a27841" ) ;
	addCharacterPiece( name, "boot_fancy_right", "634826" ) ;
	addCharacterPiece( name, "boot_fancy_left", "634826" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "d4c353" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "d4c353" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "d4c353" ) ;
	addCharacterPiece( name, "feather_hat_plain", "709856" ) ;
	addCharacterPiece( name, "hat_plain", "634826" ) ;
	addCharacterPiece( name, "hair_medium", "705f36" ) ;
	addCharacterPiece( name, "mustache_b", "705f36" ) ;
	addCharacterPiece( name, "pant_baggy_right", "709856" ) ;
	addCharacterPiece( name, "pant_baggy_left", "709856" ) ;	
	addCharacterPiece( name, "stripe_plain_leg_right", "d4c353" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "d4c353" ) ;
end

function runAI_bethuneman1( name )
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_bethuneman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "bethuneman1_d1" ) ) ;
	sayAndWait( name, getString( "bethuneman1_d1" ) ) ;
end

-- bethuneman2
function init_bethuneman2( name )
end

function place_bethuneman2( name )
	placeCharacter( name, "france", 8869, -19492 ) ;
end

function dress_bethuneman2( name )
	clearCharacterPieces( name ) ;

clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	
	addCharacterPiece( name, "beard_b", "b78940" ) ;
	addCharacterPiece( name, "belt", "404b59" ) ;
	addCharacterPiece( name, "boot_plain_right", "4f4f4f" ) ;
	addCharacterPiece( name, "boot_plain_left", "4f4f4f" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "9a7f55" ) ;
	addCharacterPiece( name, "feather_hat_small", "b0b55c" ) ;
	addCharacterPiece( name, "glove_plain_right", "989289" ) ;
	addCharacterPiece( name, "glove_plain_left", "989289" ) ;
	addCharacterPiece( name, "hat_plain", "404b59" ) ;
	addCharacterPiece( name, "hair_long", "b78940" ) ;
	addCharacterPiece( name, "mustache_a", "b78940" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "404b59" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "404b59" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "9a7f55" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "9a7f55" ) ;
end

function runAI_bethuneman2( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_bethuneman2( name, chatWith )
	genericGreeting( name, chatWith, 0.81 ) ;
end

-- bethuneman3
function init_bethuneman3( name )
end

function place_bethuneman3( name )
	placeCharacter( name, "france", 9356, -20673 ) ;
end

function dress_bethuneman3( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;

	addCharacterPiece( name, "beardmus", "917b3f" ) ;
	addCharacterPiece( name, "belt", "3c300f" ) ;
	addCharacterPiece( name, "beret", "8a321a" ) ;
	addCharacterPiece( name, "boot_plain_right", "3c300f" ) ;
	addCharacterPiece( name, "boot_plain_left", "3c300f" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "hair_short", "917b3f" ) ;
	addCharacterPiece( name, "mustache_b", "917b3f" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "7a7a7a" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "7a7a7a" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "b8ad8e" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "b8ad8e" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "b8ad8e" ) ;
	end

function runAI_bethuneman3( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_bethuneman3( name, chatWith )
	genericGreeting( name, chatWith, 0.97 ) ;
end

-- bethunelady1
function init_bethunelady1( name )
	setWoman( name, true ) ;
end

function place_bethunelady1( name )
	placeCharacter( name, "france", 8920, -19883 ) ;
end

function dress_bethunelady1( name )
	clearCharacterPieces( name ) ;
	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_big" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_bow_torso", "bcbcbc" ) ;
	addCharacterPiece( name, "w_bow_arm_right", "bcbcbc" ) ;
	addCharacterPiece( name, "w_bow_arm_left", "bcbcbc" ) ;
	addCharacterPiece( name, "w_hair_plain", "d1ca81" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "59629a" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "59629a" ) ;
	addCharacterPiece( name, "w_dress_plain_torso", "59629a" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "59629a" ) ;
end

function runAI_bethunelady1( name )
	while ( true ) do
		setBaseFaceDirection( name, -1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_bethunelady1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "bethunelady1_d1" ) ) ;
	sayAndWait( name, getString( "bethunelady1_d1" ) ) ;
end

-- bethunelady2
function init_bethunelady2( name )
	setWoman( name, true ) ;
end

function place_bethunelady2( name )
	placeCharacter( name, "france", 9994, -19628 ) ;
end

function dress_bethunelady2( name )
	clearCharacterPieces( name ) ;

	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;

	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_hair_pinned", "40392f" ) ;
	addCharacterPiece( name, "w_stripe_torso", "8e7756" ) ;
	addCharacterPiece( name, "w_stripe_legs", "8e7756" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "b7781f" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "b7781f" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "b7781f" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "b7781f" ) ;
	addCharacterPiece( name, "w_hat_plain", "8e7756" ) ;

end

function runAI_bethunelady2( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_bethunelady2( name, chatWith )
	genericGreeting( name, chatWith, 0.63 ) ;
end

-- bethunelady3
function init_bethunelady3( name )
	setWoman( name, true ) ;
end

function place_bethunelady3( name )
	placeCharacter( name, "france", 8207, -20232 ) ;
end

function dress_bethunelady3( name )

	clearCharacterPieces( name ) ;
	addCharacterPiece( name, "w_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_collar_fancy" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_right" ) ;
	addCharacterPiece( name, "w_cuff_fancy_arm_left" ) ;
	addCharacterPiece( name, "w_hair_curly", "776037" ) ;
	addCharacterPiece( name, "w_stripe_torso" ) ;
	addCharacterPiece( name, "w_stripe_legs" ) ;
	addCharacterPiece( name, "w_stripe_arm_left" ) ;
	addCharacterPiece( name, "w_stripe_arm_right" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_left", "171563" ) ;
	addCharacterPiece( name, "w_dress_fancy_arm_right", "171563" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "171563" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "171563" ) ;
end

function runAI_bethunelady3( name )
	while ( true ) do
		goalWalkToPoint( name, "france", 8165, -20453 ) ;
		wait( 1 ) ;
		goalWalkToPoint( name, "france", 7959, -20317 ) ;
		wait( 1 ) ;
		goalWalkToPoint( name, "france", 8233, -19859 ) ;
		wait( 1 ) ;
		
		coroutine.yield( ) ;
	end
end

function chat_bethunelady3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "bethunelady3_d1" ) ) ;
	sayAndWait( name, getString( "bethunelady3_d1" ) ) ;
end

-- armentieresman1
function init_armentieresman1( name )
end

function place_armentieresman1( name )
	placeCharacter( name, "france", 13286, -21329 ) ;
end

function dress_armentieresman1( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "belt", "686868" ) ;
	addCharacterPiece( name, "boot_plain_right", "686868" ) ;
	addCharacterPiece( name, "boot_plain_left", "686868" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "786880" ) ;
	addCharacterPiece( name, "glove_plain_right", "6c563a" ) ;
	addCharacterPiece( name, "glove_plain_left", "6c563a" ) ;
	addCharacterPiece( name, "hat_plain", "6c563a" ) ;
	addCharacterPiece( name, "hair_long", "c4b55f" ) ;
	addCharacterPiece( name, "mustache_b", "c4b55f" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "9f7f6c" ) ;
	addCharacterPiece( name, "pant_musketeer_left","9f7f6c" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "786880" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "786880" ) ;
end

function runAI_armentieresman1( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_armentieresman1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "armentieresman1_d1" ) ) ;
	sayAndWait( name, getString( "armentieresman1_d1" ) ) ;
end

-- posthousekeeper
function init_posthousekeeper( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_posthousekeeper( name )
	placeCharacter( name, "posthouse", 93, 157 ) ;
end

function dress_posthousekeeper( name )
	-- normal dress
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "hat_simple", "81634a" ) ;
	addCharacterPiece( name, "belt", "81634a" ) ;
	addCharacterPiece( name, "collar_big" ) ;
	addCharacterPiece( name, "glove_plain_right", "81634a" ) ;
	addCharacterPiece( name, "glove_plain_left", "81634a" ) ;
	addCharacterPiece( name, "boot_sock_right" ) ;
	addCharacterPiece( name, "boot_sock_left" );
	addCharacterPiece( name, "hair_curly", "d8c967" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "787144" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "787144" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "677743" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "677743" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "677743" ) ;
end

function runAI_posthousekeeper( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_posthousekeeper( name, chatWith )
	local items = { 
		"ointment",
		"beret_1" } ;
	
	chat_vendor( name, chatWith, items ) ;
end

-- executioner
function init_executioner( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_executioner( name )
	placeDead( name ) ;
end

function dress_executioner( name )
	-- normal dress
	clearCharacterPieces( name ) ;
	local skinR = 1.0 ;
	local skinG = 1.0 ;
	local skinB = 1.0 ;
	
	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "ex" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "glove_plain_right", "835f3f" ) ;
	addCharacterPiece( name, "glove_plain_left", "835f3f" ) ;
	addCharacterPiece( name, "boot_plain_right", "735338" ) ;
	addCharacterPiece( name, "boot_plain_left", "735338" );
	addCharacterPiece( name, "belt", "7f5c3e" ) ;
	addCharacterPiece( name, "doublet_plain_torso", "8b8178" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "8b8178" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "8b8178" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "493f36" ) ;
	addCharacterPiece( name, "pant_musketeer_left", "493f36" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "987556" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "987556" ) ;
	addCharacterPiece( name, "cloak_mini", "c02d1a" ) ;
end

function setownedhorse_executioner( name )
	setOwnedHorse( name, "executionerhorse1" ) ;
end

function runAI_executioner( name )
	while ( true ) do
		setBaseFaceDirection( name, 0, 1 ) ;
		wait( 1 ) ;
	end
end

function chat_executioner( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "executioner_d1" ) ) ;
	sayAndWait( name, getString( "executioner_d1" ) ) ;
end

-- londonhousefman
function init_londonhousefman( name )
end

function place_londonhousefman( name )
	placeCharacter( name, "londonhousef", 64, -96 ) ;
end

function dress_londonhousefman( name )
	clearCharacterPieces( name ) ;
	local darkness = 1 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;

	addCharacterPiece( name, "nm_head", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_arm_left" ) ;
	addCharacterPiece( name, "nm_arm_right" ) ;
	addCharacterPiece( name, "nm_torso" ) ;
	addCharacterPiece( name, "beard_a", "7f6520" ) ;	
	addCharacterPiece( name, "belt", "85764f" ) ;
	addCharacterPiece( name, "boot_fancy_right", "85764f" ) ;
	addCharacterPiece( name, "boot_fancy_left", "85764f" ) ;
	addCharacterPiece( name, "glove_plain_right", "85764f" ) ;
	addCharacterPiece( name, "glove_plain_left", "85764f" ) ;
	addCharacterPiece( name, "hair_curly", "7f6520" ) ;
	addCharacterPiece( name, "mustache_b", "7f6520" ) ;
	addCharacterPiece( name, "pant_baggy_right", "4a4129" ) ;
	addCharacterPiece( name, "pant_baggy_left", "4a4129" ) ;	
end

function runAI_londonhousefman( name )
	setBaseFaceDirection( name, 0, 1 ) ;
end

function chat_londonhousefman( name, chatWith )
	local swords = {
		"sword_2", 
		"sword_7",  
		"sword_11", 
		"sword_12", 
		"sword_13", 
		"sword_14", 
		"sword_15",
		"sword_16", 
		"sword_17", 
		"sword_18", 
		"sword_19", 
		"sword_20", 
		"sword_21", 
		"sword_22" } ;

	local pistols = { 
		"pistol_matchlock_2",
		"pistol_wheellock_2", 
		"pistol_snaplock_1", 
		"pistol_snaplock_2", 
		"pistol_snaplock_3", 
		"pistol_snaplock_4", 
		"pistol_snaplock_5", 
		"pistol_snaphance_1", 
		"pistol_snaphance_2", 
		"pistol_snaphance_3" } ;

	local muskets = { 
		"musket_matchlock_2", 
		"musket_wheellock_2", 
		"musket_snaplock_1", 
		"musket_snaplock_2", 
		"musket_snaplock_3", 
		"musket_snaplock_4", 
		"musket_snaplock_5", 
		"musket_snaphance_1", 
		"musket_snaphance_2",
		"musket_snaphance_3" } ;

	chat_weapondealers( name, chatWith, swords, pistols, muskets ) ;
end

-- gambling chat
function chatPlayCards( name, chatWith )
	local bubInd = characterSay( name, true, -1, -1, false, getString( "playcards1" ) ) ;
	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
		-- play
		sayAndWait( name, getString( "playcards2" ) ) ;

		bubInd = characterSay( chatWith, false, -1, -1, true, "", getString( "playcards3" ), getString( "playcards4" ), getString( "playcards5" ), getString( "playcards6" ) ) ;
		local option = waitForBubbleOption( bubInd ) ;
		gBetAmount = 0 ;
		if ( option == 0 ) then
			gBetAmount = 5 ;
		elseif ( option == 1 ) then
			gBetAmount = 20 ;
		elseif ( option == 2 ) then
			gBetAmount = 100 ;
		elseif ( option == 3 ) then
			gBetAmount = 500 ;
		end
		
		if ( gBetAmount <= getMoney( ) ) then
			gGameTempMusicID = addMusic( getHighestPriorityMusic( ), 15 ) ;
			gOldLevel = getActiveLevel( ) ;
			stopCameraFollowCharacter( ) ;
			setActiveLevelMessage( "cardgame", 400, 300 ) ;
			activateScriptMessage( "runCardGame" ) ;
		else
			sayAndWait( name, getString( "playcards7" ) ) ;
		end
	end
end

function chatPlayDice( name, chatWith )
	local bubInd = characterSay( name, true, -1, -1, false, getString( "playdice1" ) ) ;
	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
		-- play
		sayAndWait( name, getString( "playcards2" ) ) ;

		bubInd = characterSay( chatWith, false, -1, -1, true, "", getString( "playcards3" ), getString( "playcards4" ), getString( "playcards5" ), getString( "playcards6" ) ) ;
		local option = waitForBubbleOption( bubInd ) ;
		gBetAmount = 0 ;
		if ( option == 0 ) then
			gBetAmount = 5 ;
		elseif ( option == 1 ) then
			gBetAmount = 20 ;
		elseif ( option == 2 ) then
			gBetAmount = 100 ;
		elseif ( option == 3 ) then
			gBetAmount = 500 ;
		end
		
		if ( gBetAmount <= getMoney( ) ) then
			gGameTempMusicID = addMusic( getHighestPriorityMusic( ), 15 ) ;
			gOldLevel = getActiveLevel( ) ;
			stopCameraFollowCharacter( ) ;
			setActiveLevelMessage( "dicegame", 400, 300 ) ;
			activateScriptMessage( "runDiceGame" ) ;
		else
			sayAndWait( name, getString( "playcards7" ) ) ;
		end
	end
end

-- cannonguy
function init_cannonguy( name )
end

function place_cannonguyA( name )
	placeCharacter( name, "france", 4171, 763 ) ;
end

function dress_cannonguyA( name )
	randomDressGuardsman( name, 0.0, 13796 ) ;
	setMeleeWeapon( name, "sword_12" ) ;
end

function runAI_cannonguy( name )
	setBaseFaceDirection( name, 1, 0 ) ;
end

function chat_cannonguy( name, chatWith )
	local talkText = getString( "cannonguy_1" ) ;
	if ( getBoolean( "cannonFired" ) ) then
		talkText = getString( "cannonguy_2" ) ;
	end
	
	--local bubInd = characterSay( name, true, -1, BUBBLE_PROX_N, true, talkText ) ;
	--autoDeleteBubble( bubInd ) ;
	sayAndWait( name, talkText ) ;
end

-- tennisfan1
function init_tennisfan1( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_tennisfan1A( name )
	sitCharacter( name, "tennisbench1" ) ;
end

function dress_tennisfan1A( name )
	clearCharacterPieces( name ) ;
	local darkness = 0.85 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "glove_plain_left", "86837f" ) ;
	addCharacterPiece( name, "glove_plain_right", "86837f" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "belt", "97764b" ) ;
	addCharacterPiece( name, "beard_c", "ccc160" ) ;
	addCharacterPiece( name, "sashbelt", "908374" ) ;
	addCharacterPiece( name, "boot_plain_left", "908374" ) ;
	addCharacterPiece( name, "boot_plain_right", "908374" ) ;
	addCharacterPiece( name, "stripe_plain_arm_left", "e4ce3b" ) ;
	addCharacterPiece( name, "stripe_plain_arm_right", "e4ce3b" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "8a88d7" ) ;
	addCharacterPiece( name, "shirt_fancy_arm_left", "d2c4ac" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "d2c4ac" ) ;
	addCharacterPiece( name, "hair_long", "ccc160") ;
	addCharacterPiece( name, "pant_baggy_left", "5e6477" ) ;
	addCharacterPiece( name, "pant_baggy_right", "5e6477" ) ;
	addCharacterPiece( name, "hat_simple", "97764b") ;

end

function runAI_tennisfan1( name )
	faceDirection( name, 10.0, 0.0 ) ;
	while ( true ) do
		setBaseFaceDirection( name, 1, 0 ) ;
		wait( 1 ) ;
	end
end

function chat_tennisfan1( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "tennisfan1_1" ) ) ;
	sayAndWait( name, getString( "tennisfan1_1" ) ) ;
end

-- tennisfan2
function init_tennisfan2( name )
	setWoman( name, true ) ;
end

function place_tennisfan2A( name )
	sitCharacter( name, "tennisbench4" ) ;
end

function dress_tennisfan2A( name )
	clearCharacterPieces( name ) ;
	local darkness = 0.7 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "w_head" ) ;
	addCharacterPiece( name, "w_hand_left" ) ;
	addCharacterPiece( name, "w_hand_right" ) ;
	addCharacterPiece( name, "w_torso" ) ;
	addCharacterPiece( name, "w_hair_curly", "c38c3d" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "w_cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "w_collar_plain" ) ;
	addCharacterPiece( name, "w_hat_plain", "836d43" ) ;
	addCharacterPiece( name, "w_stripe_legs", "b45151" ) ;
	addCharacterPiece( name, "w_dress_fancy_torso", "b45151" ) ;
	addCharacterPiece( name, "w_dress_plain_legs", "836d43" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_left", "b45151" ) ;
	addCharacterPiece( name, "w_dress_plain_arm_right", "b45151" ) ;

end

function runAI_tennisfan2( name )
	runAI_tennisfan1( name ) ;
end

function chat_tennisfan2( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "tennisfan2_1" ) ) ;
	sayAndWait( name, getString( "tennisfan2_1" ) ) ;
end

-- tennisfan3
function init_tennisfan3( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_tennisfan3A( name )
	placeCharacter( name, "tennis", 284, -11 ) ;
end

function dress_tennisfan3A( name )
	clearCharacterPieces( name ) ;
	local darkness = 1.0 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "cuff_plain_arm_left" ) ;
	addCharacterPiece( name, "cuff_plain_arm_right" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "sashbelt", "c7aa37" ) ;
	addCharacterPiece( name, "boot_fancy_left", "be9053" ) ;
	addCharacterPiece( name, "boot_fancy_right", "be9053" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "bd8637" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "bd8637" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "bd8637" ) ;
	addCharacterPiece( name, "hair_short", "433d34") ;
	addCharacterPiece( name, "pant_musketeer_left", "8aa872" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "8aa872" ) ;
	addCharacterPiece( name, "beret", "8aa872") ;
	addCharacterPiece( name, "feather_hat_small", "c7aa37") ;
	addCharacterPiece( name, "beard_b", "433d34" ) ;
	addCharacterPiece( name, "mustache_a", "433d34" ) ;
end

function runAI_tennisfan3( name )
	runAI_tennisfan1( name ) ;
end

function chat_tennisfan3( name, chatWith )
	--autoDeleteFaceChat( name, chatWith, getString( "tennisfan3_1" ) ) ;
	sayAndWait( name, getString( "tennisfan3_1" ) ) ;
end

-- tennisref
function init_tennisref( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_tennisrefA( name )
	placeCharacter( name, "tennis", 240, 200 ) ;
end

function dress_tennisrefA( name )
	clearCharacterPieces( name ) ;
	local darkness = 1.0 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "cuff_fancy_arm_left", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "cuff_fancy_arm_right", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "collar_fancy", 1, 1, 1, 0.8 ) ;
	addCharacterPiece( name, "belt", "ab8652" ) ;
	addCharacterPiece( name, "beard_a", "5c3f15" ) ;
	addCharacterPiece( name, "mustache_b", "5c3f15" ) ;
	addCharacterPiece( name, "boot_sock_left", "ebdcc7" ) ;
	addCharacterPiece( name, "boot_sock_right", "ebdcc7" ) ;
	addCharacterPiece( name, "doublet_plain_arm_right", "608b5d" ) ;
	addCharacterPiece( name, "doublet_plain_arm_left", "608b5d" ) ;
	addCharacterPiece( name, "shirt_fancy_torso", "608b5d" ) ;
	addCharacterPiece( name, "stripe_plain_leg_right", "a9ba88" ) ;
	addCharacterPiece( name, "stripe_plain_leg_left", "a9ba88" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "a9ba88" ) ;
	addCharacterPiece( name, "hair_medium", "5c3f15" ) ;
	addCharacterPiece( name, "pant_baggy_left", "bab988" ) ;
	addCharacterPiece( name, "pant_baggy_right", "bab988" ) ;
end


function runAI_tennisref( name )
	while ( true ) do
		faceCharacter( name, "dartagnan" ) ;
		wait( randomDouble( 0.3, 0.5 ) ) ;
	end
end

function chat_tennisref( name, chatWith )
	gTennisOpponentNum = getInt( "tennisMatch" ) ;
	
	if ( gTennisOpponentNum > 10 and not getBoolean( "gotTennisReward" ) ) then
		-- give player reward for beating all opponents
		local bubInd = characterSay( name, true, -1, -1, true, getString( "tennisref_d1" ) ) ;
		waitForBubbleClosed( bubInd ) ;

		setInventoryItem( "boot_tennis", 1 ) ;		
		setBoolean( "gotTennisReward", true )
	else
		if ( isMissionActive( "missionparis10" ) or isMissionActive( "missionparis11" ) ) then
			-- tennis missions
			local bubInd = characterSay( name, true, -1, -1, true, getString( "tennisref_d2" ) ) ;
			waitForBubbleClosed( bubInd ) ;
		elseif ( not isMissionComplete( "missionparis11" ) ) then
			-- dont let player play until after you have played porthos
			local bubInd = characterSay( name, true, -1, -1, true, getString( "tennisref_d2_5" ) ) ;
			waitForBubbleClosed( bubInd ) ;
		else
			-- let player play tennis
			local bubInd = characterSay( name, true, -1, -1, true, getString( "tennisref_d3" ) ) ;
			waitForBubbleClosed( bubInd ) ;
			bubInd = characterSay( chatWith, false, -1, -1, true, "", getString( "tennisref_d4" ), getString( "tennisref_d5" ) ) ;
			local option = waitForBubbleOption( bubInd ) ;
			if ( option == 0 ) then
				if ( gTennisOpponentNum <= 10 ) then
					local comment = "" ;
					local opponentName = getString( "tennisopp" .. gTennisOpponentNum ) ;
					if ( gTennisOpponentNum == 1 ) then
						comment = getString( "tennisref_d6", opponentName ) ;
					else
						comment = getString( "tennisref_d7", gTennisOpponentNum - 1, 10, opponentName ) ;
					end
					local bubInd = characterSay( name, true, -1, -1, true, comment ) ;
					waitForBubbleClosed( bubInd ) ;
				end
				activateScriptMessage( "runTennisGame" ) ;
			end
		end
	end
end

-- horsedealer1
function init_horsedealer1( name )
	setStatsCalculatorDynamic( name, -5, -5, 0, 1000, 0.5 ) ;
end

function place_horsedealer1A( name )
	placeCharacter( name, "france", 563, 4070 ) ;
end

function dress_horsedealer1A( name )
	clearCharacterPieces( name ) ;
	local darkness = 1.0 ;
	local skinR = 1.0 * darkness ;
	local skinG = 1.0 * darkness ;
	local skinB = 1.0 * darkness ;
	
	--addCharacterMultiPiece( name, "shirt_plain" ) ;
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_hand_left", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "nm_hand_right", skinR, skinG, skinB ) ;
	addCharacterPiece( name, "glove_plain_left", "836d43" ) ;
	addCharacterPiece( name, "glove_plain_right", "836d43" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	addCharacterPiece( name, "beardmus", "696968" ) ;
	addCharacterPiece( name, "belt", "433b2b" ) ;
	addCharacterPiece( name, "boot_plain_left", "433b2b" ) ;
	addCharacterPiece( name, "boot_plain_right", "433b2b" ) ;
	addCharacterPiece( name, "shirt_plain_arm_right", "dedac6" ) ;
	addCharacterPiece( name, "shirt_plain_arm_left", "dedac6" ) ;
	addCharacterPiece( name, "shirt_plain_torso", "dedac6" ) ;
	addCharacterPiece( name, "hair_short", "696968") ;
	addCharacterPiece( name, "pant_musketeer_left", "856a4c" ) ;
	addCharacterPiece( name, "pant_musketeer_right", "856a4c" ) ;

end

function runAI_horsedealer1( name )
end

function chat_horsedealer1( name, chatWith )
	horseDealerChat( name, 1 ) ;
end

-- horse dealers
function horseDealerChat( name, dealerNum )

	if ( not getBooleanExists( "horsequaltutdone" ) ) then
		setBoolean( "horsequaltutdone", false ) ;
	end
	
	if ( not getBoolean( "horsequaltutdone" ) ) then

		waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
		setDialogueScript( "horsequality", 0 ) ;
		waitForNoActiveTutorialDialogue( ) ;

		setBoolean( "horsequaltutdone", true ) ;					
	end

	local bubInd = characterSay( name, true, -1, -1, true, getString( "horsedealer_1" ) ) ;
	waitForBubbleClosed( bubInd ) ;
	bubInd = characterSay( "dartagnan", false, -1, -1, true, "", getString( "horsedealer_2" ), getString( "horsedealer_3" ), getString( "horsedealer_3_5" ) ) ;
	local option = waitForBubbleOption( bubInd ) ;
	if ( option == 0 ) then
		--local bubInd = characterSay( name, true, -1, BUBBLE_PROX_N, true, getString( "horsedealer_4" ) ) ;
		--autoDeleteBubble( bubInd ) ;
		sayAndWait( name, getString( "horsedealer_4" ) ) ;
	elseif ( option == 1 ) then
		local horseName = getCharacterOwnedHorseName( "dartagnan" ) ;
		local horseExistsAndIsClose = false ;
		
		if ( not ( horseName == "" ) ) then
			local horseX, horseY = getVehiclePos( horseName ) ;
			local dealerX, dealerY = getCharacterPos( name ) ;
			local xDist = horseX - dealerX ;
			local yDist = horseY - dealerY ;
			local horseToDealerDist = math.sqrt( xDist * xDist + yDist * yDist ) ;
			local requireHorseDist = 200.0 ;
			if ( horseToDealerDist < requireHorseDist ) then
				horseExistsAndIsClose = true ;
			end
		end
		
		if ( horseExistsAndIsClose ) then
			local horseQuality = getHorseDisplayQuality( horseName ) ;
			local horseSellPrice = getHorseSellPrice( horseName ) ;
			local horseSellable = isHorseSellable( horseName ) ;
			if ( not horseSellable ) then
				local bubInd = characterSay( name, true, -1, -1, true, getString( "horsedealer_5" ) ) ;
				waitForBubbleClosed( bubInd ) ;	
			else
				-- allowed to sell this horse
				local bubInd = characterSay( name, true, -1, -1, false, getString( "horsedealer_6", horseQuality, intToFrancs( horseSellPrice ) ) ) ;
				waitForBubbleDone( bubInd ) ;
				setBubbleToBackgroundOpacity( bubInd ) ;
				local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, "", getString( "horsedealer_7" ), getString( "horsedealer_8" ) ) ;
				local sellOK = waitForBubbleOption( bubInd2 ) ;
				deleteBubble( bubInd ) ;
				if ( sellOK == 0 ) then
					local bubInd = characterSay( name, true, -1, -1, true, getString( "horsedealer_9" ) ) ;
					waitForBubbleClosed( bubInd ) ;
					
					addMoney( horseSellPrice ) ;
					playSound( "dropmoney", 0.5 ) ;
					removeDriver( horseName, "dartagnan" ) ;
					removeOwnedHorse( "dartagnan" ) ;
					setHorseToDealer( horseName, dealerNum, false ) ;
				else
					local bubInd = characterSay( name, true, -1, -1, true, getString( "horsedealer_10" ) ) ;
					waitForBubbleClosed( bubInd ) ;
				end
			end
		else
			local bubInd = characterSay( name, true, -1, -1, true, getString( "horsedealer_11" ) ) ;
			waitForBubbleClosed( bubInd ) ;	
		end
	else
		-- nevermind - don't respond
	end
end

function buyHorseScript( dealerNum, horseName )
	if ( not gBuyingHorseRunning ) then
		gBuyingHorseRunning = true ;
		
		local dealerName = "horsedealer" .. dealerNum ;
		
		DEBUG_OUTPUT( "dealerName " .. dealerName ) ;
		DEBUG_OUTPUT( "horseName " .. horseName ) ;
			
		lockPlayerInPlace( ) ;
		local dealerX, dealerY = getCharacterPos( dealerName ) ;
		local dealerLevel = getCharacterLevel( dealerName ) ;
		local playerChatPosX = dealerX ;
		local playerChatPosY = dealerY ;
		local boughtHorseChatPosX = dealerX ;
		local boughtHorseChatPosY = dealerY ;
		
		if ( dealerNum == 1 ) then
			playerChatPosX = dealerX - 70 ;
			playerChatPosY = dealerY ;
			boughtHorseChatPosX = dealerX ;
			boughtHorseChatPosY = dealerY + 70 ;
		elseif ( dealerNum == 2 ) then
			playerChatPosX = dealerX + 70 ;
			playerChatPosY = dealerY ;
			boughtHorseChatPosX = dealerX ;
			boughtHorseChatPosY = dealerY - 70 ;
		end
		
		setStateMessageIdle( "dartagnan" ) ; -- stop from doing whatever we are doing right now
		addGoalGetToPointInLevel( "dartagnan", playerChatPosX, playerChatPosY, dealerLevel, true ) ;
		while ( characterHasGoal( "dartagnan" ) ) do
			coroutine.yield( ) ;
		end
		faceCharacter( "dartagnan", dealerName ) ;
		faceCharacter( dealerName, "dartagnan" ) ;
		coroutine.yield( ) ;
		unlockPlayerInPlace( ) ;
	
		freezeGame( ) ;
		local playerHorseName = getCharacterOwnedHorseName( "dartagnan" ) ;
		if ( not ( playerHorseName == "" ) ) then
			-- player already has horse
			local bubInd = characterSay( dealerName, true, -1, -1, true, getString( "horsedealer_12" ) ) ;
			waitForBubbleClosed( bubInd ) ;
		else
			DEBUG_OUTPUT( "horseName " .. horseName ) ;
			local horseQuality = getHorseDisplayQuality( horseName ) ;
			local horseBuyPrice = getHorseBuyPrice( horseName ) ;
			local horseBuyable = isHorseBuyable( horseName ) ;
			if ( not horseBuyable ) then
				local cantBuyText = getString( "horsedealer_13" ) ;
				if ( horseName == "horse1" ) then
					cantBuyText = getString( "horsedealer_13_5" ) ;
				end
				
				local bubInd = characterSay( dealerName, true, -1, -1, true, cantBuyText ) ;
				waitForBubbleClosed( bubInd ) ;
			else
				-- horse is buyable
				
				if ( not getBooleanExists( "horsequaltutdone" ) ) then
					setBoolean( "horsequaltutdone", false ) ;
				end
				
				if ( not getBoolean( "horsequaltutdone" ) ) then
			
					waitForNoActiveTutorialDialogue( ) ; -- make sure no tutorial already
					setDialogueScript( "horsequality", 0 ) ;
					waitForNoActiveTutorialDialogue( ) ;
			
					setBoolean( "horsequaltutdone", true ) ;					
				end
							
				local bubInd = characterSay( dealerName, true, -1, -1, false, getString( "horsedealer_14", horseQuality, intToCommaString( horseBuyPrice ) ) ) ;
				waitForBubbleDone( bubInd ) ;
				setBubbleToBackgroundOpacity( bubInd ) ;
				local bubInd2 = characterSay( "dartagnan", false, -1, -1, true, "", getString( "horsedealer_15" ), getString( "horsedealer_16" ) ) ;
				local buyOK = waitForBubbleOption( bubInd2 ) ;
				deleteBubble( bubInd ) ;
				if ( buyOK == 0 ) then
					if ( getMoney( ) >= horseBuyPrice ) then
						local bubInd = characterSay( dealerName, true, -1, -1, true, getString( "horsedealer_17" ) ) ;
						waitForBubbleClosed( bubInd ) ;
						
						local dealerX, dealerY = getCharacterPos( dealerName ) ;
									
						removeMoney( horseBuyPrice ) ;
						playSound( "dropmoney", 0.5 ) ;
						setOwnedHorse( "dartagnan", horseName ) ;
						removeHorseDealer( horseName ) ;
						vehicleGoToPoint( horseName, boughtHorseChatPosX, boughtHorseChatPosY ) ;
					else
						local bubInd = characterSay( dealerName, true, -1, -1, true, getString( "horsedealer_18" ) ) ;
						waitForBubbleClosed( bubInd ) ;
					end
				else
					local bubInd = characterSay( dealerName, true, -1, -1, true, getString( "horsedealer_19" ) ) ;
					waitForBubbleClosed( bubInd ) ;
				end
			end
		end
		unfreezeGame( ) ;
		
		gBuyingHorseRunning = false ;
	end
end

-- Utilities
function playSoundOnClose( name, soundName )
	while( true ) do
		local destX = randomInt( -25, 25 ) ; --randomInt( -1000, 1000 ) ;
		local destY = randomInt( 175, 225 ) ; --randomInt( -800, 800 ) ;
		pathfindToPos( name, destX, destY ) ;
		--panCameraToWait( destX, destY, 100, true ) ;
		
		repeat
			if ( charactersAreWithin( name, "dartagnan", 35 ) ) then
				playSound( soundName ) ;
			end
			coroutine.yield( ) ;		
		until ( not isPathfinding( name ) )
	end	
end

function placeDead( name )
	if ( isCharacterAlive( name ) ) then
		-- kill him
		placeCharacter( name, "france", -30000, 0 ) ;
	end
end

function placeNowhere( name )
	placeCharacter( name, "france", -30000, 0 ) ;
end

function dressMusketeer( name )
	clearCharacterPieces( name ) ;
	local darkness = 0.8 
	local skinR = 0.7
	local skinG = 0.5
	local skinB = 0.3
	--addCharacterMultiPiece( name, "nm", skinR, skinG, skinB ) ;
	--addCharacterPiece( name, "sword_1" ) ;
	setMeleeWeapon( name, "sword_1" ) ;
	addCharacterMultiPiece( name, "shirt_plain" ) ;
	--addCharacterPiece( name, "nm_arm_left" ) ;
	--addCharacterPiece( name, "nm_arm_right" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_head" ) ;
	--addCharacterPiece( name, "nm_leg_left" ) ;
	--addCharacterPiece( name, "nm_leg_right" ) ;
	--addCharacterPiece( name, "nm_torso" ) ;
	--addCharacterMultiPiece( name, "plain_boots" ) ;
	addCharacterPiece( name, "hair_long" ) ;
	addCharacterPiece( name, "pant_musketeer_left", 1.0, 0.666, 0.516, 1.0 ) ;
	addCharacterPiece( name, "pant_musketeer_right", 1.0, 0.666, 0.516, 1.0 ) ;
	
	addCharacterPiece( name, "tabbard", 0.2, 0.2, 1.0, 1.0 ) ;
--	addCharacterPiece( name, "tabbard", 1.0, 0.2, 0.2, 1.0 ) ;
	addCharacterPiece( name, "tabbard_overlay" ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	
	
	addCharacterPiece( name, "hat_plain", 0.3, 0.3, 0.3, 1.0 ) ;
	addCharacterPiece( name, "feather_hat_plain", 1.0, 0.2, 0.2, 1.0 ) ;

	addCharacterPiece( name, "boot_plain_left", 0.25, 0.25, 0.25, 1.0 ) ;
	addCharacterPiece( name, "boot_plain_right", 0.25, 0.25, 0.25, 1.0 ) ;
end

function dressCardinalGuard( name )
	clearCharacterPieces( name ) ;
	local darkness = 0.8 
	local skinR = 0.7
	local skinG = 0.5
	local skinB = 0.3
	--addCharacterMultiPiece( name, "nm", skinR, skinG, skinB ) ;
	setMeleeWeapon( name, "sword_1" ) ;
	--addCharacterPiece( name, "sword_1" ) ;
	addCharacterMultiPiece( name, "shirt_plain", 0.3, 0.3, 0.3, 1.0 ) ;
	--addCharacterPiece( name, "nm_arm_left" ) ;
	--addCharacterPiece( name, "nm_arm_right" ) ;
	addCharacterPiece( name, "nm_hand_left" ) ;
	addCharacterPiece( name, "nm_hand_right" ) ;
	addCharacterPiece( name, "nm_head" ) ;
	addCharacterPiece( name, "nm_leg_left" ) ;
	addCharacterPiece( name, "nm_leg_right" ) ;
	--addCharacterPiece( name, "nm_torso" ) ;
	--addCharacterMultiPiece( name, "plain_boots" ) ;
	addCharacterPiece( name, "hair_long" ) ;
	addCharacterPiece( name, "pant_musketeer_left", 0.7, 0.666, 0.516, 1.0 ) ;
	addCharacterPiece( name, "pant_musketeer_right", 0.7, 0.666, 0.516, 1.0 ) ;
	
--	addCharacterPiece( name, "tabbard", 0.2, 0.2, 1.0, 1.0 ) ;
	addCharacterPiece( name, "tabbard", 1.0, 0.2, 0.2, 1.0 ) ;
	addCharacterPiece( name, "tabbard_overlay", 1.0, 1.0, 0.2, 1.0 ) ;
	addCharacterPiece( name, "collar_plain" ) ;
	
	
	addCharacterPiece( name, "hat_plain", 0.5, 0.5, 0.5, 1.0 ) ;
	addCharacterPiece( name, "feather_hat_plain", 1.0, 1.0, 0.2, 1.0 ) ;

	addCharacterPiece( name, "boot_plain_left", 1.0, 0.5, 0.2, 1.0 ) ;
	addCharacterPiece( name, "boot_plain_right", 1.0, 0.5, 0.2, 1.0 ) ;
end