As you mentioned that it was 'sparking on its own' before it finally failed, I would suggest that you would need to replace the spark generator with a new part, but check the wiring that runs to it with a multimeter initially.
Rupert
March 2020
Automatic Answer
We may have found other answers which could help you.