ALBANY — A deal to combat heroin and opioid addiction that has ravaged the state was struck Tuesday after months of negotiations and heartrending stories from parents who lost children to drug abuse.

“Every day lives are being lost and families destroyed by the scourge of heroin and opioid abuse,” said Senate Majority Leader John Flanagan (R-East Northport).

The deal came in the waning days of the legislative session, which is scheduled to end late Thursday night. Both the Senate and Assembly will still have to pass legislation for the heroin bill to become law.

Meanwhile Tuesday, flanked by former NFL quarterbacks Vinny Testaverde of the New York Jets and Jim Kelly of the Buffalo Bills, key state legislators predicted New York would legalize daily fantasy sports, even if Gov. Andrew M. Cuomo has some objections.

“This will happen,” said Assemb. James Gary Pretlow (D-Mount Vernon), sponsor of the bill in the Assembly.

The heroin/opioid bill will limit opioid prescriptions to a seven-day supply, rather than the current 30-day supply; require more education for health care professionals who prescribe the addictive drugs; and make it easier for addicts and their families to get health insurance coverage for addiction recovery programs.

advertisement | advertise on newsday

The measure will require insurance companies to cover opioid overdose-reversal medication, which revives people from overdoses of heroin and opioids. The drug called naloxone has already saved thousands of lives, Cuomo said.

The agreement also requires insurers to cover inpatient treatment for substance abuse disorders as long as a patient needs it and delays any disputes over care by insurance companies for at least two weeks. The state budget is providing $160 million to fund the new initiatives.

Hospitals also will be required to provide follow-up treatments for addicted patients after they are discharged.

“As front-line workers in this epidemic, hospital workers see the very real consequences of opioid addition every day,” said Melissa Mansfield, spokeswoman for the Healthcare Association of New York State. The measures “will help hospitals ensure that patients receive the appropriate information and services.”

On the fantasy sports legislation, Sen. John Bonacic (R-Mount Hope) said there were “technical” hang-ups on how to legally define the games and what fees to charge companies to operate in New York. But otherwise, he said he expected the legislature to vote on the issue Thursday.

Testaverde and Kelly, making a paid appearance for the fantasy sports industry, vouched for fantasy sports as a “game of skill,” rather than a game of chance, which would make it illegal gambling. They said the game brought together families and friends and was good for the restaurant and tavern business during football season.

Assembly Speaker Carl Heastie cautioned that it wasn’t clear that lawmakers would OK daily fantasy sports. “We’re still trying to measure whether there are enough votes to do it,” Heastie (D-Bronx) said.

With Yancey Roy