MediaWiki:ClassSpellGroupOverrides.js
From EQOA Sandstorm Wiki
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
window.EQOA_SPELL_GROUP_OVERRIDES = {
"Alesthenies' Mercy": {
spellGroup: "ExemplarPath",
spellPath: "1"
},
"Zarakiel's Blessing": {
spellGroup: "ExemplarPath",
spellPath: "2"
},
"Zarakiel's Fervor": {
spellGroup: "ExemplarPath",
spellPath: "2"
},
"Zarakiel's Touch": {
spellGroup: "ExemplarPath",
spellPath: "2"
}
};
function applyEqoaSpellGroupOverrides() {
var spells = window.EQOA_GENERATED_SPELLS || [];
var overrides = window.EQOA_SPELL_GROUP_OVERRIDES || {};
if (!spells.length) {
setTimeout(applyEqoaSpellGroupOverrides, 250);
return;
}
spells.forEach(function (spell) {
var override = overrides[spell.name];
if (!override) return;
spell.spellGroup = override.spellGroup || spell.spellGroup || 'Base';
spell.spellPath = override.spellPath || spell.spellPath || '';
});
window.EQOA_SPELL_GROUP_OVERRIDES_APPLIED = true;
if (typeof initEqoaSpellLists === 'function') {
document.querySelectorAll('[data-eqoa-spell-list]').forEach(function (box) {
box.classList.remove('eqoa-spell-list-ready');
});
initEqoaSpellLists();
}
if (typeof initEqoaSpellPathLists === 'function') {
initEqoaSpellPathLists();
}
}
mw.hook('wikipage.content').add(applyEqoaSpellGroupOverrides);
document.addEventListener('DOMContentLoaded', applyEqoaSpellGroupOverrides);
setTimeout(applyEqoaSpellGroupOverrides, 500);
setTimeout(applyEqoaSpellGroupOverrides, 1500);