Concept:
Opioid drugs share a common morphine-like skeleton. A small change at the nitrogen atom can flip the molecule from one that activates the receptor (agonist) to one that blocks it (antagonist).
Step 1: In morphine the nitrogen carries a small N-methyl (–CH3) group, which gives full agonist activity.
Step 2: If that N-methyl is swapped for a larger N-allyl (–CH2–CH=CH2) group, the drug still fits the receptor but no longer activates it. This is exactly how naloxone and nalorphine are made into antagonists.
Why the others are wrong: Changes at C3 (like the phenolic –OH or its methylation, as in codeine) mainly alter potency and how the drug is absorbed, not agonist-versus-antagonist behaviour. Reducing the 7,8-double bond gives dihydro analogues that are still agonists. The key switch is the N-substituent.
Answer: Option (2) — Replacement of N-methyl with N-allyl.