Here is the thread running around yours about getting rid of the smoker residue and smell. I am not trying to weasel out of a direct answer to your question but the problem is identical and there are many good answers. No reasons to reinvent round wheels?
Best prep/primer for covering smoke smell?
The subject of pet urine smells comes up very often so search for that in the search engine for lots of threads. Most will suggest biting the bullet and getting rid of the effected carpeting AND PADDING. Then I and many others have had the best luck with enzyme treatments. One I have found that works well is "Anti Icky Poo". Your pet store will have things like "Nature's Miracle" but has never done much for my projects but make it smell perfumey over the top of the urine smell.
If you must save the carpeting and padding you can try to save it and eliminate the odors but you must inject the enzymatic fluid to completely saturate under the pad, the pad, and the carpet fibers. If you just pour on the top of the layers you will get nowhere. Those turkey flavor injectors work well for this. Syringes with metal tubes for filling ink cartridges may too but do not hold as much fluid at one time. Anti Icky Poo sells an injector to go with the product.