function OnWarpEnter() 
	D4_InW159= true
	
	if PuzzleLibrary then
		SetMarker("cs\\Warp_0080.wp" , 0 , 0) 
	end
	SetMarker("cs\\Warp_0178.wp" , 0 , 0) 
	SetMarker("cs\\Warp_0158.wp" , 0 , 0)
	ImportAnimationWarp("3D\\cs\\Warp_0059")

--	placard de Philibert
--	AnimationSetToEnd("fbc1",false)
	

	if Sidh and not PuzzleLibrary then
		SetMarker("loc1",4,0)
		SetMarker("lsc1",4,0)
	end
	Music_Change = false

---------------------------------------------------------------------------------- Runes
	if not Runes then
--		StartAnimationPart("l1c1",0,1,-1,true)
--		StartAnimationPart("l2c1",0,1,-1,true)
--		StartAnimationPart("l3c1",0,1,-1,true)
--		StartAnimationPart("l4c1",0,1,-1,true)
		StartAnimationPart("loc1",51,52,-1,true)
		StartAnimationPart("lpc1",52,53,-1,true)
		StartAnimationPart("lqc1",53,54,-1,true)
		StartAnimationPart("lrc1",54,55,-1,true)
		StartAnimationPart("lsc1",55,56,-1,true)
		StartAnimationPart("ltc1",56,57,-1,true)
		StartAnimationPart("luc1",57,58,-1,true)
		StartAnimationPart("lvc1",58,59,-1,true)
		StartAnimationPart("lwc1",59,60,-1,true)
		StartAnimationPart("lxc1",60,61,-1,true)
		StartAnimationPart("lyc1",61,62,-1,true)
		StartAnimationPart("lzc1",62,63,-1,true)
	end	
---------------------------------------------------------------------------------- Taquin
	if not PuzzleLibrary then
		StartAnimationPart("lac1",1,2,-1,true)

		StartAnimationPart("lbc1",3,4,-1,true)

		StartAnimationPart("lcc1",7,8,-1,true)

		StartAnimationPart("ldc1",9,10,-1,true)

		StartAnimationPart("lec1",12,13,-1,true)

		StartAnimationPart("lfc1",15,16,-1,true)

		StartAnimationPart("lgc1",21,22,-1,true)

		StartAnimationPart("lhc1",23,24,-1,true)

		StartAnimationPart("lic1",26,27,-1,true)

		StartAnimationPart("ljc1",30,31,-1,true)

		StartAnimationPart("lkc1",36,37,-1,true)

		StartAnimationPart("llc1",41,42,-1,true)

		StartAnimationPart("lmc1",45,46,-1,true)

		StartAnimationPart("lnc1",49,50,-1,true)
	else
		StartAnimationPart("lac1",0,1,-1,true)

		StartAnimationPart("lbc1",4,5,-1,true)

		StartAnimationPart("lcc1",5,6,-1,true)

		StartAnimationPart("ldc1",9,10,-1,true)

		StartAnimationPart("lec1",14,15,-1,true)

		StartAnimationPart("lfc1",17,18,-1,true)

		StartAnimationPart("lgc1",20,21,-1,true)

		StartAnimationPart("lhc1",22,23,-1,true)

		StartAnimationPart("lic1",27,28,-1,true)

		StartAnimationPart("ljc1",31,32,-1,true)

		StartAnimationPart("lkc1",33,34,-1,true)

		StartAnimationPart("llc1",38,39,-1,true)

		StartAnimationPart("lmc1",46,47,-1,true)

		StartAnimationPart("lnc1",50,51,-1,true)
	end
---------------------------------------------------------------------------------- 



	if ETAT_DAY == "D4" then 
		StartAnimation("flc1")
		StartAnimationPart("fbc1",1,2,-1,true)
		if not AskPhilibertConstance then
			SetMarker("MAGNA_BOOK",4,0)
		end 
		if BOOK_PLACED then
			if not BOOK_OPENED then
				AnimationSetToStart("fmc1",true)
			elseif BOOK_OPENED and not NOTE_TAKEN then
				StartAnimationPart("fmc1",1,2,-1,true)
			elseif BOOK_OPENED and NOTE_TAKEN then
				StartAnimationPart("fmc1",2,3,-1,true)
			end
		end
		if CONSTANCE_PUZZLE_SOLVED and not PUT_ROPED then
			SetMarker("ROPE",4,0)
		elseif PUT_ROPED then
			SetMarker("ROPE",4,0)
		end
	end 
	if ETAT_DAY == "D5" then 

	end 
end

function OnWarpLeave()
	D4_InW159= false
	--[[if Music_Change then
		-- Musique
		Music_Change = false
		PlayMusic("Sounds/Musiques/M_souterrain.ogg")
	end]]
