Fetching details from the dictionary...
actio libera in causa; manufacturing the conditions of one's own defence (e.g. getting drunk in order to commit a crime)