Soo Lin Yao works at a museum demonstrating the tea ceremony. Afterward, her co-worker Andy Gilbraith asks her out for a drink, but she turns him down and says that he wouldn't like her very much if he knew her. Soo Lin then tells him to stop asking her out.
That night, Soo Lin is working late when she hears someone moving. She goes to investigate and finds a statue covered with a cloth. When she pulls the cloth away, she stares in shock at what's underneath.
John is trying to buy groceries at the store and the machine gives him problems. Meanwhile, at home Sherlock battles a robed swordsman and finally knocks him out. When John finally comes home, he complains that he had a row with a machine, and that Sherlock hasn't moved all date. Sherlock admits that he turned down a case about a diamond and gave the messenger a refusal. As he does, he shoves a sword beneath the chair. John notices that Holmes is using his computer to check his e-mail. John asks for money, and Sherlock says he has to go to the bank.
John and Sherlock go to the bank and meet with an old university friend of Sherlock's, Sebastian, who invited Sherlock to check out a case. He explains that someone broke into their former chairman's empty office and painted graffiti on the walls. Sebastian shows them the room, and two symbols, one on a painting and one on the wall nearby. The building is sealed and the CCTV shows no one in the room within 60 seconds. He offers to pay Sherlock to find the hole in their security. Sherlock turns down the money, but John quickly accepts.
Sherlock takes photos of the room and then steps out on the balcony and considers the street far below. He then walks through the office, figuring out who has a line of sight to the chairman's office. He finds one office and removes the name sign of Edward Van Coon, of the Hong Kong division. As he leaves with John, he explains that the graffiti was a message to someone, and Van Coon was the only one who could see the room when the message was left. They go to Van Coon's address and Sherlock convinces a new neighbor to let him in. He then climbs from her balcony to Van Coon's apartment. Van Coon is dead in his bedroom, an apparent suicide.
DI Dimmock arrives with the forensics squad, and Sherlock suggests it wasn't suicide. He finds a black paper flower in the dead man's mouth. Dimmock believes it's suicide, but Sherlock points out all the evidence that shows Van Coon was left-handed, but the bullet wound was on his right side. He tells Dimmock that Van Coon fired at his killer as he came in through the open window, and tells Dimmock to confirm that the bullet wound came from another gun.
Journalist Brian Lukis runs into his apartment, locking the doors behind him. He turns and stares in horror at something.
Andy is working at the museum when the director informs him that Soo Lin resigned. Andy goes to her apartment in Chinatown and knocks on the door, but doesn't get an answer. He writes a note on museum stationary and places it in the mail slot.
John applies for a job at a surgery and admits to the doctor, Sarah, that he needs the money. She warns that it's mundane, but he insists that's fine and she hires him. He returns and finds Sherlock contemplating the case. He informs John of Lukis' death, in a locked room, and believes it's the same killer. They go to Lukis' home and discover a black paper lotus lying on the floor. Sherlock realizes that the killer came in through the window, and is an expert climber. He ran along a ledge to get into the bank. Sherlock finds a book recently checked out from the West Kensington Library and goes there with John. They look for the books that Lukis checked out, and find more of the painted graffiti on the nearby shelf.
Back at 221B, Sherlock and John try to piece together the clues. Sherlock realizes that the graffiti symbols are ciphers, and that they are an ancient code. He and John go to talk to an expert, a street graffiti artist named Raz. Raz identifies the paint but has no idea what the ciphers represent. He agrees to do some inquiries. The community officers come around and Raz and Sherlock run off, leaving John holding the bag with Raz's paint.
John returns home later, annoyed that he's been given community service, and Sherlock sends him to the Scotland Yard to check on Lukis' personal effects. Meanwhile, he goes to see Van Coon's personal assistant, Amanda. She has all of his receipts, but notes that there is a gap in her boss' schedule.
Dimmock complains about Sherlock and gives John Lukis' diary.
Sherlock talks to Amanda, who admits that Van Coon wasn't appreciate of her. He notices a bottle of expensive hand cream that Van Coon bought for her. The receipts show that Van Coon took a taxi to the West End, but came back on the Underground. That signifies Van Coon was carrying something heavy, and then stopped at a restaurant after he made the delivery. Sherlock goes to the street and runs into John, who has gotten the address from Lukis' diary. The journalist visited the Lucky Cat Emporium, as did Van Coon. Inside, they discover that many of the goods have numbers on them, in the same symbols as the ciphers. They realize that the numbers are in Hang Zhou, an ancient Chinese dialect only used by traders. The numbers at the bank are 15 and 1. As they leave, a woman takes photos of them.
Sherlock and John go to a restaurant across the street for lunch, and Sherlock deduces that both men brought something back from China. Both of them were smugglers, and the Lucky Cat was their dropoff. The two men were murdered because someone stole something from his employer. Sherlock is distracted when he notices a wet phonebook package next to an apartment door adjacent to the Lucky Cat. He climbs up the fire escape and goes inside through an open window, ignoring John's pleas to open the door. Going over the apartment, Sherlock realizes that the killer came in, and hasn't left. The killer ambushes Sherlock and chokes him to the point of unconsciousness, drops a black paper lotus on the floor, and then leaves. Sherlock staggers downstairs and opens the door for John. He says they need to find Soo Lin, and spots the note from Andy on the museum paper.
Sherlock and John talk to Andy, who says that Soo Lin resigned and the last thing she did was demonstrate the tea ceremony. As Andy shows them her locker, Sherlock notices a nearby statue with two ciphers on them.
As the two men leave, the same woman from earlier watches them. Raz meets them and takes them to an Underground station where someone has written more ciphers using the same paint. They spread out to search, and Sherlock finds a can of spray paint. John finds a wall with more of the graffiti. They go back home and John begins to pass out due to lack of sleep. Sherlock realizes the numbers are all in pair, and that the killer left them on the wall to communicate with the thief and demand the return of the stolen item. They go back to the museum to ask Andy for more information. As they talk, Sherlock notices that one of the teapots has been polished since the last time they were there.
That night, Soo Lin enters the museum and tends to both teapots. Sherlock and John come in, and she explains that she came back to finish her work. Soo Lin explains that she knew the killer in China, and recognized his ciphers. The killer is Zhi Zhu, "The Spider." She shows them a Tong tattoo on her foot, and explains that everyone who smuggles drugs for them bears the mark. The Black Lotus Tong employed her after her parents died and she had no other way to survive. She gave up the life and came to London, but Zhi Zhu tracked her down after five years. He asked for her help finding what was stolen, but she refused. When John asks how well she knows Zhi Zhu, Soo Lin explains that he's her brother. He became a puppet of the Tong in the power of Shan, the Black Lotus General. When she refused to help him, he accused her of betraying him, and left the ciphers.
Sherlock shows her the ciphers, and she starts to explain that they're based on a book. The lights go out and she realizes that her brother is there. Sherlock runs to find him, and the killer opens fire. John hides Soo Lin and then goes to help his friend, but the killer circles around them and confronts Soo Lin. John hears a gunshot and returns to find her dead, a paper lotus in her hand.
John and Sherlock talk to Dimmock, who demands proof before he pursues the case. Sherlock awkwardly flirts with Molly to get her to show him the corpse, and then checks the feet and shows them to Dimmock. Each one has the Tong tattoo on them, and Sherlock asks for all the books from each man's apartment.
Sherlock and John go over the books, looking for the book that both of them had and has significant words that match the two numbers, page and word. Dimmock returns the photo of the wall, and Sherlock explains they hoped she would decipher them.
After working through the night, John realizes that he needs to go to work. Later, the receptionist tells Sarah that John isn't taking patients, and she discovers that he dozed off. She takes on his cases, and later tells him what happened. John explains that he was up late for a "book event," and Sarah asks if he has a girlfriend. John says that he doesn't, and asks Sarah out on a date.
Sherlock is unable to find the proper book, and tells John they should go out to get some air. John tells him that he's going out on a date, and Sherlock gives him a pair of circus tickets in his name. However, when they arrive there, they discover Sherlock is there, and has bought a third ticket. He explains to John that the Tong must be using the circus as a cover to get the killer out of China, and he needs John's help to look around. John is more interested in getting off with Sarah.
They go inside and the circus matron first gives a demonstration of escapology using a giant crossbow designed to fire at the escape artist when a sandbag triggers it. Sherlock sneaks off while the next act begins: a masked acrobat who "flies" on silk robes. Backstage, Sherlock spots the acrobat and realizes it's Zhi Zhu. The matron comes backstage and Sherlock hides until she leaves. He finds a can of the spray paint and confirms it's the same type, and then the escape artist attacks hi with a sword. They end up on stage, and John and Sarah comes to Sherlock's aid. Sarah knocks him out with a stick and Sherlock confirms he has a Tong tattoo on his foot.
When they contact Dimmock, the DI sends officers but the circus has already moved away. Sherlock insists that the Tong came to recover something, but they don't know what. Dimmock admits that he has nothing to show for the raid, and can't do anything further.
The trio returns to 221B and Sherlock figures that the Tong will have gone to ground at their hideout. They key to their hideout rests within the ciphers. Sarah suggests that she should go and Sherlock agrees, but John hastily say she should stay and tries to find some food. Meanwhile, Sarah tries to make conversation with Sherlock without success. Mrs. Hudson brings in some food, while Sarah notices that some of the ciphers are already solved. Soo Lin translated two of the words and wrote them on the photograph they gave her. The two words are Nine and Mill, and Sherlock realizes it's the value of the stolen object. He leaves for the museum restoration room to find the book that she used. He tries to hail a taxi without success, and notices a pair of German tourists who are using an A-Z London guide. He realizes that Van Coon and Lukis had the same book, a book that everyone would use.
John suggests that they get takeaway.
Sherlock begins to decipher the ciphers using the guide.
The deliveryman arrives quickly and John answers the door. The man demands to know where the treasure is, and knocks John out when he says he has no idea where it is.
Sherlock realizes the message reads "Nine mill for jade pin. Dragon den black tramway." He returns to 221B and discovers that John and Sarah have vanished, and their abductors have left more ciphers.
John wakes up and finds himself in an abandoned tramway tunnel. The matron from the circus introduces herself as Black Lotus General Shan, and assumes that John is Sherlock. When he denies it, she points out that he has Sherlock's debit card, Sebastian's check to Sherlock, and the circus tickets in his name. Shan points out that they tried to kill him three times and failed, but it was deliberate so that he would search for the treasure.
Sherlock goes over the maps of London to find the black tramway.
Shan demands to know where the Empress' pin can be found. When John says he has no idea, they use the circus crossbow to threaten Sarah, and cut open the sandbag weight to activate the trigger. Sherlock arrive, knocks out one of her guards, and warns that her shot could easily ricochet. He kicks over the barrel providing light and tries to untie Sarah, but Zhi Zhu strangles him with one of his silk ropes. John manages to knock himself over and jar the crossbow, which shoots Zhi Zhu. Shan runs off and Sherlock frees Sarah, while John assures her that their next date won't be the same.
The police are summoned, and Sherlock lets Dimmock takes the credit. Dimmock realizes who he owes.
The next day, Sherlock and John go back to the bank. Sherlock explains that Van Coon was the thief, and talks to Amanda again. He explains that he's deduced that Amanda was having an affair with Van Coon because he had the same brand at his apartment that Amanda uses for her lotion. She tells Sherlock that she ended the affair because Van Coon took her for granted and often left on trips for China on short notice. Sherlock says that Van Coon bought her a present to make up for his abandoning her, and asks for the hairpin that he gave her. When she hands it over, Sherlock tells her that it's worth nine million pounds and she runs off in shock.
At 221B, Sherlock explains that Van Coon had no idea of the hairpin's real value. John realizes that Sherlock is upset that General Shan escaped. He figures they've cracked the code, but Sherlock warns that all Shan has to do is get another book. As he looks out the window, John sees a Chinese street tagger writing a cipher on the wall opposite.
Shan calls her benefactor, "M" and thanks him for his help in getting them passage into London. She worries that his safety is compromised, but "M" assures her that her actions can't be traced to her. When Shan says that she won't betray him, "M" has a sniper kill her.