function OnWarpEnter()
	PlaySound("Sounds/SFX/A_TempleU.ogg",-1)	
	SetMarker("Pi Ramses\\Temple U\\Warp_0002.wp",0,0)
	SetMarker("Pi Ramses\\Temple U\\Warp_0006.wp",0,0)
	Captured = false
	if MAYA_BETRAYED then
		StartAnimationPart("O2U1",60,120,-1,true)
		if PaintGuard=="painting" or PaintGuard=="standing" then
			LookAt(253,011)
			StartAnimationPart("Q1U1",140,170,1,true)
		elseif RestGuard=="awake" then
			LookAt(096,014)
			StartAnimationPart("Q3U1",130,160,1,true)
		else
			Wait(2000)
			StartAnimationPart("Q3U1",0,40,-1,true)
			StartAnimationPart("Q1U1",40,90,-1,true)
		end
		StartAnimationPart("Q2U1",130,300,1,true)
		PaintGuard2 = "going"
	end
end


function OnWaitFinished()
	StartAnimationPart("Q3U1",0,40,-1,true)
	StartAnimationPart("Q1U1",60,120,1,true)
end

function OnDialogFinished(dialogName)
	if dialogName=="FIGA1348" or dialogName=="FIGB1349" then
		ChangeWarp("3D\\Pi Ramses\\Temple U\\Warp_0006.wp")
	end
end

function OnAnimationFinished(objectName)
	if objectName=="Q1U1" then
		if PaintGuard=="painting"  or PaintGuard=="stangind" then
			if not Captured then
				StartAnimationPart("Q1U1",181,200,-1,true)
				DrawText("FIGA1348","FIGA1348.ogg") -- Captured
				Captured = true
			end
		else
			LookAt(253,011)
			StartAnimationPart("Q1U1",131,180,1,true)
			PaintGuard="painting"
		end
	elseif objectName=="Q2U1" then
		if PaintGuard2=="going"  then
			StartAnimationPart("Q2U1",0,40,1,true)
			paintGuard="painting"
		else
			StartAnimationPart("Q2U1",130,300,1,true)
			paintGuard="going"
		end
	elseif objectName=="Q3U1" then
		if   RestGuard=="awake"  and not Captured then
			StartAnimationPart("Q3U1",190,240,-1,true)
		         DrawText("FIGB1349","FIGB1349.ogg") -- Captured
			Captured = true
		else
			StartAnimationPart("Q3U1",130,160,1,true)
			RestGuard="awake"
		end
	end
end

function OnWarpLeave()
end

function OnWarpObjectHit(objectName)
	if objectName == "D3T1" then

------------------------------------------------------------
	elseif objectName == "LAT1" then

------------------------------------------------------------
	elseif objectName == "LBT1" then

------------------------------------------------------------
	elseif objectName == "LCT1" then

------------------------------------------------------------
	elseif objectName == "O7T1" then

------------------------------------------------------------
	elseif objectName == "Q4T1" then
	end
	if objectName=="3D\\Pi Ramses\\Temple U\\Warp_0002.wp" then
		ChangeWarp(objectName)
        end
	if objectName=="3D\\Pi Ramses\\Temple U\\Warp_0006.wp" then
		ChangeWarp(objectName)
      end
end
