function OnWarpEnter()
	SetMarker("cs\\Warp_0056.wp" , 0 , 0) 
	ImportAnimationWarp("3D\\cs\\Warp_0058")
	if ETAT_DAY == "D1" then 

	end 
	if ETAT_DAY == "D2" then 

	end 
	if ETAT_DAY == "D3" then 

	end 
	if ETAT_DAY == "D4" then
	
		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
	
	  AnimationSetToEnd("fbc1",false)
	 if ESCAPE_FROM_CHAVIGNY and not JEAN_AT_LIBRARY_D4 then
		DrawText("Ma2151","Ma2151.ogg")
		JEAN_AT_LIBRARY_D4  = true
		MOVED_BOOKS = false 
	  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 TOOK_MAP_FRAGMENT_D4 then
		if not MOVED_BOOKS then
			AnimationSetToStart("fec1",false)
			SetMarker("fec1",4,0)
		elseif not OPENED_HIDDEN_ROOM  then
			StartAnimationPart("fec1",1,2,-1,false)
			SetMarker("fec1",4,0)
		else
			SetMarker("cs\\Warp_0159.wp" , 0 , 0)
		end
	  else
		AnimationSetToStart("fec1",false)
	  end
	 
  
	end 
	if ETAT_DAY == "D5" then 

	end 
end

function OnWarpLeave()
end

function OnWarpObjectHit(objectName)

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

	if objectName == "3D\\cs\\Warp_0056.wp" then 
		ChangeWarp(objectName)
		if OPENED_HIDDEN_ROOM then
			PlaySound("Sounds/SFX/E_Armoire_Fermeture.ogg",1)
			OPENED_HIDDEN_ROOM = false
		end
	end

	if ETAT_DAY == "D1" then 
		if objectName == "flc1" then

		elseif objectName == "fmc1" then

		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

		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 
	if ETAT_DAY == "D2" then 
		if objectName == "flc1" then

		elseif objectName == "fmc1" then

		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

		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 
	if ETAT_DAY == "D3" then 
		if objectName == "flc1" then

		elseif objectName == "fmc1" then

		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

		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 
	if ETAT_DAY == "D4" then
		if objectName == "flc1" then
		
		elseif objectName == "fec1" then
			if not MOVED_BOOKS then
				PrintDebugMessage("Books moved !")
			    if not ESCAPE_FROM_CHAVIGNY then
					PrintDebugMessage("Not escaping from chavigny !")
					StartAnimationPart("fec1",1,2,-1,false)
					SetMarker("fec1",4,0)
					MOVED_BOOKS = true
			    else
				   DrawText("Ma2788","Ma2788.ogg")
			    end
			elseif not OPENED_HIDDEN_ROOM and Selected("C_clef_philiber")  then
			
				if JEAN_AT_LIBRARY_D4 then
					DrawText("Ma2788","Ma2788.ogg") -- Pas maintenant. Chavigny n'a pas besoin de connaître l'existence de cette pièce.
				else			
--				StartAnimationPart("fec1",2,134,1,false)
				SetMarker("fec1",-1,0)
				StartAnimationPart("fec1", 30, 31, -1, false)
				SetMarker("cs\\Warp_0159.wp" , 0 , 0)
				OPENED_HIDDEN_ROOM = true
				PlayMusic("Sounds/Musiques/M_FouillerChambre.ogg")
				end
		
			elseif not OPENED_HIDDEN_ROOM and Selected("C_clef_philibe") then
				DrawText("Ma3516","Ma3516.ogg") -- J'étais pourtant sûre que la clef de Philibert marcherait. Elle entre mais ne tourne pas.
			else
				DrawText("Ma1706","Ma1706.ogg") -- C'est fermé à clef.
			end			
		elseif objectName == "fmc1" then

		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

		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 
	if ETAT_DAY == "D5" then 
		if objectName == "flc1" then

		elseif objectName == "fmc1" then

		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

		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 
end
