Drugs firm to pay to settle claims it fuelled opioid painkiller addiction crisis in New York State.