function OnWarpEnter()
	
	if not UsedBee_os_002 then
		SetMarker("BEE",4,0)
		StartAnimationPart("GSG1",0,15,-1,true)
	elseif not BeeSolved_os_002 then
		SetMarker("H1G1",1,0)
		SetMarker("H2G1",1,0)
		SetMarker("H3G1",1,0)
		SetMarker("H4G1",1,0)
		SetMarker("H5G1",1,0)
		SetMarker("H6G1",1,0)
		StartAnimationPart("GSG1",0,15,-1,true)
	end
	
	SetMarker("Osiris\\Warp_0001.wp",0,0)
	if BeeSolved_os_002 then
		SetMarker("Osiris\\Warp_0005.wp",0,0)
	end

	if not BeenIn_os_002 then
		DrawText("LMOR1152","LMOR1152.ogg")
		BeenIn_os_002=true
	end
	
	Current_os_002="1"
	if UsedBee_os_002 then
		Feet_os_002="AAG1"
		Body_os_002="AAG1"
		Head_os_002="AAG1"
	end

	--Buttons
	StartAnimationPart("H1G1",0,1,-1,true)
	StartAnimationPart("H2G1",0,1,-1,true)
	StartAnimationPart("H3G1",0,1,-1,true)
	StartAnimationPart("H4G1",0,1,-1,true)
	StartAnimationPart("H5G1",0,1,-1,true)
	StartAnimationPart("H6G1",0,1,-1,true)
end

function OnWarpLeave()
end

function OnDialogFinished(dialogId)
end

function OnAnimationFinished(objectName)
	if objectName == "H1G1" then
		StartAnimationPart("H1G1",0,1,-1,true)
	elseif objectName == "H2G1" then
		StartAnimationPart("H2G1",0,1,-1,true)
	elseif objectName == "H3G1" then 
		StartAnimationPart("H3G1",0,1,-1,true)
	elseif objectName == "H4G1" then 
		StartAnimationPart("H4G1",0,1,-1,true)
	elseif objectName == "H5G1" then 
		StartAnimationPart("H5G1",0,1,-1,true)
	elseif objectName == "H6G1" then
		StartAnimationPart("H6G1",0,1,-1,true)
	elseif objectName == "GSG1" then
		AnimationSetToEnd("GSG1", false)
	end
end

function OnWarpObjectHit(objectName)

	if Current_os_002 == "1" then
		if Feet_os_002 == "AAG1" then
			AnimationSetToStart("AAG1", false)
		elseif Feet_os_002 == "BAG1" then
			AnimationSetToStart("BAG1", false)
		elseif Feet_os_002 == "CAG1" then
			AnimationSetToStart("CAG1", false)
		elseif Feet_os_002 == "DAG1" then
			AnimationSetToStart("DAG1", false)
		elseif Feet_os_002 == "EAG1" then
			AnimationSetToStart("EAG1", false)
		elseif Feet_os_002 == "FAG1" then
			AnimationSetToStart("FAG1", false)
		end

		
		if Body_os_002 == "ABG1" then
			AnimationSetToStart("ABG1", false)
		elseif Body_os_002=="BBG1" then
			AnimationSetToStart("BBG1", false)
		elseif Body_os_002=="CBG1" then
			AnimationSetToStart("CBG1", false)
		elseif Body_os_002=="DBG1" then
			AnimationSetToStart("DBG1", false)
		elseif Body_os_002=="EBG1" then
			AnimationSetToStart("EBG1", false)
		elseif Body_os_002=="FBG1" then
			AnimationSetToStart("FBG1", false)
		end
		

		if Head_os_002 == "ACG1" then
			AnimationSetToStart("ACG1", false)
		elseif Head_os_002=="BCG1" then
			AnimationSetToStart("BCG1", false)
		elseif Head_os_002=="CCG1" then
			AnimationSetToStart("CCG1", false)
		elseif Head_os_002=="DCG1" then
			AnimationSetToStart("DCG1", false)
		elseif Head_os_002=="ECG1" then
			AnimationSetToStart("ECG1", false)
		elseif Head_os_002=="FCG1" then
			AnimationSetToStart("FCG1", false)
		end
	end

------------------------------------------------------------
	if objectName == "AAG1" then

------------------------------------------------------------
	elseif objectName == "ABG1" then

------------------------------------------------------------
	elseif objectName == "ACG1" then

------------------------------------------------------------
	elseif objectName == "BAG1" then

------------------------------------------------------------
	elseif objectName == "BBG1" then

------------------------------------------------------------
	elseif objectName == "BCG1" then

------------------------------------------------------------
	elseif objectName == "CAG1" then

------------------------------------------------------------
	elseif objectName == "CBG1" then

------------------------------------------------------------
	elseif objectName == "CCG1" then

------------------------------------------------------------
	elseif objectName == "DAG1" then

------------------------------------------------------------
	elseif objectName == "DBG1" then

------------------------------------------------------------
	elseif objectName == "DCG1" then

------------------------------------------------------------
	elseif objectName == "EAG1" then

------------------------------------------------------------
	elseif objectName == "EBG1" then
 
------------------------------------------------------------
	elseif objectName == "ECG1" then

------------------------------------------------------------
	elseif objectName == "FAG1" then

------------------------------------------------------------
	elseif objectName == "FBG1" then

------------------------------------------------------------
	elseif objectName == "FCG1" then

------------------------------------------------------------
	elseif objectName == "GSG1" then

