The legendary King Vikrama, identified as Vikramāditya (c. 1st century BC), promises a vamachari (a tantric sorcerer) that he will capture a vetala (or Baital), a celestial spirit who hangs from a tree and inhabits and animates dead bodies.
King Vikrama faces many difficulties in bringing the vetala to the tantric. Each time Vikram tries to capture the vetala, it tells a story that ends with a riddle. If Vikrama cannot answer the question correctly, the vampire consents to remain in captivity. If the king knows the answer but still keeps quiet, then his head shall burst into thousand pieces. And if King Vikrama answers the question correctly, the vampire would escape and return to his tree. He knows the answer to every question; therefore the cycle of catching and releasing the vampire continues twenty-four times.