Having escorted the coffin of his beloved Madam Shi back home, Zhang Baozai could not help but lament over how immensely things have changed in his hometown. Only the scenery looks familiar to him.
In the twelfth year of Qing Jiaqing (1807), Zheng Yi, leader of the Red Flag Pirates, was drowned at sea during a typhoon. His wife, Madam Shi stepped in and led the gang. One year later, Shi wants to abdicate her position and make either Zhange Baozai or Master Xiao her successor. She performs a divination, and Zhang turns out to be the chosen one. Although Zhang feels inadequate due to his lack of experience, Shi believes in Zhang’s ability as well as the result of the divination. Zhang reveals his love for Shi, and their relationship becomes rather ambiguous. With Shi’s assistance, Zhang gradually replaces Zheng Yi, leading the Red Flag Pirates
In the residence of Admiral Sun in Fujian, Lady Duanmu is preparing Chinese herbal medicine for her husband, who constantly devotes all his time and energy to serve the Court. Her father, a Chinese herbal doctor, died in prison years ago for healing Madam Shi. Admiral Sun has received an order from the Governor of Guangzhou, Bai Ling, to exterminate the Red Flag Pirates. Lady Duanmu suggests him convincing Zhang Baozai to capitulate. And she is willing to go with him and share his burdens.
The army provisions are ready by the time of the Lantern Festival. Lady Duanmu and Admiral Sun are watching puppetry in front of a temple in Foshan. As the show approaches its climax, all of a sudden they find themselves surrounded by Zhang Baozai and his gangs. Master Xiao wants to execute the two, but Madam Shi opposes as she knows that the Admiral is one of the few in the Court who is loyal to the country. Desperate to save her husband, Lady Duanmu tells Shi about her father, and offers herself as the hostage to heal Shi.
In the fourteenth year of Qing Jiaqing, leader of the Black Flag Pirates finally surrendered, leaving the Red Flag Pirates to fight on their own. Although Master Xiao tries to reorganize his troops, they are already surrounded by Admiral Sun’s army, and are induced to capitulate. Zhang Baozai refuses, preparing to be executed. However, he releases Lady Duanmu first, who has been treated well during her captivity. Grateful to Zhang, Sun spares Zhang his life, and Zhang stopped Master Xiao from launching another attack in return. The two ladies bid farewell to each other, and both men show respect for one another.
Frustrated by the precarious lives of pirates, Madam Shi and Zhang Baozai are considering capitulation. Lady Duanmu comes and tells them that Admiral Sun is arrested for liberating the pirates, hoping they can rescue him. Infuriated, Shi wants to raid the prison to save Sun, but Zhang worries that they will ruin Sun’s future in doing so. He decides to offer Governor Bai Ling a deal: the Red Flag Pirates will surrender if the credit for their capitulation goes to Sun. Master Xiao disapproves of his decision and leaves with unsettled grievance, never to see them again.
An imperial edict is transmitted to them by Governor Bai Ling: Sun is reappointed the Admiral of Fujian for his meritorious contribution to the security of the South China Coast. The Emperor appoints Zhang Baozai as navy commander of Penghu and confers the name Zhang Bao on him. By the time the dance of the Dragon begins, all the pirates have repented and the ocean is now safe.
Feeling melancholy, Zhang recalls his life at the Chek Lap Kok beachhead while scattering Shi’s ashes into the sea.