function OnDressChanged()
	RemoveObject("gpc1")
	RemoveObject("gqc1")
	RemoveObject("grc1")	
	if DRESS_MADELEINE then
		-- reflet Madeleine
		PutObject("gpc1")
	elseif DRESS_CESAR then
		-- reflet César
		PutObject("gqc1")
	elseif DRESS_MONK then
		-- reflet Madeleine en moine
		PutObject("grc1")
	end
end
function OnWarpEnter() 
	SetMarker("cs\\Warp_0064.wp" , 0 , 0) 
	SetMarker("cs\\Warp_0061.wp" , 0 , 0) 

	BlockingGuard = false

	if DRESS_MADELEINE then
		-- reflet Madeleine
		PutObject("gpc1")
	elseif DRESS_CESAR then
		-- reflet César
		PutObject("gqc1")
	elseif DRESS_MONK then
		-- reflet Madeleine en moine
		PutObject("grc1")
	end

	if not GUARD_QUEEN_ROOM_D5 then
		StartAnimationPart("fxc1",10,40,-1,false)
		PutObject("ubc1")
		SetMarker("fxc1",4,0)
	end

	if ETAT_DAY == "D4" then 
		if CAN_ENTER_QUEEN_ROOM_D4 then
			NotExpectedW63 = false
		end		
	end 

	if ETAT_DAY == "D5" and not GUARD_QUEEN_ROOM_D5 then 
		StartAnimationPart("fxc1",10,40,-1,false)
	end 

end

function AskSeparation()
end

function OnAnswered(textId)
end


function OnDialogFinished(dialogName)

	if dialogName == "G12227" and NotExpectedW63 and AnimationGuard then
		StartAnimationPart("fxc1",10,40,1,false)
		AnimationGuard = false
		GuardOnPlace = true
	end
	if dialogName == "Ma1087" or dialogName == "G12251" then
		SetMarker("fxc1",4,0)
	end

	if ETAT_DAY == "D4" then
		if dialogName == "G12232" then
			StartAnimationPart("fxc1",10,40,-1,false)
			SetMarker("fxc1",4,0)
			SetMarker("cs\\Warp_0061.wp" , 0 , 0) 
--			CAN_ENTER_QUEEN_ROOM_D4 = true
		end
		if dialogName == "Ce2254" or dialogName == "Ma2224" then
			StartAnimationPart("fxc1",40,70,-1,false)
		end
		if dialogName == "G12226" then
			StartAnimationPart("fxc1",10,40,-1,false)
			SetMarker("fxc1",4,0)
			SetMarker("cs\\Warp_0061.wp" , 0 , 0) 
		end
		
	end
	if ETAT_DAY == "D5" then
		if dialogName == "G12226" then
			StartAnimationPart("fxc1",10,40,-1,false)
			SetMarker("fxc1",4,0)
			SetMarker("cs\\Warp_0061.wp" , 0 , 0) 
		end
		if dialogName == "Ce2254" or dialogName == "Ma2224" then
			StartAnimationPart("fxc1",40,70,-1,false)
		end
		if dialogName == "G12232" then
			StartAnimationPart("fxc1",10,40,-1,false)
			SetMarker("fxc1",4,0)
			SetMarker("cs\\Warp_0061.wp" , 0 , 0) 
		end
	end
end

function OnAnimationFinished(objectName)
	if objectName == "fxc1" then
		if GUARD_GOES then
			StartAnimationPart("fxc1",40,70,1,false)
			DrawText("G12226","G12226.ogg",7)
			GUARD_GOES = false
		elseif NotExpectedW63 and BlockingGuard then
			StartAnimationPart("fxc1",40,70,1,false)
			DrawText("G12227","G12227.ogg",7) -- Vous n'êtes pas attendue, je ne peux pas vous laisser entrer.
			BlockingGuard = false
			AnimationGuard = true
		elseif NotExpectedW63 and GuardOnPlace then
			StartAnimationPart("fxc1",10,40,-1,false)
			SetMarker("fxc1",4,0)
			SetMarker("cs\\Warp_0061.wp" , 0 , 0) 		
		end
	end
end

function OnWarpLeave()
end

function OnWarpObjectHit(objectName)

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

	if objectName == "3D\\cs\\Warp_0061.wp" then 
		if ETAT_DAY == "D4" and CAN_ENTER_QUEEN_ROOM_D4 then
			ChangeWarp("3D\\cs\\Warp_0060.wp")
		elseif ETAT_DAY == "D5" and GUARD_QUEEN_ROOM_D5 then -- no guard
--				[[StartAnimationPart("fxc1",120,150,1,false)
--				SetMarker("fxc1",-1,0)
--				 GUARD_GOES = true]]
				 if DRESS_MONK then
					ChangeWarp("3D\\cs\\Warp_0062.wp")
				 else
					DrawText("Ma2914","Ma2914.ogg",0) -- find a way to move around in the castle without drawing too much attention on me
				 end
		elseif NotExpectedW63 then
			if DRESS_CESAR then
				if not CAN_ENTER_QUEEN_ROOM_D4 then
					DrawText("Ce2254","Ce2254.ogg",1) -- Je viens voir Sa Majesté Catherine de Médicis.
					DrawText("G12226","G12226.ogg",7) -- Impossible, Sa Majesté ne reçoit personne.
				else
					DrawText("Ce2254","Ce2254.ogg",1) -- Je viens voir Sa Majesté Catherine de Médicis.
					DrawText("G12232","G12232.ogg",7) -- Entrez, Sa Majesté veut bien vous recevoir.
				end
			else
				DrawText("Ma1087","Ma1087.ogg",0) -- Non, j'ai quelque chose à faire avant...
			end
		end
	end

--DAY4
	if ETAT_DAY == "D4" then 
		if objectName == "gpc1" then

		elseif objectName == "fxc1" then
			SetMarker("fxc1",-1,0)
			if DRESS_CESAR then
				if not CAN_ENTER_QUEEN_ROOM_D4 then
					DrawText("Ce2254","Ce2254.ogg",1) -- Je viens voir Sa Majesté Catherine de Médicis.
					DrawText("G12226","G12226.ogg",7) -- Impossible, Sa Majesté ne reçoit personne.
				else
					DrawText("Ce2254","Ce2254.ogg",1) -- Je viens voir Sa Majesté Catherine de Médicis.
					DrawText("G12232","G12232.ogg",7) -- Entrez, Sa Majesté veut bien vous recevoir.
				end
			else
				DrawText("Ma1087","Ma1087.ogg",0) -- Non, j'ai quelque chose à faire avant...
			end

		end
	end 

-- DAY5
	if ETAT_DAY == "D5" then 
		if objectName == "gpc1" then

		elseif objectName == "fxc1" then
			SetMarker("fxc1",-1,0)
			if DRESS_CESAR then
				if not CAN_ENTER_QUEEN_ROOM_D5 then
					DrawText("Ce2254","Ce2254.ogg",1) -- Je viens voir Sa Majesté Catherine de Médicis.
					DrawText("G12226","G12226.ogg",7) -- Impossible, Sa Majesté ne reçoit personne.
				else
					DrawText("Ce2254","Ce2254.ogg",1) -- Je viens voir Sa Majesté Catherine de Médicis.
					DrawText("G12232","G12232.ogg",7) -- Entrez, Sa Majesté veut bien vous recevoir.
				end
			else
				DrawText("Ma1087","Ma1087.ogg",0) -- Non, j'ai quelque chose à faire avant...
			end
		end
	end 
end