end

function OnDialogFinished(dialogName)
	if dialogName == "Ma2712" then
		SetMarker("MAGNA_BOOK",4,0)
		AMP2Seen = true
	end
	if dialogName == "Ma2714" then
		SetMarker("MAGNA_BOOK",4,0)
	end
end

function OnWarpObjectHit(objectName)

	if objectName == "3D\\cs\\Warp_0080.wp" then 
		if DRESS_CESAR then
			ChangeWarp(objectName)
			--Music_Change = true
			PlayMusic("Sounds/Musiques/M_souterrain.ogg")
		else
			DrawText("Ma2789","Ma2789.ogg", 0) -- Ma robe va me gêner.
		end
	end

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

	if objectName == "3D\\cs\\Warp_0158.wp" then 
		if OPENED_HIDDEN_ROOM then
			PlaySound("Sounds/SFX/E_Armoire_Fermeture.ogg",1)
			OPENED_HIDDEN_ROOM = false
		end
		ChangeWarp(objectName)
	end
	if objectName == "3D\\MAGNA_BOOK" then
		if not AskPhilibertConstance then
			SetMarker("MAGNA_BOOK",-1,0)
			if not AMP2Seen then
				DrawText("Ma2710","Ma2710.ogg", 0) -- On dirait un autre volume de l'Astronomia Magna. Mais  il est vide, quelqu'un a dû passer avant moi. 
				DrawText("Ma2711","Ma2711.ogg", 0) -- A moins que je ne me sois trompée.
				DrawText("Ma2712","Ma2712.ogg", 0) -- La seule façon de m'en assurer est de trouver un autre volume.
			else
				DrawText("Ma2714","Ma2714.ogg", 0) -- Ce tome est vide, mais il m'en reste encore deux à trouver.
			end
		end
	end

	if objectName == "loc1" or objectName == "lsc1" then
		ShowPuzzle(8)
	end

	if ETAT_DAY == "D1" then 

		-- bougies du chandelier
		if objectName == "flc1" then

		-- Astronomia sur le secrétaire
		elseif objectName == "fmc1" then

---------------------------------------------------------------------- Taquin
		elseif objectName == "lac1" then

		elseif objectName == "lcc1" then

		elseif objectName == "lec1" then

		elseif objectName == "lfc1" then

		elseif objectName == "lgc1" then

		elseif objectName == "lic1" then

		elseif objectName == "ljc1" then

		elseif objectName == "lkc1" then

		elseif objectName == "llc1" then

		elseif objectName == "lmc1" then

		elseif objectName == "lnc1" then

---------------------------------------------------------------------- 
---------------------------------------------------------------------- Runes
		elseif objectName == "loc1" then

		elseif objectName == "lpc1" then

		elseif objectName == "lqc1" then

		elseif objectName == "lrc1" then

		elseif objectName == "lsc1" then

		elseif objectName == "ltc1" then

		elseif objectName == "luc1" then

		elseif objectName == "lvc1" then

		elseif objectName == "lwc1" then

		elseif objectName == "lxc1" then

		elseif objectName == "lyc1" then

		elseif objectName == "lzc1" then
---------------------------------------------------------------------- 

		end
	end 

--DAY2
	if ETAT_DAY == "D2" then 

	end 

--DAY3
	if ETAT_DAY == "D3" then 

	end 

--DAY4
	if ETAT_DAY == "D4" then 

	end 

--DAY5
	if ETAT_DAY == "D5" then 

	end 
end

function OnLibraryPuzzleAnswered()
	
	SetMarker("cs\\Warp_0080.wp" , 0 , 0) 
	PuzzleLibrary = true
	SetMarker("loc1",-1,0)
	SetMarker("lsc1",-1,0)

	StartAnimationPart("lac1",0,1,-1,true)

	StartAnimationPart("lbc1",4,5,-1,true)

	StartAnimationPart("lcc1",5,6,-1,true)

	StartAnimationPart("ldc1",9,10,-1,true)

	StartAnimationPart("lec1",14,15,-1,true)

	StartAnimationPart("lfc1",17,18,-1,true)

	StartAnimationPart("lgc1",20,21,-1,true)

	StartAnimationPart("lhc1",22,23,-1,true)

	StartAnimationPart("lic1",27,28,-1,true)

	StartAnimationPart("ljc1",31,32,-1,true)

	StartAnimationPart("lkc1",33,34,-1,true)

	StartAnimationPart("llc1",38,39,-1,true)

	StartAnimationPart("lmc1",46,47,-1,true)

	StartAnimationPart("lnc1",50,51,-1,true)

end 