John Lucas, waived Sunday by the Houston Rockets after an examination showed traces of cocaine in his blood, had undergone approximately 18 such tests since the start of the National Basketball Association season, according to news service reports.

As stipulated in his two-year, $400,000 contract, the Rockets had the right to make random checks and waive him without further financial obligation if he ever tested positively. Said Coach Bill Fitch, "He had passed them all up to now. But this time, on a routine test, he didn't pass."

Lucas, obtained from the San Antonio Spurs in October, was averaging nine assists and 15.3 points a game and was generally thought to have beaten the drug problems that had troubled him since 1980. Following the 1981-82 season, the 6-foot-3 guard enrolled in a drug rehabilitation program in Philadelphia but was waived by the Washington Bullets halfway through the next season.

The Rockets began testing Lucas more frequently after he missed a team flight to Kansas City earlier this season. He had not missed a game, but was late for several practices and missed more team flights.

According to a league spokesman, the NBA's legal department was uncertain where Lucas fit into the drug policy agreed upon by the league and the players' association in September 1983 and ratified in January. Under the agreement, a player discovered to be using drugs is to be suspended with pay, with rehabilitation provided by the league. A second-time offender is granted treatment by the league but is suspended without pay. If discovered that usage has been continued, the player is banned from the NBA.

The Rockets, too, were uncertain of Lucas' status but, said Fitch, "He will not be back with us."

University of Maryland Coach Lefty Driesell said he had spoken with his former all-America, and No. 1 pick in the NBA's 1976 draft, both Sunday and Monday. "I think he can work this out, he'll be all right," said Driesell. "I really think he's going to be just fine." Lucas was unavailable for comment, but said earlier he was retiring from basketball.

Lucas' teammates in Houston expressed surprise at the announcement of his troubles. "What are we going to do?" said rookie forward Jim Petersen. "John's our leader. He's the guy that runs the show. Now we've got to go on without him."

"We all have strong feelings about John. But we can't let this consume us," added swingman Robert Reid. "I guess now we'll find out how tough we really are."

Lucas was asked for a urine sample when he showed up for the team's practice in Portland Friday afternoon after missing the Rockets' flight from Oakland Friday that morning. He was playing for the Golden State Warriors when they suspended him in 1981. Although Lucas has been placed on indefinite leave of absence, the Rockets requested waivers on him in order to fill his spot on the roster.

"Though basketball has been a big part of his life," said Fitch, "it may be that, in order to survive, he needs to step away from the game."