And it couldn't have been a worse time for Captain John Green to sail his vessel, the Worcester, up the Forth seeking sanctuary from a violent storm. Soon the English captain and his crew were under siege, accused of piracy and murder. What happened next was the most spectacular of Edinburgh's pirate trials, the result of a bizarre sequence of events and played out against a feverish background of wounded national pride.
Angus Konstam recalls the episode with a degree of glee – for there's nothing the Edinburgh-based international expert on all things to do with pirates likes more than a good swashbuckling yarn played out on home soil.
"The trial of the Worcester's crew was quite sensational at the time," explains Angus, whose new book claims to explode a catalogue of myths surrounding how we've come to view pirates. "It was probably the most famous of all Scottish pirate trials.
"The trouble was, the crew probably weren't pirates at all yet they certainly hanged as pirates."
Captain John Green, his chief mate John Madder and gunner John Simpson became victims not only of a nation's determination to offset its embarrassment and shame over the Darien Scheme's massive failings but an obsession with tales of high seas villainy and cut-throat piracy played out in exotic locations thousands of miles from Scottish shores. And they paid for it all with their lives.
It was 1704 and the Darien Scheme had collapsed – bankrupting the economy – after efforts to trade with natives in the Americas proved futile, disease spread, crops failed and pleas for help from nearby English colonies were ignored.
Worse, a ship belonging to the Company of Scotland had been seized by the East India Company amid claims it breached trading rules. When news spread that its crew had been forced to join the English Navy, Scots were furious. The arrival of Cpt Green's vessel was too much of a temptation to miss.
As it happened, a Scottish vessel, the Speedy Return, had recently gone missing at sea. Cpt Green and his crew were accused of attacking the ship, killing the crew and looting its cargo.
"The Scots were very upset with the English over the Darien Scheme," explains Angus. "So by the time the crew got to court, there wasn't much hope for them."
In March 1705, Green and his men were tried by the Admiralty Court in Edinburgh and found guilty of piracy and murder. Not even a plea from Queen Anne for a reprieve and the appearance of the Speedy Return's crew confirming their innocence could alter the outcome. They hanged on Leith sands in front of 80,000 people.
Pirate hangings provided a wealth of entertainment for locals, adds Angus. "One mass hanging was very popular," he adds. "A pirate ship had been operating in the Caribbean but ended up wrecked off the West Coast in 1718.
"The Captain got away but 21 of his crew were captured and taken to the dungeons at Edinburgh Castle. Some were too young or said they had been coerced, but the others were condemned by Lord Graham to be taken to the sands of Leith and hanged.
Court records and newspaper accounts of pirate trials like those proved vital for Angus's research for "Piracy: The Complete History". In it he debunks a string of pirate myths – even down to unmasking of none other than Blackbeard.
"Actually, Blackbeard was just a big pussy cat," grins Angus, of St Stephen's Street. "He had this big, bad reputation, but in fact he wasn't really all that terrible.
"He looked scary. He had a big beard and he'd glare at people a lot. He didn't kill anyone that we know of until his final fight in November 1718. And that ended with him having his head chopped off."
Angus also demolishes that other popular image of pirates – the notion that they made their terrified victims "walk the plank".
"They wouldn't waste time with planks," he shrugs. "It was quicker just to throw someone over the side."
As for buried treasure: "No, not really," he adds. "Most of the pirates' haul would have been the cargoes of the day – probably timber and tea, slaves and molasses."
Aberdeen-born Angus was raised in the Orkneys where he was captivated by tales of the sea. He went on to join the Navy and served as a diver between studying for degrees in archaeology and history and then a masters in maritime archaeology at St Andrews.
Eventually he became weapons curator at the Tower of London then headed to what he dubs "pirate central", Key West in Florida, to become curator of the Mel Fisher Maritime Heritage Society Museum. There he put together a pirate exhibition for the museum, fully igniting his interest.
Since moving to Edinburgh more than ten years ago, he has written more than 60 books, many related to piracy and seafaring history. But while piracy may sound like something from the past, it's just as much an issue these days, says Angus.
"There are a plenty of pirates out there today," agrees Angus. "The first quarter of this year has seen a 25 per cent increase in piracy attacks. The past couple of days alone there has been one in the Red Sea and one off the west of Africa.
"But these days they tend to be in little speed boats, wearing balaclavas and armed with an AK47.
"The bottom line is exactly the same: thieving and sometimes murder."
Piracy: The Complete History by Angus Konstam is published by Osprey Publishing price 17.99 (hardback). Angus Konstam is hosting two Edinburgh Book Festival writers' workshops, on August 18 and 21.
RESEARCH CHALLENGES THE POPULAR IMAGE
THE image of a pirate is typically one of a swashbuckling, bearded villain with a West Country accent and a parrot perched on his shoulder. The reality, says pirate expert Angus Konstam, was usually different.
"Pirates didn't necessarily speak with an "Oh argh, Jim lad," accent," he laughs. "Capt Kidd was from Greenock. There was a pirate from Orkney called Jim Gow who would have spoken with a typical Orkney accent.
"Not all were yobs either. Stede Bonnet was from a wealthy family in Barbados. He hired a crew and even bought his own boat. They were all still hanged at the end."
But, despite the myths, Angus admits a lot of popular images are based on fact.
"Ships' cooks did tend to be people who had a lost a leg, for example – simply because it meant they could no longer climb the rigging.
"And there was a lot of brutality around too."