27999 sounds about right from what I recall.
Big tip if you want to add custom spells.
There are hundreds of unused spell IDs in the database and tons of just junk tests spells.
Run this and it will tell you all the unused spell id ranges.
Code:
SELECT a.id+1 AS start, MIN(b.id) - 1 AS end
FROM spells_new AS a, spells_new AS b
WHERE a.id < b.id
GROUP BY a.id
HAVING start < MIN(b.id);
Kayen