Complex sentence: When Derek opens it and finds nothing inside, he finds the royal star and leaves the cellar when moments later Rothbart emerges from the chest as a ghost.
Split into simpler sentences: When Derek opens it and finds nothing inside, he finds the royal star and leaves the cellar. Moments later, Rothbart emerges from the chest as a ghost.