Free agent Jimmy Butler will be sent to the Heat in a sign-and-trade deal in exchange for Josh Richardson -- as long as the three teams involved in the deal come to an agreement.

Butler will sign a four-year, $142-million deal with the Sixers and be traded to Miami on July 6.

The Heat and Dallas Mavericks, the third team involved in the sign-and-trade, must sort out things before that July 6 date. The Mavs got involved thinking they would get Kelly Olynyk and Derrick Jones Jr. in the deal, according to The New York Times. However, the Heat don’t want to surrender Jones and must trade Goran Dragic to make the cap money fit.

If the two teams are unable to sort out the $1.7 million missing on Miami’s end, the Heat might have to find a new trade partner to take Dragic.

The 29-year-old was also expected to meet with the Houston Rockets in the coming days. The Heat and Rockets didn’t have the available cap space to sign Butler to a max contract. That’s why the Sixers settled for a sign-and-trade.

Richardson, a 6-foot-6 swingman, is regarded as poor man’s Butler. He just doesn’t handle the ball as well. However, he did average a career-high 4.1 assists to go with a career-best 16.6 points this past season -- his fourth in the league.

In losing one All-Star talent, the Sixers gained another. Al Horford agreed to sign a $97-million, four-year deal with Philadelphia.

Horford could make up to $109 million with championship bonuses.

Horford will join Tobias Harris, who signed a five-year deal to remain in Philadelphia.

Sharpshooter JJ Redick is leaving -- he agreed to a deal with the Pelicans.

Other free-agency storylines