DALLAS (AP) — The Dallas Mavericks knew they could trade Jerry Stackhouse for a key player for next season. As it turned out, a lot of teams benefited.

The Mavericks, Raptors, Grizzlies and Magic combined in a massive swap Thursday that included eight players, a draft pick and stacks of cash. The deal sent Shawn Marion to Dallas, Stackhouse to Memphis and helped seal the transaction that moved Hedo Turkoglu from Orlando to Toronto.

Among the other pieces: Forward Kris Humphries and center Nathan Jawai went from Toronto to Dallas; guard Greg Buckner moves from Memphis to Dallas; and swingmen Antoine Wright and Devean George go from Dallas to Toronto.

Memphis also received a second-round pick and cash from Toronto, while Orlando got cash from Dallas and the Raptors.

The Magic were going to lose Turkoglu anyway. After Orlando acquired Vince Carter, Turkoglu opted out of his contract and became a free agent. He’d already decided to go to Toronto, but turning his departure into a sign-and-trade helped glue together the rest of this complex puzzle.

The Mavs are no strangers to convoluted, multi-team deals, but this one was still taxing. Team owner Mark Cuban posted on his Twitter feed late Wednesday: “Its been a long day of looking at spreadsheets, reading NBA cap rules and rubbing my eyes.”

It was worth the effort to Cuban because Dallas got Marion, a four-time All-Star nicknamed “The Matrix” because of his do-it-all game. The Mavs are hoping he’ll be a great complement to a starting lineup featuring Dirk Nowitzki, Jason Kidd and Josh Howard.

Marion was a matchup nightmare during his heyday with the Suns — too big for Howard, too quick for Nowitzki. For his career, he’s averaged 17.8 points, 9.9 rebounds, 2.0 assists, 1.83 steals and 1.31 blocks per game.

But Marion is also 31 and headed to his fourth team since February 2008, having bounced from Phoenix to Miami to Toronto. He’s also coming off a season in which he had his fewest points, rebounds, blocks and steals since his rookie season.

Stackhouse was enticing because although his contract is for more than $7 million, if he’s waived by mid-August he can be bought out for only $2 million. That’s likely the amount of cash Memphis received.

Buckner, who has played in Dallas twice before, has a similar contract. So he’s likely to be dealt again or bought out.

With the deal, the Mavericks are hoping to keep pace with all the roster overhauls in the West.

The Lakers and Spurs — historically, their two biggest rivals – seem to have improved, too, and Cuban knew he needed something big to up. Dallas has won at least 50 games and made the playoffs nine years in a row, but the Mavs don’t have a title to show for it.

Kidd already has agreed to re-sign, although the paperwork is pending. Dallas also is expected to get 25-year-old center Marcin Gortat, who was Dwight Howard’s backup in Orlando last season. Gortat is in the process of signing an offer sheet that the Magic will have one week to match, although that’s believed to be unlikely.

The Mavs also are hoping to keep their own free agents, Brandon Bass and James Singleton.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.