If you know the set number code, go to the Lego website, it should list all the associated bricks/components & their codes.
There is a Lego pick-a-brick section where you can individually pick & choose certain bricks that you need, although some of the rarer or discontinued pieces may not be available. I think their shop is based in Europe? You need to factor this into costs & shipping etc.
Here in Europe, there are independent Lego hobbyists that are connected to online forums that provide a search facility (via part code) for second-hand and brand-new Lego bricks, that then point you to their online stores. Common bricks sell from a little as a few pennies to more expensive for rare pieces.
Do a check on google, you may be lucky to find such a Lego-collector forum & supplier near to you!
ETA
If you are just after random mini figures with a pirate theme & don't care about it being genuine Lego, Aliexpress sell inexpensive mini figures that should be good enough as background characters for your pirate scene? Just beware long shipping times, you need to specify the more-expensive shipping option if you want them delivered more quickly.