function OnWarpEnter() 
	SetMarker("cs\\Warp_0072.wp" , 0 , 0)
	SetMarker("cs\\Warp_0068.wp" , 0 , 0) 

	if Music_Change then
		Music_Change = false
		PlayMusic("Sounds/Musiques/M_FouillerChambre.ogg")
	end

--DAY3
	if ETAT_DAY == "D3" then 
		if DEAD_GUARD_PASSAGE_0072_D3 and not SEEN_DEAD_GUARD_D3 then
			LookAt(84,5)
			SEEN_DEAD_GUARD_D3 = true
			PlayMusic("Sounds/Musiques/M_EtrangesIncidents.ogg")
			DrawText("Ma2281","Ma2281.ogg",0) -- Mon dieu !
		end

		if TALKED_TO_JEAN_0072 then
			AnimationSetToStart("hac1",true)
			SetMarker("hac1",4,0)
		end

		if JEAN_DOOR_OPENED_D3 and not TALKED_TO_JEAN_0072 then
			AnimationSetToEnd("hac1",false)
			SetMarker("cs\\Warp_0071.wp" , 0 , 0)

------------------------------------------------------------------------------ AMP
			if not AmpOpen_0071_D3 then
				AnimationSetToStart("hfc1")
				SetMarker("hfc1",4,0)
			elseif AmpOpen_0071_D3 and not O_papier_philibert_0071 then
				StartAnimationPart("hfc1",2,3,-1,true)
				SetMarker("hfc1",2,0)
			else
				StartAnimationPart("hfc1",3,4,-1,true)
			end
------------------------------------------------------------------------------ 		
			
			if PHILBERT_STAND_IN_ROOM_0071_D3 then
				StartAnimationPart("hcc1",0,20,-1,false)
			end
		else	
			AnimationSetToStart("hac1",true)
			SetMarker("hac1",4,0)
		end

		if DEAD_GUARD_PASSAGE_0072_D3 then
			if DEAD_GUARD_COVERED then
				StartAnimationPart("hic1",3,4,-1,false)
			else
				AnimationSetToStart("hic1",false)
			end
			if PHILIP_DEAD_GUARD_0072_D3 then
				StartAnimationPart("hhc1",0,20,-1,false)

			end
		end
	end 

--DAY4
	if ETAT_DAY == "D4" then 
		if TALK_TO_QUEEN_D4 and not TOOK_MAP_FRAGMENT_D4 then
			PutObject("gec1")
		end
		if not TALK_TO_QUEEN_D4 then
			AnimationSetToStart("hac1",false)
			SetMarker("hac1",4,0)
		else
			AnimationSetToEnd("hac1",false)
			if not TALK_JEAN_D4 then
				SetMarker("cs\\Warp_0071.wp" , 0 , 0)
			else
				SetMarker("hac1",4,0)
			end
		end
	end
end

function OnDialogFinished(dialogName)
	if dialogName == "Ma2281" then
		SetMarker("cs\\Warp_0071.wp",-1, 0) 
--		SetMarker("cs\\Warp_0067.wp",-1,0) 
	end
	if dialogName == "Ma2357" then
		SetMarker("hac1",4,0)
	end
end

function OnWarpLeave()
	if Music_Change then
		-- Musique
		Music_Change = false
		PlayMusic("Sounds/Musiques/M_FouillerChambre.ogg")
	end
end

function OnAnimationFinished(objectName)
	if ETAT_DAY == "D3" then
		if objectName == "hac1" then
			AnimationSetToEnd("hac1",false)
			JEAN_DOOR_OPENED_D3 = true
			SetMarker("cs\\Warp_0071.wp" , 0 , 0) 
		end
	end
end

function OnWarpObjectHit(objectName)

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

	if objectName == "3D\\cs\\Warp_0071.wp" then
		if ETAT_DAY == "D3" then
			if JEAN_DOOR_OPENED_D3 then
				Music_Change = true
				ChangeWarp("3D\\cs\\Warp_0071.wp")
			else
				PlaySound("Sounds/SFX/N_BruitDeSerrure.ogg",1)
				DrawText("Ma1772","Ma1772.ogg",0) -- Fermé !
			end

		elseif ETAT_DAY == "D5" then
			if JEAN_DOOR_OPENED_D5 then
				Music_Change = false
				ChangeWarp("3D\\cs\\Warp_0071.wp")
			end
		elseif ETAT_DAY == "D4" then
			if TOOK_MAP_FRAGMENT_D4 and not TALK_JEAN_D4 then
				ChangeWarp("3D\\cs\\Warp_0071.wp")
			elseif TALK_JEAN_D4 then
				DrawText("Ma3171","Ma3171.ogg",0) -- Ce n'est pas le moment
			end 
		end
	end

	if objectName == "3D\\cs\\Warp_0068.wp" then 
		if DEAD_GUARD_PASSAGE_0072_D3 and not DEAD_GUARD_MOVED_D3 then
			DrawText("Ma2514","Ma2514.ogg",0) -- Ce n'est pas le moment. Je dois m'occuper du garde.
		else
			ChangeWarp(objectName)
		end
	end

	if ETAT_DAY == "D3" then 
		if objectName == "hac1" then
			if not JEAN_DOOR_OPENED_D3 and not (W71_D3_Madeleine or W71_D3_Cesar) then
				if Selected("B_clef") then 
					RemoveFromBag()
					SetMarker("hac1",-1,0)
					StartAnimation("hac1",1,false)
					PlaySound("Sounds/SFX/E_ArmoireOuverture.ogg",1)
					JEAN_DOOR_OPENED_D3 = true
				else 
					DrawText("Ma1706","Ma1706.ogg",0) -- C'est fermé à clef.
				end
			end
			if W71_D3_Fini and not DEAD_GUARD_MOVED_D3 then
				DrawText("Ma2514","Ma2514.ogg",0) -- Ce n'est pas le moment. Je dois m'occuper du garde.
			end
			if TALKED_TO_JEAN_0072 then
				if Selected("B_clef") then
					DrawText("Ma3171","Ma3171.ogg",0) --  Ce n'est pas le moment.
				else
					DrawText("Ma1706","Ma1706.ogg",0) -- C'est fermé à clef.
                                end
			end
		end
	end 

--DAY4
	if ETAT_DAY == "D4" then 
		if objectName == "hac1" then
			if not TALK_TO_QUEEN_D4 then
				if Selected("B_clef") then 
				       DrawText("Ma3097","Ma3097.ogg",0) -- Il a dû changer la serrure.
				else 
					DrawText("Ma1706","Ma1706.ogg",0) -- C'est fermé à clef.
				end
			end
			if TALK_JEAN_D4 then
				DrawText("Ma3171","Ma3171.ogg",0) -- Ce n'est pas le moment
			end
		end
	end
end
