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

	if not O_lantern_055 then
		-- lanterne
		PutObject("emc1")
	end

	if Ph_Key_051 and not OpenCloset_058 then
		AnimationSetToStart("fbc1",false)
	else
		AnimationSetToEnd("fbc1",false)
	end

	if OpenCloset_058 and not O_SmallPacket_058 then
		-- chute de l'objet de l'armoire
		AnimationSetToEnd("fdc1",true)
	end

       if CanGoTo051 then
		-- porte chapelle
		AnimationSetToEnd("elc1",false)
		if ETAT_DAY == "D2" and not SheetMoved_051 then
			-- corps dans la chapelle
			AnimationSetToStart("eqc1",false)
		elseif ETAT_DAY == "D2" and SheetMoved_051 then
			-- corps dans la chapelle
			AnimationSetToEnd("eqc1",false)
		end
	else
		-- porte chapelle
		AnimationSetToStart("elc1",false)
	end

	if ETAT_DAY == "D3" then 
		if JEAN_AT_LIBRARY_0055_D3 then
			StartAnimationPart("ehc1",0,10,-1,false)
		end
		if MONK_AT_LIBRARY_0056_D3 then
			StartAnimationPart("evc1",0,20,-1,true)
			SetMarker("evc1",4,0)
		end
		if OPEND_DESK_0058_D3 then
			AnimationSetToEnd("fbc1",false)
		else
			AnimationSetToStart("fbc1",false)
		end
		--AnimationSetToStart("elc1",false)
	end 
	if ETAT_DAY == "D4" then 
		if OPEND_DESK_0058_D3 then
			AnimationSetToEnd("fbc1",false)
		else
			AnimationSetToStart("fbc1",false)
		end
		if JEAN_AT_LIBRARY_D4 then
			StartAnimationPart("ehc1",0,10,-1,false)
		end
		if ESCAPE_FROM_CHAVIGNY then
		end
	end
end

function OnDialogFinished(dialogName)
	if ETAT_DAY == "D3" then
		if dialogName == "Sc2203" or dialogName == "Sc2206" or dialogName == "Sc2211" or dialogName == "Sc2213" or dialogName == "Sc2217" or dialogName == "Sc2219" then
			StartAnimationPart("evc1",0,20,-1,false)
		end
		if dialogName == "Sc2215" and not MONK_ADVERTISED_MADELEINE_0056 then
			StartAnimationPart("evc1",0,20,-1,false)
		end
		if dialogName == "Ma2201" or dialogName == "Ma2204" then
			StartAnimationPart("evc1",60,80,-1,false)
		end
		if dialogName == "Ce2210" or dialogName == "Ce2212" or dialogName == "Ce2214" or dialogName == "Ce2216" or dialogName == "Ce2218" or dialogName == "Ce2220" then
			StartAnimationPart("evc1",60,80,-1,false)
		end
		if dialogName == "Sc2206" or dialogName == "Ma2209" or dialogName == "Ma2216" or dialogName == "Ce2220" then
			SetMarker("evc1",4,0)
		end
		if dialogName == "Sc2215" and not MONK_ADVERTISED_MADELEINE_0056 then
			SetMarker("evc1",4,0)
		end
	end
end



function OnWarpLeave()
end

function OnWarpObjectHit(objectName)

	if objectName == "3D\\cs\\Warp_0058.wp" then 
		if HIDDEN_ROOM_LIGHTENED then
			ChangeWarp("3D\\cs\\Warp_0158.wp")
		else
			ChangeWarp(objectName)
		end
	end

	if objectName == "3D\\cs\\Warp_0055.wp" then 
		if not JEAN_AT_LIBRARY_D4 then
			ChangeWarp(objectName)
		elseif JEAN_AT_LIBRARY_D4 and not ESCAPE_FROM_CHAVIGNY then
			DrawText("Ma2656","Ma2656.ogg",0) -- Il est préférable d'en rester là pour le moment. Si c'est bien lui le meurtrier, j'ai intérêt à ne pas m'attarder en sa compagnie.
		else
			DrawText("Ma2788","Ma2788.ogg",0) -- Pas maintenant. Chavigny n'a pas besoin de connaître l'existence de cette pièce.
		end
	end

	if ETAT_DAY == "D3" then 
		if objectName == "emc1" then

		elseif objectName == "evc1" then
			SetMarker("evc1",-1,0)
			if DRESS_MADELEINE then
				if not MONK_ADVERTISED_MADELEINE_0056 then
					MONK_ADVERTISED_MADELEINE_0056 = true
					DrawText("Ma2201","Ma2201.ogg",0)
					DrawText("Sc2203","Sc2203.ogg",4)
					DrawText("Ma2204","Ma2204.ogg",0)
					DrawText("Sc2205","Sc2205.ogg",4)
					DrawText("Sc2206","Sc2206.ogg",4)
				else
					DrawText("Ma2209","Ma2209.ogg",0)
				end
			elseif DRESS_CESAR then
			   if not CESAR_TALKED_MONK_AT_LIBRARY_D3 then
				DrawText("Ce2210","Ce2210.ogg",1)
				DrawText("Sc2211","Sc2211.ogg",4)
				DrawText("Ce2212","Ce2212.ogg",1)
				DrawText("Sc2213","Sc2213.ogg",4)
				DrawText("Ce2214","Ce2214.ogg",1)
				DrawText("Sc2215","Sc2215.ogg",4)
				if  MONK_ADVERTISED_MADELEINE_0056 then
					DrawText("Sc2217","Sc2217.ogg",4)
					DrawText("Ce2218","Ce2218.ogg",1)
					DrawText("Sc2219","Sc2219.ogg",4)
					DrawText("Ce2220","Ce2220.ogg",1)
				end
			   else
					DrawText("Ma2216","Ma2216.ogg",0)
			   end
			end

		end
	end
end
