Sacramento Kings star Zach Randolph just struck a pretty sweet deal in his marijuana case ... and all he has to do is a TON of community service.

TMZ Sports broke the story ... Z-Bo was arrested for felony weed possession with intent to sell back in August when cops say they busted him with more than 2 pounds of pot in Nickerson Gardens.

The charges were later reduced to misdemeanor possession of more than 1 ounce of marijuana and resisting arrest ... and Randolph was facing up to 1 year in jail if convicted on both accounts.