In a small saloon, a man with a banjo begins to sing a song about Lucky Luke, and his recent capture of the Dalton brothers: Joe, William, Jack, and Averell.
After being sent to prison, the brothers receive a surprise visit from an attorney named Augustus Betting. He then explains to them that their Uncle Henry Dalton has been hung. Augustus then informs the Dalton brothers that their Uncle willed them the fortune he accumulated through a lifetime of robberies and hold-ups. However, in order to receive the money, the Dalton brothers must eliminate the judge and jury that sentenced Henry to death. Joe ecstatically wants the names, but is sidelined when the attorney explains that Henry Dalton wanted someone to supervise the executions to be sure they were carried out. Ironically, Henry wishes for Lucky Luke to make sure his last wishes are carried out. The attorney concludes that if the brothers fail to honor Henry's wishes, the fortune will then be donated to charity.
That evening, Joe hatches a plan to tunnel out of the prison. Their path takes them right under the dynamite storage shed, which blows the Daltons as well as a prison hound dog known as Rin-tin-can out of the prison. The guards assume that the Daltons were blown up, along with the dog.
Some distance off, Rin-tin-can comes to, and finding the prison gone, things that it has been stolen. Seeing the Daltons, he follows them, thinking they have stolen the prison.
Eventually, the Daltons come across a traveling hardware merchant, whom they hold up for firearms and ammunition. The hardware merchant goes to the nearest town's bar, where Lucky Luke is. After hearing of the holdup, Luke goes back out to the scene of the crime, where he is accosted by the Daltons. That evening, Joe gives Luke an ultimatum: refuse their offer to help them, and he'll be killed. Accept, and they'll give him a share of Henry Dalton's legacy.
Luke agrees not only to accept the brother's offer, but also to help them eliminate the men they're after.
The group first encounter a laundryman named Ming Lee Foo. While the Daltons attempt to distract him by having him launder their clothes, Luke goes off claiming to take care of him, but has Foo fake his death. As a crowd gathers around Foo's body, the Daltons take off, for their next victim.
Next, they go to a prison wherein is a warden named Thaddeus Collins. Luke goes in first to scout the place, only to find the jail is without prisoners, and Collins is tearfully sitting at his desk, claiming he is emotional because he thought of the prisoners as his children, and they have all tunneled out of his prison!
Luke tells Collins of the Dalton's plan, and the warden leaves through a tunnel. Luke the convinces the Daltons to blow up the prison, convincing them that they have taken care of the warden.
Next, they find an Indian shaman named Snake Feather. Though he does give into their request to allow them a drink of water, Luke is the only one suspicious. Snake Feather tells Luke he is correct, and had laced the water with toadstools, sending the Daltons into a wild dream.
When they come to, Luke claims he killed Snake Feather, and the group goes on their way.
Next, they track down Dr Aldous Smith, a traveling merchant who attempts to sell the boys an elixir, though Luke claims that the Doctor also is carrying a poison on him, and the Daltons demand the doctor drink it. Aldous drinks it, and collapses.
The boys next track down a reclusive miner named Tom O'Connor. Luke claims that O'Connor has gone deep into his mine, and the boys take an ore car deep into it...where they find a white spectre claiming to be the dead apparition of Tom. The boys rush from the cave, telling Luke that O'Connor is already dead.
Next, the Daltons and Luke track down Sam Game, a gambler who claims to have reformed, now a preacher...though mainly to a group of wide-eyed old ladies, with plenty of money. After the services, the Daltons give in to Sam's request of a game of Russian Roulette. The gun goes off, and it looks like the Daltons have won.
After this, the Daltons attempt to derail the train of Bud Bugman, a railroad operator, but his train simply ends up going off the tracks, and across the desert! Finally, the train comes to a halt, and Luke claims to the Daltons that he murdered Bugman.
The group then goes to a small town, wherein the last of the Jurymen, Mathias Bones, resides.
Luke goes to talk with Mathias, and then tells the brothers that Mathias is heading out of town that afternoon. The boys prepare an ambush, and it seems that Mathias has been riddled with bullets.
The group next heads to a rodeo, wherein the Judge who presided over the trial, is presiding over the rodeo. The group sends Avril to take part in the rodeo, but he ends up getting jounced around.
After the rodeo, Luke takes Avril off, claiming he'll make sure that the brother takes care of the Judge.
The two then return shortly, with a newsboy then relaying a Special Edition of the town newspaper, that tells of the Judge's murder.
The group then heads for Augustus Betting's place, ready to claim the inheritance, and makes Joe eager to off Luke. However, before he can, Augustus asks the boys into a side room...wherein all the jury and the judge are sitting!
The Judge claims that the boys are to be tried for attempted murder, and that Luke can testify to this. One-by-one, the jurors, declare the boys guilty, and that they be sent back to prison.
In a fit of rage, Joe Dalton attempts to shoot Luke, but has his gun shot out of his hand.
The brothers are then returned to jail, along with Rin Tin Can (who believes that Luke was a bandit that got away).
As promised in the will, Henry Dalton's fortune goes to charity.