You can just use the dialog system already.Yes, that ought to solve all the reported problems related to this issue. I'd imagine that all existing storylines and sidequests were written under the assumption that surrendering captains always use "Cabinfight_dialog.c", as that has always been the case until now, so leaving it that way should not break anything.
Perhaps allow an attribute to be defined so that, if someone writing a quest really needs a custom surrender dialog, e.g.If that attribute is not defined then the character uses the default "Cabinfight_dialog.c". If you want a custom surrender dialog then add that attribute in the captain's character definition.Code:ch.SurrenderDialog.Filename = "custom_surrender_dialog.c";
By defining a second dialog file you can just merge the files.
Or you can overwrite the file after the generation.