Geigerkind wrote:@Schaka
Correct. With the addition to verify if the spell is actually interrupted.
Btw. I tried using your spell DB but it is a bit too huge, which causes a little lag. Is there a version with class and boss spells only? I may use it incorrectly as well.
So the way you do it is by checking whether the caster cast another spell of the same school within the next 5, 6 or 8 seconds (physical, spell lock, counter spell)? That's pretty smart, actually.
As for my spell DB, it's almost exclusively key - value lookup. Execpt sometimes you get a whole table returned with about 5 results. I don't have a version with just class spells, unfortunately. But I guess you could look into how MSBT (by Athene) does it? He must have all the important class spells.
Edit: I just realized lookup by name and icon iterate through the entire table (which is like 30000 entries). I guess it would make sense to cause some data redundancy and make sure you have smaller lookup tables for spell by name using key-value as well.
But the best quick fix would be to just cache the tables that are returned by GetSpellInfoVanilla. Like, say you search for <name>, a and the result is a table with 3 entries, you just cache that table and make GetSpellInfoVanilla (or your own lookup function) check the cache before doing the slow iteration. That way you have one slow lookup per session (or only once, if you keep the cache in SavedVariables). If you should make this an addition to my DB, you're welcome to do a pull request