It was probably William, 3rd Thane of Cawdor, who decided to build a replacement castle on a less marshy site than its predecessor. The story goes that in about 1370 he set out to locate the site for a new castle. Following instructions received in a dream he loaded panniers of gold on the back of a donkey, which he then followed as it roamed across his lands for a day. When evening came the donkey lay to rest under a tree on a higher and more rocky site close to the steep-sided valley of the Allt Dearg. There William built his castle. What emerged was a four storey tower house of the sort being built across the length and breadth of Scotland at the time.
The Battle of Culloden (Scottish Gaelic: Blàr Chùil Lodair) was the final confrontation of the Jacobite rising of 1745 and part of a religious civil war in Britain. On 16 April 1746, the Jacobite forces of Charles Edward Stuart were decisively defeated by loyalist troops commanded by William Augustus, Duke of Cumberland, near Inverness in the Scottish Highlands.
Between 1,500 and 2,000 Jacobites were killed or wounded in the brief battle. Government losses were lighter with 50 dead and 259 wounded although recent geophysical studies on the government burial pit suggest the figure to be nearer 300. The battle and its aftermath continue to arouse strong feelings: the University of Glasgow awarded Cumberland an honorary doctorate, but many modern commentators allege that the aftermath of the battle and subsequent crackdown on Jacobitism were brutal, and earned Cumberland the sobriquet "Butcher". Efforts were subsequently taken to further integrate the comparatively wild Highlands into the Kingdom of Great Britain; civil penalties were introduced to weaken Gaelic culture and attack the Scottish clan system. https://en.wikipedia.org/wiki/Battle_of_Culloden