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

	-- pot
	AnimationSetToStart("bla1",false)

	-- cheminée
	StartAnimationPart("boan",60,80,-1,false)
	----------------------------------------------------
	solved_astrological_puzzle = true

	SetMarker("btan", 4, 0)

	AnimationSetToEnd("bma1", true)


	if ETAT_DAY == "D3" then
		AnimationSetToStart("btan",true)
		if not PHIAL_AMBERGRIS_TAKEN then
			PutObject("bja1",true)
			SetMarker("bja1",2,0)
		end
	end 

	if ETAT_DAY == "D4" then
		AnimationSetToEnd("bla1",false)

		if not OPEN_DESK_0013_D3 then
			AnimationSetToEnd("btan",true)
			SetMarker("btan", 4, 0)
			if not PAPER_DESK_0013_D3 then
				PutObject("bua1",true)
				SetMarker("bua1",2,0)
			end
		elseif OPEN_DESK_0013_D3 then
			AnimationSetToStart("btan",true)
			SetMarker("btan", 4, 0)
		end

	end
end

function OnWarpLeave()
end

function OnDialogFinished(dialogName)
	if dialogName == "Ma1706" then
		SetMarker("btan",4,0)
	end

end

function OnAnimationFinished(AnimName) 
	if AnimName == "btan" and not PAPER_DESK_0013_D3 and not OPEN_DESK_0013_D3 then 
		PutObject("bua1",true)
		SetMarker("bua1",2,0)
	end
		
end

function OnWarpObjectHit(objectName)

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

	if ETAT_DAY == "D3" then 
		if objectName == "bja1" then
			if not PHIAL_AMBERGRIS_TAKEN then
				RemoveObject("bja1")
				SetMarker("bja1",-1,0)
				AddToBag("A_fiole")

				PHIAL_AMBERGRIS_TAKEN = true
			end


		elseif objectName == "boan" then

		elseif objectName == "btan" then
			DrawText("Ma1706","Ma1706.ogg",0) -- C'est fermé à clef.
			SetMarker("btan",-1,0)
		elseif objectName == "bua1" then
			RemoveObject("bua1")
			SetMarker("bua1",-1,0)
			AddToBag("A_theme_Henri_Navarre")
			PAPER_DESK_0013_D3 = true
		elseif objectName == "btan" then

		elseif objectName == "bva1" then

		end
	end 

	if ETAT_DAY == "D4" then 

		if objectName == "btan" then 
			if not OPEN_DESK_0013_D3 then
				StartAnimationPart("btan",0,2,1,true)
				OPEN_DESK_0013_D3 = true
				PlaySound("Sounds/SFX/N_FermetureTiroir.ogg",1)
					if not PAPER_DESK_0013_D3 then
						RemoveObject("bua1")
						SetMarker("bua1",-1,0)
					end
			elseif OPEN_DESK_0013_D3 then
				StartAnimationPart("btan",2,4,1,true)
				OPEN_DESK_0013_D3 = false
				PlaySound("Sounds/SFX/N_FermetureTiroir.ogg",1)
			end
		end

	end 
end
