Get him scratching posts, and rub catnip on them so he is attracted to them. Try keeping a spray bottle of water handy - when he does it, he gets a spritz along with a "no, bad kitty" Or, y'know, shin guards!