Tales of a Eunuch
The story follows a "loveable" rascal as he gambles and gets into various bits of trouble with outlaws and rebels. He eventually gets into a situation where he has to impersonate the eunuch servant of an elderly eunuch who is an evil martial art master. This gets the rascal involved with the emperor who is studying martial arts. The whole movie revolves around a quest for all the copies of a special Buddhist text.