@Pieter Boelen: could you help me to fix the nation relation system? It should not be piracy to sink an enemy ship, only to capture it or steal its cargo.
If I remember correctly, on a previous occasion when I mentioned that, you suggested checking in the ransack screen rather than when a ship sinks. Of course, it's not quite that simple because the ransack screen appears after boarding, and I can think of a few reasons why you could legitimately get there - the obvious one being if the enemy initiates boarding and you then win. Or, your gunnery might not be very good or your merchant ship only has a few, small guns, so you don't want to trade broadsides with an enemy frigate - but you've been practicing your melee in jungles, dungeons, and against random thugs in town, so you have a decent chance against the enemy crew. Or, this is a game, you have something else to do in real life, and it's a lot quicker to sink an enemy ship by boarding and abandoning it than to pound it with cannons.
There's already a system for warning if you're about to put a captain onto a captured ship and you don't have "Leadership" at least 5, or if the captain's skills aren't high enough to command that ship efficiently. I don't know if it would be possible to have two warnings - capturing that ship without a LoM is piracy, and if you choose to do it anyway, warn about "Leadership". There would also need to be a check for LoM and a warning before you go into the cargo screen.
"Cabinfight_dialog" could also check. If you don't have a LoM, your only legal option should be to let the enemy ship go, possibly unlocking perks. So any answer other than "Let's be civilised about this" should lead to a warning that this is piracy before continuing to the next part. (If he chooses to duel you, you're going to the ransack screen when you kill him.)
Another thought - when you attack, it should be under your true colours, which means the flag of the nation whose LoM you have (or one of them, if you have several LoM's). So, if Britain and Holland are both at war with Spain and you only have a Dutch LoM, you can only legally capture a Spanish ship by flying a Dutch flag, not a British one.
You don't need to do any of the coding, just give me some clues as to how to set up the warnings in the ransack screen.