Help me figure out a final battle against an army of pirates
I've been running a two-year campaign that's half Saltmarsh, half homebrew, that is about to reach the finale, and I'm looking for advice on the final battle.
[I don't think any of my players are in this community, but if you're in my Piratehaven campaign, stop reading.]
The setup: An army of pirates is bearing down on the city. The pirate king is trying to complete a world-ending ritual by slaying the queen. (The rank-and-file members of the pirate army don't know about the ritual. They think they're conquering the nation to seize wealth and land for themselves.) The PCs (level 13) have gathered an army to defend the city, though the soldiers are poorly trained militia and way less effective fighters than the pirates.
I want this to be an epic final battle, playing out over multiple phases, but I'm struggling to figure out the specifics.
My plan so far is:
Phase 1: The pirates send ships rigged with explosives/firebombs, and the PCs pilot magical fighter-boats to keep these ships from reaching the harbor.
Phase 2: ???
Phase 3: The pirate king (with some minions) makes it to the throne room through a secret tunnel. The PCs have to defend the queen and defeat him.
Phase 4: It turns out slaying the pirate king also completes his ritual, and he transforms into a kaiju-sized god, who the PCs have to defeat as the ultimate climax of the campaign.
But I'm not sure what to do about Phase 2. This would be the pirates attacking the city, while the PCs and the army they gathered defend it. I want it to feel like an epic Game of Thrones-style battle.
But how do I play this out? How do I keep the focus on the PCs and their abilities, without making them spectators to a clash between two armies, or interrupting our D&D game for a strategy wargame?
I feel like I need to translate "battle the army of pirates" into some sort of tangible goal or series of goals that the PCs can pursue using their abilities. But I'm not sure how to do that or what those goals should be.
Can anyone give me ideas?