Tripitaka is visited in a dream by the restless spirit of the deceased king of the land of Cockcrow. He tells Tripitaka he was murdered by a Taoist magician and thrown into a well; for the past three years this magician has been impersonating him. With the help of the king's son, Tripitaka and his disciples set out to prove that the current king is a fake.