DarkstarProject/darkstar — pull request #566 by starlightknight (2014-11-08 13:53:14+00:00)
Title: CORE: Add Support to Restrict Spells/Abilities By Expansion 

Expands on 4af5e71d32a395b30bf678a57423c54628ded4f7 to support restricting spells & abilities by expansion too

============================================
Spells / Blue Spells
============================================

Adds support for restricting spells by expansion, where required_expansion = XXX, where XXX refers to ENABLE_XXX in settings.lua

I tried to implement this in a way where you could freely toggle expansions on and off while either playing or testing various things without data loss to the character's spell list just because some spells may be temporarily disabled.

So, what I did is provide a filtered array to the CharEntity that is a list of enabled spells. This is calculated when the character is loaded up, and then filtered against the loaded spell list, which is filtered by expansion.

When you learn new spells, it is added to both of the arrays. The full array is what gets saved back to the db, but the filtered one is what is send in the spell packet.

I used Gekka & Yain Ichi as examples. With the change i was able to ENABLE_SOA = 1, learn Gekka: Ichi & Yain: Ichi, restart with ENABLE_SOA = 0, and see that the spells were gone. At that point, if I added a scroll of Gekka Ichi to my inventory and tried to learn it, it told me I didn't meet the requirements. I then restarted with ENABLE_SOA = 1 again and the spells were back an working

For blue spells, I linked their require_expansion to the main one in spell_list so that maintenance is not duplicated, and then added handling so that if a spell gets disabled while its set, its removed from the set spells list as well as the list of spells

I do not have any blue spells disabled on the committed yet, but I temporarily added some locally for testing, and I was able to verify that the handling when a spell is disabled while its set works.

I also updated the loading of mob spell lists to filter out any spells that are disabled.

============================================
Abilities
============================================

Similar to Traits/Spells, add column required_expansion, where the value if XXX, referring to ENABLE_XXX in settings.lua

Proof of concepts: Tag Mikage & Stymie to SOA, since they were introduced post-SOA. Work on a more thorough pass after I get the core support in to avoid merge conflicts.

Tests: NIN99/RDM99 - ENABLE_SOA = 1, has Mikage/Stymie, reboot with ENABLE_SOA = 0, does not have Mikage/Stymie

============================================
Future
============================================

I will do a pass tagging spells and such to their appropriate era after we get the core changes in to avoid potential merge conflicts while I gather that data. This will help keep things more accurate for people who want to play classic, especially for new lower level spells/traits/abilities, and also allow us to keep jobs up to date without worrying about impact balancing as more modern spells/abilities from the SOA era start to get coded.