Cruises, drugs, and gambling

Out of pure curiosity, I was wondering…
Most cruises have gambling on them, when they port in some location that does not allow gambling, do they have to close up shop?

Are you allowed to purchase alcohol 24 hours a day as soon as you are in international waters, and how far from land are international waters?

Could you just pop out the ole’ crack pipe and light it up in public, assuming you are in international waters?

I assume they have medical personel on board as well, does that mean you can pretty much request refills and medications without the use of a prescription?

Please enlighten or provide links, thanks

I don’t know about drugs and alcohol, but when I to a cruise from Vancouver to Anchorage, the casino was only open when the ship was in international waters. Since a fair amount of money was spent there, I’d assume there was a legal reason (either no gambling allowed, or allowed only with special permits that they didn’t have) for shutting it down when in territorial waters.