Complex sentence: Meanie casts a spell on the Plunket house that when Maxwell gives him the key to the house they will switch places the Plunkets will move into the lamp and the Meanie into the house freeing it.
Split into simpler sentences: Meanie casts a spell on the Plunket house that when Maxwell gives him the key to the house, they will switch places. The Plunkets will move into the lamp and Meanie would go into the house and freeing it.