local i = 1

while i <= table.getn(portshrine) do
	if triggeredCellEventId() == teleports[i] then
		local triggering= triggeredEventAreaEntryUnitId()
		if triggering >= 0 and units[triggering].isHero == 1 and isFreeCells(3, 0,{portshrine[portshrine[i][5]][1]+2,portshrine[portshrine[i][5]][2]+2}) == 1 then
			givePositionCommand(triggering,'move',{portshrine[portshrine[i][5]][1]+2,portshrine[portshrine[i][5]][2]+2})
			setUnitPosition(triggering,{portshrine[portshrine[i][5]][1]+2,portshrine[portshrine[i][5]][2]+2})
			networkSetCameraPositionForFaction(unitFaction(triggering),{portshrine[portshrine[i][5]][1]+2,portshrine[portshrine[i][5]][2]+2})
		end
	end
	i = i + 1
end

