You are correct that the discoloration is from the nicotine bleeding through. I suggest you prime all the surfaces with a product called KILZ. It is an oil-based primer that is designed to keep previous layers (be it nicotine, darker paint, or pen and marker doodling) from showing through a new layer of paint.
Do not use the latex version of KILZ; we consistently get the best results from the original, oil-based formula.
After applying this stain blocker, repaint as you normally would. If you are only experiencing this issue in a few places I would suggest concentrating only on those walls to avoid the expense of repainting the whole house.