MZ Plugin to make skills have more than two required weapons

In my current project, magic users need to hold an arcane focus in one of their weapon slots in order to cast spells. I'd like to offer a variety of these, possibly up to ten: a spellbook, an orb, a wand, a staff, a rod, a small or large crystal, a geode, a grimoire (yes I know that's a spellbook but I'd differentiate the two on account of a grimoire's sentient nature), and a diamond. It would be nice to have a plugin where the required weapons for a skill could be modified via notetag. Just a thought. Otherwise I'll have to duplicate magic five times over in the database.

As an aside, it would be *really* rad if there could be an *armor* prerequisite for a skill.
Have you Googled it? I know people have made this - probably for MV, but I can't think of any part of the involved functions that should be different between the versions.

Hey, look...I even answered it for MZ already 😛

There's no equivalent function to see if a particular armor type is equipped, but you could do
Code:
user.armors().some(armor => armor.atypeId==x)
where x is the ID of the type you're looking for.
EDITED: So if I’m understanding correctly, with the Skills and States VS plugin I can type in the notes of a given skill:

Code:
<JS Skill Enable>
user.armors().some(armor => armor.atypeId==x || armor.atypeId==y || armor.atypeId==z)
</JS Skill Enable>

and it will make the skill dependent on x, y, or z, armor being equipped?
and it will make the skill dependent on x, y, or z, armor being equipped?
It will make it dependent on x, y, or z armor *type* being equipped. It could also be shortened a bit:

Code:
<JS Skill Enable>
user.armors().some(armor => [x, y, z].includes(armor.atypeId));
</JS Skill Enable>
It will make it dependent on x, y, or z armor *type* being equipped. It could also be shortened a bit:

Code:
<JS Skill Enable>
user.armors().some(armor => [x, y, z].includes(armor.atypeId));
</JS Skill Enable>
Even better. I have my armor types finely differentiated already—they aren't "light, medium, heavy" differentiations, they denote what the armor is in general, with different armors falling into these categories separated by +0, +1, +2, +3 qualities and durability characteristics. Glad to know that work wasn't for nothing. Thanks for the abbreviated solution.


Should work for MZ
It will make it dependent on x, y, or z armor *type* being equipped. It could also be shortened a bit:
Yeah, that was an older post before I familiarized myself with JavaScript's array functions 😉

Original thread: https://forums.rpgmakerweb.com/threads/plugin-to-make-skills-have-more-than-two-required-weapons.158597/