Complex sentence: Zi Yuan gives the dagger to the group before dying as the Emperor goes into the Great Wall to use his elemental powers to negate the undead spell.
Split into simpler sentences: Zi Yuan gives the dagger to the group before dying. Meanwhile, the Emperor goes into the Great Wall to use his elemental powers to negate the undead spell.