This is how I did it, like others I had to find a exploit to manage it. I also used the whole having your character speak to the main guy initially, fought and killed the mage, got everyone backed off and then retreated.
I may have found an exploit or bug you may wanna patch. You can flee from the final fight come back and do the fight again this time with no sudden worm invasion as it is dead. I had killed the mage already so there was no huge issue this time. It's not a bug so much as an actual exploit perhaps. But I know in first game you could not run away from major fights.