Officials: Militant Ambush Kills 18 in NW Pakistan