Opioid settlement to give $525M to state, communities