Question: Who prepared for an invasion by a king who had Earl Skule Bårdsson as a rival?

full_context: Document 1: Forres Castle: Forres Castle was a fort and castle built near Forres, Scotland. The fort was destroyed in 850 by Vikings. Forres was created a royal burgh by King David I of Scotland in 1140. The castle, once a royal castle, was built as a motte and bailey castle and was strengthened in the 14th century. It was demolished in 1297 by the adherents of Wallace. King William the Lion and King Alexander II of Scotland visited and stayed at the castle. King David II of Scotland stayed at the castle in 1346. It was burned by Alexander Stewart, Earl of Buchan in 1390. Held by the Dunbars of Westfield until the 17th century, it fell into ruins. Nothing now remains above ground.
Document 2: Civil war era in Norway: The civil war era in Norway (Norwegian: "borgerkrigstiden") is the history of Norway between 1130 and 1240. During this time a series of civil wars were fought between rival kings and pretenders to the throne. The reasons for the war was the weak succession of King Sigurd the Crusader, leaving the country between his bastard son Magnus and his alleged (but uncertain) brother, Harald Gillekrist, who were on bad terms long before King Sigurd died. The goal of the warring parties was always to put their man on the throne, starting with the death of King Sigurd the Crusader in 1130, a supposedly adored monarch. In the first decades of the civil wars, alliances shifted and centered on the person of a king or pretender, but eventually, towards the end of the 12th century, two rival parties emerged, known as the Birkebeiner and the Bagler. After these two parties were reconciled in 1217, a more ordered system of government centered on the king was gradually able to bring an end to the frequent risings. The failed rising of duke Skule Bårdsson in 1240 was the final event of the civil war era.
Document 3: Inge II of Norway: Inge II (Norwegian: "Inge Bårdsson", Old Norse: "Ingi Bárðarson"; 1185 – 23 April 1217) was King of Norway from 1204 to 1217. His reign was within the later stages of the period known in Norwegian history as the age of civil wars. Inge was the king of the "birkebeiner" faction. The conclusion of the settlement of Kvitsøy with the "bagler" faction in 1208 led to peace for the last nine years of Inge’s reign, at the price of Inge and the "birkebeiner" recognising "bagler" rule over Viken (the Oslofjord area).
Document 4: Ruadhri of Bute: Ruadhri is an obscure 13th-century noble, who claimed the Isle of Bute through hereditary descent. Outlawed by King Alexander III of Scotland, because of attacks against Scottish lands, which he had undertaken as a result of him being denied his declared patrimony to the Isle of Bute through his hereditary right. When King Hakon IV of Norway began his 1263 expedition against Scotland, Ruadhri presented himself to Hakon and swore fealty to the King of Norway. He was allowed to participate in the attack on Bute, as part of the campaign, with Rothesay Castle surrendering. He took revenge on the garrison killing nine upon their retreat. He was granted the Isle of Bute by King Hakon, however he disappears from contemporary records shortly afterwards.
Document 5: Ardrossan Castle: Ardrossan Castle is situated on the west coast of Scotland in the town of Ardrossan, Ayrshire. The castle, defended by a moat, stands on a ridge above the town. There is a keep dating from the fifteenth century, and a vaulted range containing a kitchen and cellars. In a deep passageway there is a well. Part of the keep remains up to the corbels of the parapet, but it is in ruins. The original castle, owned by Clan Barclay, was partly destroyed during the Wars of Scottish Independence. This event, in which the English garrison were slaughtered, became known as "Wallace's Larder," a name which is still applied to the remaining vaults. Rebuilt by Clan Montgomery in the 15th century, Ardrossan later fell into disuse and was partially demolished by the soldiers of Oliver Cromwell in the 17th century who used the stones to help construct the Ayr Citadel.
Document 6: Haakon, Crown Prince of Norway: Haakon, Crown Prince of Norway (] ; Haakon Magnus; born 20 July 1973) is the only son and younger child of King Harald V and heir apparent to the throne of Norway.
Document 7: Castle of Rattray: The Castle of Rattray was a medieval Scottish castle, with multiple variations on its structure over approximately six centuries. Originally built as a ""late 12th- or early 13th century defensive motte"" it provided protection for Starny Keppie harbour and Rattray village. Sometime between 1214 and 1233 it was upgraded by William Comyn, jure uxoris Earl of Buchan before being destroyed in the 1308 Harrying of Buchan. After Comyn's timber castle was burned down it was replaced by a stronger stone castle which was engulfed during a 1720 sand storm along with nearby Rattray village. After the storm, the castle was not dug out and remains covered to this day. The castle was described by W. Douglas Simpson as one of the nine castles of the Knuckle, referring to the rocky headland of north-east Aberdeenshire.
Document 8: Dunvegan Castle: Dunvegan Castle is located 1 mi to the north of Dunvegan on the Isle of Skye, off the west coast of Scotland. It is the seat of the MacLeod of MacLeod, chief of the Clan MacLeod. Probably a fortified site from the earliest times, the castle was first built in the 13th century and developed piecemeal over the centuries. In the 19th century the whole was remodelled in a mock-medieval style. The castle is built on an elevated rock overlooking an inlet on the eastern shore of Loch Dunvegan, a sea loch.
Document 9: Skule Bårdsson: Skule Bårdsson or Duke Skule (Norwegian: Hertug Skule) (Old Norse: Skúli Bárðarson) (  1189 – 24 May 1240) was a Norwegian nobleman and claimant to the royal throne against his son-in-law, King Haakon Haakonsson. Henrik Ibsen's play "Kongs-Emnerne" (1863) is about the dispute between Duke Skule and King Haakon.
Document 10: Harald V of Norway: Harald V (] ; born 21 February 1937) is the King of Norway, having ascended the throne following the death of his father on 17 January 1991.
Document 11: New Slains Castle: Slains Castle, also known as New Slains Castle to distinguish it from nearby Old Slains Castle, is a ruined castle in Aberdeenshire, Scotland. It overlooks the North Sea from its cliff-top site 1 km east of Cruden Bay. The core of the castle is a 16th-century tower house, built by the 9th Earl of Erroll. Significant reconstruction of the castle has been carried out a number of times, lastly in 1837 when it was rebuilt as a Scots Baronial mansion. At one time it had three extensive gardens, but is now a roofless ruin. Plans to restore the castle have been on hold since 2009.
Document 12: Sigtryg Eysteinsson: Sigtryg Eysteinsson was king of the Norwegian petty kingdoms Raumarike and Hedmark in what is today south-eastern Norway. He was killed by Halfdan the Black ("Halvdan Svarte") in the middle of the 9th century. Halfdan the Black subdued the area by first defeating and killing Sigtryg in battle and then defeated Sigtryg's brother and successor Eystein Eysteinsson in a series of battles.
Document 13: Fetteresso Castle: Fetteresso Castle is a 14th-century towerhouse, rebuilt in 1761 as a Scottish gothic style Palladian manor, with clear evidence of prehistoric use of the site. It is situated immediately west of the town of Stonehaven in Kincardineshire slightly to the west of the A90 dual carriageway. Other notable historic fortified houses or castles in this region are Dunnottar Castle, Muchalls Castle, Fiddes Castle, Cowie Castle and Monboddo House.
Document 14: Findlater Castle: Findlater Castle is the old seat of the Earls of Findlater and Seafield, sitting on a 50 ft -high cliff overlooking the Moray Firth on the coast of Banff and Buchan, Aberdeenshire, Scotland. It lies about 15 km west of Banff, near the village of Sandend, between Cullen and Portsoy. The cliffs here contain quartz; the name "Findlater" is derived not from Norse as earlier stated here, but from the Scots Gaelic words "fionn" ("white") and "leitir" ("cliff or steep slope"). The first historical reference to the castle is from 1246. King Alexander III of Scotland repaired this castle in the 1260s in preparation for an invasion by King Haakon IV of Norway. The Vikings took and held the castle for some time. The castle remains that are still there are from the 14th-century rebuilding, when the castle was redesigned based on the Roslyn Castle model.
Document 15: Haakon IV of Norway: Haakon Haakonsson (c. March/April 1204 – 16 December 1263) (Old Norse: "Hákon Hákonarson"; Norwegian: "Håkon Håkonsson"), sometimes called Haakon the Old in contrast to his son with the same name, and known in modern regnal lists as Haakon IV, was the King of Norway from 1217 to 1263. His reign lasted for 46 years, longer than any Norwegian king since Harald I. Haakon was born into the troubled civil war era in Norway, but his reign eventually managed to put an end to the internal conflicts. At the start of his reign, during his minority, his later rival Earl Skule Bårdsson served as regent. As a king of the birkebeiner faction, Haakon defeated the uprising of the final bagler royal pretender, Sigurd Ribbung, in 1227. He put a definitive end to the civil war era when he had Skule Bårdsson killed in 1240, a year after he had himself proclaimed king in opposition to Haakon. Haakon thereafter formally appointed his own son as his co-regent.
ground_truth: King Alexander III of Scotland