Consider this scenario. A sorcerer climbs up a 20 foot tree and gets surprised by a large snake. The snake misses and then the sorcerer wins initiative and decides to let go of the tree branches. This results in the sorcerer falling to the ground and taking damage.
Does the snake get an opportunity attack?