------------------------------------------------------------
	elseif objectName == "H1G1" then
	    if UsedBee_os_002 then
			StartAnimationPart("H1G1",0,9,1,true)
			DrawText("MAIA1154","MAIA1154.ogg")
			if Current_os_002=="1" then
				Feet_os_002="AAG1"
				StartAnimationPart("AAG1",0,8,1,true)
			elseif Current_os_002=="2" then
				Body_os_002="ABG1"
				StartAnimationPart("ABG1",0,8,1,true)
			elseif Current_os_002=="3" then
				Head_os_002="ACG1"
				StartAnimationPart("ACG1",0,8,1,true)
			end
		end
------------------------------------------------------------
	elseif objectName == "H2G1" then
	    if UsedBee_os_002 then
			StartAnimationPart("H2G1",0,9,1,true)
			DrawText("MAIA1155","MAIA1155.ogg")
			if Current_os_002=="1" then
				Feet_os_002="BAG1"
				StartAnimationPart("BAG1",0,8,1,true)
			elseif Current_os_002=="2" then
				Body_os_002="BBG1"
				StartAnimationPart("BBG1",0,8,1,true)
			elseif Current_os_002=="3" then
				Head_os_002="BCG1"
				StartAnimationPart("BCG1",0,8,1,true)
			end
		end

------------------------------------------------------------
	elseif objectName == "H3G1" then
	    if UsedBee_os_002 then
			StartAnimationPart("H3G1",0,9,1,true)
			DrawText("MAIA1156","MAIA1156.ogg")
			if Current_os_002=="1" then
				Feet_os_002="CAG1"
				StartAnimationPart("CAG1",0,8,1,true)
			elseif Current_os_002=="2" then
				Body_os_002="CBG1"
				StartAnimationPart("CBG1",0,8,1,true)
			elseif Current_os_002=="3" then
				Head_os_002="CCG1"
				StartAnimationPart("CCG1",0,8,1,true)
			end
		end

------------------------------------------------------------
	elseif objectName == "H4G1" then
		if UsedBee_os_002 then
			StartAnimationPart("H4G1",0,9,1,true)
			DrawText("MAIA1157","MAIA1157.ogg")
			if Current_os_002=="1" then
				Feet_os_002="FAG1"
				StartAnimationPart("FAG1",0,8,1,true)
			elseif Current_os_002=="2" then
				Body_os_002="FBG1"
				StartAnimationPart("FBG1",0,8,1,true)
			elseif Current_os_002=="3" then
				Head_os_002="FCG1"
				StartAnimationPart("FCG1",0,8,1,true)
			end
		end

------------------------------------------------------------
	elseif objectName == "H5G1" then
		if UsedBee_os_002 then
			StartAnimationPart("H5G1",0,9,1,true)
			DrawText("MAIA1158","MAIA1158.ogg")
			if Current_os_002=="1" then
				Feet_os_002="EAG1"
				StartAnimationPart("EAG1",0,8,1,true)
			elseif Current_os_002=="2" then
				Body_os_002="EBG1"
				StartAnimationPart("EBG1",0,8,1,true)
			elseif Current_os_002=="3" then
				Head_os_002="ECG1"
				StartAnimationPart("ECG1",0,8,1,true)
			end
		end

------------------------------------------------------------
	elseif objectName == "H6G1" then
		if UsedBee_os_002 then
			StartAnimationPart("H6G1",0,9,1,true)
			DrawText("MAIA1159","MAIA1159.ogg")
			if Current_os_002=="1" then
				Feet_os_002="DAG1"
				StartAnimationPart("DAG1",0,8,1,true)
			elseif Current_os_002=="2" then
				Body_os_002="DBG1"
				StartAnimationPart("DBG1",0,8,1,true)
			elseif Current_os_002=="3" then
				Head_os_002="DCG1"
				StartAnimationPart("DCG1",0,8,1,true)
			end
		end
	end

	if Current_os_002=="3" and Feet_os_002=="AAG1" and Body_os_002=="DBG1" and Head_os_002=="FCG1" then
		BeeSolved_os_002=true
		PrintDebugMessage("GANE!\n")
		LookAt(179,356)
		DrawText("MAIA1220","MAIA1220.ogg")
		DrawText("LMOR1160","LMOR1160.ogg")
		SetMarker("Osiris\\Warp_0005.wp",0,0)
		StartAnimationPart("GSG1",15,90,1,true)
		SetMarker("H1G1",-1,0)
		SetMarker("H2G1",-1,0)
		SetMarker("H3G1",-1,0)
		SetMarker("H4G1",-1,0)
		SetMarker("H5G1",-1,0)
		SetMarker("H6G1",-1,0)
	end 

	if objectName ~="3D\\BEE" then
		if Current_os_002=="1" then
			PrintDebugMessage("uno\n")
			Current_os_002="2"
		elseif Current_os_002=="2" then
			PrintDebugMessage("dos\n")
			Current_os_002="3"
		elseif Current_os_002=="3" then
			PrintDebugMessage("tres\n")
			Current_os_002="1"
		end
	end

	if objectName=="3D\\BEE" and not UsedBee_os_002 then
		if Selected("j_abeille") then
			Current_os_002="1"
			DrawText("MAIA1153","MAIA1153.ogg")
			UsedBee_os_002=true
			Feet_os_002="AAG1"
			Body_os_002="AAG1"
			Head_os_002="AAG1"
			SetMarker("H1G1",1,0)
			SetMarker("H2G1",1,0)
			SetMarker("H3G1",1,0)
			SetMarker("H4G1",1,0)
			SetMarker("H5G1",1,0)
			SetMarker("H6G1",1,0)
			SetMarker("BEE",-1,0)
		else
			DrawText("MAIA1226","MAIA1226.ogg")
		end
	end

	if objectName=="3D\\Osiris\\Warp_0001.wp" then
		ChangeWarp(objectName)
    end
	if objectName=="3D\\Osiris\\Warp_0005.wp" then
	   if BeeSolved_os_002 then
		ChangeWarp(objectName)
	   end
    end
end
