Piracy is a never ending problem in the Hanseatic League. At minimum, there will be at least one pirate at sea at all times, whether hired by the player or an AI. Piracy could be done by one of three ways, the most common is giving a pirate (player or AI) a ship, the second is raising the pirate flag on one of your ships or convoys and attacking another ship or convoy, and the last is attacking a town.
Pirates can be hired in taverns. The pirate can ask for anywhere from 65% of the loot down to 30%. Pirates are an Underworld character and talking to him can result in a fine. All pirates will show 2 things in information, one being the loot he wants and how many "henchmen" he has available to board a ship given to the pirate. It is usually recommended to only give a crayer or a snaikka, and to try and have it armed and some cutlasses to give a bonus to the pirate ship on plundering an enemy ship. Once a captain has plundered a ship, you will recieve a personal message and the percentage of loot. For every message there seems to be a chance that you might get caught fined, although rare, it can happen.
Tip - In Patrician 3 it is quite known to buy low and sell high, and same with pirates, if you do hire one, make sure that the loot is worth it (meaning that the max should be 50%) but the lower the loot the pirate keeps, the better it is for you.
Captains are extremely useful, not only giving a bonus to certain aspects of the ship, or traderoutes, but also they can allow your ship (or convoy) to raise the pirate flag. Once your ship (or convoy) has turned, you can attack other trader's ships. You can capture, plunder, sink, or flee or allow them to flee. Raising the pirate flag could lead to a fine. Attacking ships could also lead to a fine.
Tip - You can tell if a trader ship is armed without clicking on it for extra info by looking at the shield, and if it shows the number of ships it is armed (meaning that it is in a convoy).
Every town has their own Town Hall and its Town Coffers, which can be raided either through a siege (by the Prince or mercenariers) or by a pirate attack. AI pirate attacks are extremely rare for what I have seen. At the start of the game, every town has 1 harbor bombard. Town raids are the same as a sea battle, except that there is well, land and at least one bombard, and maybe outriggers (If there is nothing deffending the town, you automatically win and get the loot) deffending the town. Later oine as the game progresses, more bombards are built, and upgraded into cannons (same as the gate ones). Attacking a town through a raid could lead to a fine if they recognize your ship, but on the other hand, you get all of the money in the town coffers (at the start it is around 250,000 - 400,000 Gold coins) plus all the barrels of goods in town (It doesn't seem to take the packs that take up 10 storage per unit no matter how much space is available in ships). If you are caught, the veredict is that you aren't allowed to trade with the town for a certain period (weeks) but you can still trade with your trading office (if you have a manager, they can't sell nor buy from the town either).
Tip - Later on it becomes harder to win Town Raids. At the start of the game, capture at least 2 cogs, and 1 crayer. Improve them to lvl 3's, add weapons, and you can let the AI fight it for you. (This is the minimum for a single bombard that the AI seems to require to win)