Robin of Locksley was an English nobleman who joined Richard the Lionheart, King of England in the Third Crusade. Locksley is imprisoned in Jerusalem along with his comrade, Peter Dubois. Facing the amputation of his hand by the Ayyubid prison guards, Robin escapes with Peter, saving the life of a Moor named Azeem in the process. Robin, Peter, and Azeem escape through a sewer and climb up into an alley, but Peter is shot and mortally wounded by an archer. Before making his last stand against the approaching guards, he makes Robin swear to protect his sister, Marian. Robin returns to England with Azeem, who has vowed to accompany him until Azeem's life-debt to Robin is repaid.
In England, with King Richard still away (in France), the cruel Sheriff of Nottingham rules over the land, aided by his cousin, Guy of Gisbourne, the witch Mortianna, and the corrupt Bishop of Hereford (Harold Innocent). At Locksley Castle, Robin's father, who is still loyal to King Richard, is killed by the Sheriff's men after refusing to join them.
Robin returns to England to find his father dead, his home in ruins, and the Sheriff and his men oppressing the people. After telling Marian of Peter's demise, and while fleeing the Sheriff's forces afterwards, Robin and Azeem encounter a band of outlaws hiding in Sherwood Forest, led by Little John. Among the band is Will Scarlet, who holds a belligerent grudge against Robin. Robin ultimately assumes command of the group, encourages his men to fight against Nottingham, and trains them to defend themselves. They rob soldiers and convoys that pass through the forest, then distribute the stolen wealth among the poor. One of their early targets is Friar Tuck, who subsequently joins these Merry Men. Marian also begins to sympathize with the band and renders Robin any aid she can muster. Robinâs successes infuriate the Sheriff, who increases the mistreatment of the people, resulting in greater local support for Robin Hood.
The Sheriff kills Gisbourne for his failure to prevent the looting of several convoys, and hires Celtic warriors from Scotland to assist his forces in assaulting the hideout. The Sheriff manages to locate the outlaws' hideout and launches an attack, destroying the forest refuge and capturing most of the outlaws. He confines Marian when she tries to summon help from France. In order to consolidate his claim to the throne, the Sheriff proposes to Marian (who is Richard's cousin), claiming that if she accepts he will spare the lives of the captured outlaws. Nevertheless, several of the rebels are due to be executed by hanging as part of the wedding celebration. Among the captured is Will Scarlet, who makes a deal with the Sheriff to find and kill Robin in order to be set free.
Will meets back with Robin and a handful of his most trusted aides who survived the assault by the Celts. Instead of attacking Robin, Will informs him of the Sheriff's plans to marry Marian and execute Robin's men. Will continues to display anger against Robin, which motivates Robin to question why Will hates him so much. Will then reveals himself to be Robin's younger illegitimate half-brother; Will's mother was a peasant woman with whom Robin's father took comfort after Robin's mother had died. Robin's anger toward his father caused him to separate from her and leave Will fatherless. Despite his anger, Robin is overjoyed to learn that he has a brother, and reconciles with Will.
On the day of the wedding and hangings, Robin and his men infiltrate Nottingham Castle, freeing the prisoners. Although Robin's band originally planned to free their friends and retreat, Azeem reveals himself and his willingness to fight the Sheriff, inciting the peasants to revolt. After a fierce fight, Robin kills the Sheriff but is attacked by Mortianna, who charges with a spear. Azeem slays Mortianna, fulfilling his vow to repay his life debt. Tuck also kills the Bishop, burdening him with treasure and throwing him out a window.
Robin and Marian profess their love for each other and marry in the forest. Their wedding is briefly interrupted by the return of King Richard, who blesses the marriage and thanks Robin for his deeds.

Question: What  agreement do Will Scarlet and the Sheriff of Nottingham make?
Answer: Will agrees to help the Sheriff capture Robin in exchange for Will's freedom.