Ice Cube's new movie "Lottery Ticket" doesn't come out for another week -- but there's already a legal fight over the flick ... from a screenwriter who claims his agent ripped off his idea and gave it to another one of his clients.
The man filing the lawsuit is Tom Huang -- who once wrote an episode of "The Mullets" back in 2003.
According to legal documents, Huang claims he came up with an idea for a movie back in 2004, wrote a "treatment" for it ... and talked it over with his agent Brad Kaplan.
But in the lawsuit, filed Wednesday in L.A. County Superior Court, Huang claims Kaplan "stole" the idea and gave it to one of his clients named Erik White .. who went on to write and direct "Lottery Ticket."
Huang claims "Lottery Ticket" ripped off all sorts of elements from his movie -- including "detailed plot elements, characters, and scenes." Huang is suing for an undisclosed amount -- but states in the lawsuit that he believes "Lottery Ticket" will rake in millions ... so it's safe to say he's gonna want a ton of cash.
In the docs, Huang claims that the agent Brad Kaplan denies any wrongdoing -- and believes White "created the story" for Lottery Ticket.