World champion Judd Trump benefited from a huge slice of luck on his way to a century against David Gilbert.