Tripitikas's team takes refuge in a monastery, where they learn that Lu is actually not an immortal as he failed the test, and only the Warlord's elixir can save his life. In desperation, Tripitikas goes to the Warlord's palace alone to exchange the staff for the elixir. The Warlord asks Tripitikas to duel Ni-Chang to death, since the former can give the elixir to only one of them. Tripitikas is overpowered until his teammates and monks from the monastery arrive to join the battle. Tripitikas manages to grab the elixir and tosses it to Lu, who drinks it and recovers. The Monk passes the staff to Tripitikas, who uses it to smash the King's statue. The King is freed and the Monk is revealed to be actually one of the King's clones. Lu kills Ni-Chang. After another long battle between the King and the Warlord, the latter is eventually stabbed by Tripitikas and falls into a lava pit to his death. However, Sparrow succumbs to her wounds. The Jade Emperor, having returned from his meditation, praises Tripitikas for fulfilling the prophecy and allows him for one wish, which he asks to return home. Tripitikas finds himself back in the present. He overpowers Lupo and drives the other hooligans away. Hop survives being shot and claims that he is immortal (hinting that he is actually Lu). Before the film ends, Jason is delighted to meet a woman who resembles Sparrow. Tripitikas continues honing his kung fu skills while Lu narrates the King's search for truth. While the character Sun Wukong came from Wu Cheng'en's famous classical novel "Journey to the West", in an interview with Screen Power magazine, actor Collin Chou denied that the plotline would be related to the novel. The details of the plot were devised by screenwriter John Fusco along with actor Jet Li. Li explains,  In a behind the scenes article he wrote for "Kung Fu Magazine", screenwriter John Fusco also stated he derived the surname for the Jason Tripitikas character from "the wandering monk, Tripitaka, from "Journey to the West"". The Golden Sparrow character was inspired by Cheng Pei-pei's character Golden Swallow from the Shaw Brothers film "Come Drink with Me". Before trying to kill the Jade Warlord, Golden Sparrow refers to the 1966 film, telling him to "Come drink with" her.