function OnWarpEnter() 
	-- A ENLEVER
	Costume_complet = false
	HairReady = true
	-----------------------------------------------
	SetMarker("cs\\Warp_0010.wp" , 0 , 0) 
	SetMarker("cs\\Warp_0008.wp" , 0 , 0)

	-- tiroir coiffeuse
	if not O_drawer_006 then
		AnimationSetToStart("ava1")
	else
		AnimationSetToEnd("ava1")
	end
	-- bougie salle 12
	AnimationSetToStart("bva1")
	-- pot sur le poêle
	AnimationSetToStart("bla1")
	-- peruque
	if not O_wig_006 then
		PutObject("ata1", false)
	end
	-- briquet
	if not O_lighter_008 then
		PutObject("bia1")
	end
	-- feu de cheminée
	StartAnimationPart("bca1", 10, 20,-1, false)

--DAY3
	if ETAT_DAY == "D3" then 
		-- couverture
		AnimationSetToEnd("bda1",false)	
		StartAnimation("bca1")
		-- Nostradamus dans le lit
--		StartAnimationPart("bba1",270,271,-1,false)
		if not FIRST_THIRD_DAY_ENTRY then
			LookAt(217,018)
			SetMarker("bban",-1,0)
			StartAnimationPart("bban",60,90,-1,false)
			DrawText("No2141","No2141.ogg",2)
			DrawText("Ma2142","Ma2142.ogg",0)
			DrawText("No2143","No2143.ogg",2)
			DrawText("Ma2144","Ma2144.ogg",0)
			DrawText("No2145","No2145.ogg",2)
			DrawText("Ma2147","Ma2147.ogg",0)
			DrawText("No2148","No2148.ogg",2)
			FIRST_THIRD_DAY_ENTRY = true
		else
--			StartAnimationPart("bba1",240,300,-1,false)
			StartAnimationPart("bban",0,60,-1,false)
			SetMarker("bban",4,0)
		end
	end 

--DAY4
	if ETAT_DAY == "D4" then 
		LookAt(217,018)
	end
end

function OnWarpLeave()
end

function OnDialogFinished(dialogName)

	if dialogName == "No2141" or dialogName == "No2143" or dialogName == "No2145"   or dialogName == "No2148" or dialogName == "No2156" 
	or dialogName == "No2158" or dialogName == "No2162" or dialogName == "No2162" or dialogName == "No2149" then
		StartAnimationPart("bban",0,60,-1,false)
	end
	if dialogName == "Ma2142" or dialogName == "Ma2144" or dialogName == "Ma2147" or dialogName == "Ma2154" or dialogName == "Ma2157" 
	or dialogName == "Ma2159" then
		StartAnimationPart("bban",60,90,-1,false)
	end

	if dialogName == "No2148" or dialogName == "No2162" or dialogName == "No2162" or dialogName == "No2148" or dialogName == "Ma2150" 
	or dialogName == "No2149" or dialogName == "Ma2151"  then
		SetMarker("bban", 4, 0) 
	end

	if dialogName == "Ma1630" then
		SetMarker("bban", 4, 0)
	end

	if dialogName == "No2160" then
		SetRecipiesPage(4, "Page4")
		SetRecipiesPage(6, "Page6")
	end
	
end

function OnAnswered(textId)

	if textId == "3411" then -- prendre congé
		SetMarker("baa1", 4, 0)
	end
end

function OnWarpObjectHit(objectName)

--DAY3
	if ETAT_DAY == "D3" then 

		if objectName == "bban" then
			if NEED_PREPARE_MEDICINE_D3 and not PREPARE_MEDICINE_D3 and not RecipieIndication09 then
				SetMarker("bban",-1,0)
				DrawText("Ma2154","Ma2154.ogg",0) -- Je cherche la recette d'un remède qui préserverait de la peste.
				DrawText("No2155","No2155.ogg",2) -- 
				DrawText("No2156","No2156.ogg",2) -- 
				DrawText("Ma2157","Ma2157.ogg",0) -- 
				DrawText("No2158","No2158.ogg",2) -- 
				DrawText("Ma2159","Ma2159.ogg",0) -- 
				DrawText("No2160","No2160.ogg",2) -- 
				DrawText("No2161","No2161.ogg",2) -- 
				DrawText("No2162","No2162.ogg",2) -- Tu devrais trouver la recette et de l'ambre gris sur mon bureau.
				RecipieIndication09 = true

			elseif NEED_PREPARE_MEDICINE_D3 and not PREPARE_MEDICINE_D3 and RecipieIndication09 then
				SetMarker("bban",-1,0)
				StartAnimationPart("bban",60,90,-1,false)
				DrawText("No2162","No2162.ogg",2) -- Tu devrais trouver la recette et de l'ambre gris sur mon bureau.

			elseif not GIVE_BREAD_TO_NOSTRADAMUS and Selected("A_pain") then
				SetMarker("bban",-1,0)
				StartAnimationPart("bban",60,90,-1,false)
				DrawText("No2148","No2148.ogg",2)
				RemoveFromBag()
				GIVE_BREAD_TO_NOSTRADAMUS = true
				--activate vars

				JEANDIARYOPEN_0071_D3 = false
				JEAN_AT_LIBRARY_0055_D3 = true
				philbertNotes_0071_D3 = false
				SEEN_DEAD_GUARD_D3 = false
				PAPERTAKEN_JEAN = false
				PHILIP_DEAD_GUARD_0072_D3 = false
				TALKED_TO_JEAN_0072 = false
				DEAD_GUARD_MOVED_D3 = false
				SEEN_GUARD_DEAD_072_D3 = false
				LETTER_TAKEN_D3 = false
				DEAD_GUARD_COVERED_D3 = false
				MONK_AT_LIBRARY_0056_D3 = true
				
				FIND_MEANING_AMP_D3 =true ---set it with puzzle

			elseif not GIVE_BREAD_TO_NOSTRADAMUS then
				SetMarker("bban",-1,0)
				DrawText("Ma2150","Ma2150.ogg",0)
			elseif GIVE_BREAD_TO_NOSTRADAMUS and Selected("A_pain") then
				SetMarker("bban",-1,0)
				StartAnimationPart("bban",60,90,-1,false)
				DrawText("No2149","No2149.ogg",2)
			elseif GIVE_BREAD_TO_NOSTRADAMUS then
				SetMarker("bban",-1,0)
				DrawText("Ma2151","Ma2151.ogg",0)
			end

		end
	end 

-- SORTIE DE WARP
	if objectName == "3D\\cs\\Warp_0010.wp" then 
		ChangeWarp(objectName)
	end

	if objectName == "3D\\cs\\Warp_0008.wp" then 
		ChangeWarp(objectName)
	end
-----------
end 