In any prosecution for an offense, it is an affirmative defense that the defendant engaged in the proscribed conduct because he was induced or encouraged to do so by a public servant, or by a person acting in cooperation with a public servant, seeking to obtain evidence against him for purpose of criminal prosecution, and when the methods used to obtain such evidence were such as to create a substantial risk that the offense would be committed by a person not otherwise disposed to commit it. Inducement or encouragement to commit an offense means active inducement or encouragement. Conduct merely affording a person an opportunity to commit an offense does not constitute entrapment.