so.. i wanted to have a bit of fun with your original code.. so i tore it to pieces...
- optimized to use arrays for quicker additions/subtractions of spells
- added in a feature to enable/disable any spell
- added level requirements
- reduced the script by ~2000 lines
pastebin
note: kept getting internal server errors every time i tried to post the code here... pastebin it is :(