The movie is Krull. (1983)
The planet Krull is invaded by an entity known as the "Beast" and his army. Prince <PERSON> and Princess <PERSON> plan to marry in the hope that their combined forces can defeat the <PERSON>. The Beast’s army attacks the wedding before it is finished and kidnaps the princess, leaving <PERSON> and the entire kingdom for dead.
Prince <PERSON> is found and nursed by <PERSON>, the Old One. <PERSON> tells him the <PERSON> can be defeated with the "Glaive", a five-pointed throwing weapon. <PERSON> sets out to track down the prison where the Lyssa is being held, the Black Fortress, which teleports to a new location every day at sunrise. 295
As they travel, <PERSON> and <PERSON> are joined by magician <PERSON>, a band of nine thieves, and a cyclops.
They travel to find a wizard who can tell them where the castle will be the next day but he is defeated magically by the <PERSON> before he can.
In a last ditch attempt to find the fortress, <PERSON> leaves the group to journey to <PERSON>", an enchantress who loved him long ago and was exiled to the lair of the Crystal Spider for murdering their only child. The <PERSON> reveals where the Black Fortress will be at sunrise. She also gives <PERSON> the sand from the enchanted hourglass that kept the Crystal Spider from attacking her and will keep a badly injured <PERSON> alive on his journey back to the group. As the Crystal Spider attacks the <PERSON>, <PERSON> flees the web and returns to the group to reveal the location of the Black Fortress, as he loses the last of the sand and expires.
The group capture and ride mystical flying Fire Mares (which look like Clydesdale stallions with fiery hooves) to reach the Black Fortress before it teleports again, and enter the castle before it disappears. <PERSON> attacks, but does not kill, the Beast with the Glaive, losing the <PERSON> forever. They royal couple quickly complete the wedding, releasing the their linked power, and they defeat the <PERSON> with fire.
Condensed from: -https://en.wikipedia.org/wiki/Krull_%28film%29 351