The episode begins with the aftermath of the events of "Sandcastles in the Sand": Barney and Robin are in bed together after having sex and they agree to pretend it never happened.
Allegedly written by Barnabas Stinson in the 18th century, the Bro Code proves to be a very tight document that Ted has followed flawlessly and Barney fails in finding a loophole.
When Marshall's nervous behavior reveals to Robin that Barney told him, she warns him never to let Ted find out.
That night, when Barney picks up Ted in a limo, he attempts to give Ted an ultimate 30th birthday by flying him to Las Vegas, which includes staying at the Bellagio, steaks at Boa, and a boxing match between Floyd Mayweather and a grizzly bear.
Lily plans to give the goat away to animal control, but becomes attached to her while waiting for Ted to arrive at his birthday party.