MediaWiki:ClassSpellGroupOverrides.js: Difference between revisions

From EQOA Sandstorm Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 66: Line 66:
         spellPath: "1"
         spellPath: "1"
     },
     },
     "Zarakiel's Blessing": {
     "Zarakiel's Blessing": {
         spellGroup: "ExemplarPath",
         spellGroup: "ExemplarPath",
Line 83: Line 82:
         spellPath: "2"
         spellPath: "2"
     },
     },


     "Power Dance": {
     "Power Dance": {
Line 142: Line 140:
         spellPath: "2"
         spellPath: "2"
     },
     },
     "Pandemonium Power: {
     "Pandemonium Power": {
         spellGroup: "ClassPath",
         spellGroup: "ClassPath",
         spellPath: "both"
         spellPath: "both"
Line 181: Line 179:


     document.querySelectorAll('[data-eqoa-spell-path-list]').forEach(function (box) {
     document.querySelectorAll('[data-eqoa-spell-path-list]').forEach(function (box) {
        var groupName = box.getAttribute('data-spell-group');
         box.innerHTML =
         box.innerHTML =
             '<div class="eqoa-spell-list__title">' +
             '<div class="eqoa-spell-list__title">' +
                 (box.getAttribute('data-spell-group') === 'ExemplarPath' ? 'Paladin Exemplar Path Choice' : 'Paladin Class Path Choice') +
                 (groupName === 'ExemplarPath' ? 'Exemplar Path Choice' : 'Class Path Choice') +
             '</div>' +
             '</div>' +
             '<div class="eqoa-spell-list__loading">Loading spells...</div>';
             '<div class="eqoa-spell-list__loading">Loading spells...</div>';

Revision as of 00:55, 5 June 2026

window.EQOA_SPELL_GROUP_OVERRIDES = {
    "Shining Bastion": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Gleaming Bastion": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Hallowed Bastion": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Sacred Bastion": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Blessed Bastion": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Ozmo's Careful Teasing": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Ozmo's Infuriating Jeer": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },

    "Clay Barrier": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Marble Barrier": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Granite Barrier": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Iron Barrier": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Steel Barrier": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Talimus's Adamantine Barrier": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Talimus's Diamond Barrier": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Celestial Light": {
        spellGroup: "ClassPath",
        spellPath: "both"
    },

    "Alesthenies' Mercy": {
        spellGroup: "ExemplarPath",
        spellPath: "1"
    },
    "Zarakiel's Blessing": {
        spellGroup: "ExemplarPath",
        spellPath: "2"
    },
    "Zarakiel's Favor": {
        spellGroup: "ExemplarPath",
        spellPath: "2"
    },
    "Zarakiel's Fervor": {
        spellGroup: "ExemplarPath",
        spellPath: "2"
    },
    "Zarakiel's Touch": {
        spellGroup: "ExemplarPath",
        spellPath: "2"
    },

    "Power Dance": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Power Twist": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Power Jig": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Power Vibe": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Power Groove": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Celedonicus' Grand Finale": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },
    "Celedonicus' Inspiring Performance": {
        spellGroup: "ClassPath",
        spellPath: "1"
    },

    "Sweeping Flurry": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Flowing Flurry": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Fluid Flurry": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Decisive Flurry": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Elegant Flurry": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Pulsing Flurry": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Staccato Flurry": {
        spellGroup: "ClassPath",
        spellPath: "2"
    },
    "Pandemonium Power": {
        spellGroup: "ClassPath",
        spellPath: "both"
    }
};

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;

    document.querySelectorAll('[data-eqoa-spell-list]').forEach(function (box) {
        box.classList.remove('eqoa-spell-list-ready');

        box.querySelectorAll('.eqoa-spell-toolbar, .eqoa-spell-list-table, .eqoa-spell-empty').forEach(function (el) {
            el.remove();
        });

        if (!box.querySelector('.eqoa-spell-list__loading')) {
            box.insertAdjacentHTML('beforeend', '<div class="eqoa-spell-list__loading">Loading spells...</div>');
        }
    });

    document.querySelectorAll('[data-eqoa-spell-path-list]').forEach(function (box) {
        var groupName = box.getAttribute('data-spell-group');

        box.innerHTML =
            '<div class="eqoa-spell-list__title">' +
                (groupName === 'ExemplarPath' ? 'Exemplar Path Choice' : 'Class Path Choice') +
            '</div>' +
            '<div class="eqoa-spell-list__loading">Loading spells...</div>';
    });

    if (typeof initEqoaSpellLists === 'function') {
        initEqoaSpellLists();
    }

    if (typeof initEqoaSpellPathLists === 'function') {
        initEqoaSpellPathLists();
    }
}

mw.hook('wikipage.content').add(applyEqoaSpellGroupOverrides);
document.addEventListener('DOMContentLoaded', applyEqoaSpellGroupOverrides);
setTimeout(applyEqoaSpellGroupOverrides, 500);
setTimeout(applyEqoaSpellGroupOverrides, 1500);
setTimeout(applyEqoaSpellGroupOverrides, 3000);