There are several different ways to treat post-surgical pain. An epidural catheter is most often used for pregnancy but it can also be used to give short term pain relief after knee surgery using opiods. Nerve blocks are also sometimes used. Locally injected anesthetics can provide short term pain relief.
For drugs there are a host of opiod analgesics that can be used. All can be habit forming if abused but there is very little risk of that in the short term if they're used as prescribed. Be sure to tell your doctor of your past experiences and find something - there are alot of pain options available.
For a list of opiod analgesics see below
http://www.webmd.com/pain-management/opioid-analgesics-for-chronic-pain
Good luck with the surgery!