Hi, I'm a dev at a private server that's using a MaNGOS-based core now, and we've decided to submit some of our changes back to the community here, in the hope that they will be helpful. Not everything will be drop-in compatible, but most of it should be usable with only minimal editing.
The first thing we'd like to give you guys is a sane way to deal with spell class/family masks. These are 96-bit sets of binary flags that help class spells decide which other spells to affect or be affected by. Currently they're stored alternately as an array of 3 uint32's or a uint64 and a uint32. Also, when they're used in code the flags are hard-coded, making the code hard to read and harder yet to update for new versions and debug.
SpellClassMask.h contains the masks and flags enum'd out for every class, up to date for 3.1.x. These change very little from version to version FYI. It also contains a data type (SpellCM) that can be used as both a std::bitset<96> and an array of 3 uint32's. It uses std::bitset<96> as it's parent class, so all binary ops & << >> ~ etc should work on it as if it were a 96-bit number. See the class definition at the bottom for full details.
SpellCM.diff is the patch that implemented it on our server. You should only need to change a few lines to make it useable. If you look through the file you should be easily able to tell how to use the SpellCM class.
I don't seem to have permission to post attachments, so I guess I'll just paste them in here as replies ~Loki