[SOLVED] Skill Custom Requirement armor equipped

Hi, I would like to check if the user of a skill is equipped a specified type of armor (like shield, heavy armor etc..).


I've seen that already exists the possibility to check weapons with isWtypeEquipped(indx).


I've used this script for to check weapons (using yep skill core plugin):


<Custom Requirement>
if (a.isAtypeEquipped(2)) {
value = true;
} else {
value = false;
}
</Custom Requirement>




But "isAtypeEquipped" does not exists xD


Is there any plugin\script that I can use for check if a armor type is equipped?


Thanks!
Here is the script call to return an armor type id:


$dataArmors[armorId].atypeId


With this it should be easy to build the function you want. Just check if the equips of calling actor conatins at least 1 equipment with the type id you need.
Thanks @Astfgl66!


I've found this script: 


a.equips()[indx]


where indx is the slot of equip type.


So, for example, if shield is the second of "Equipments Types" list, for check if the current player is wearing a shield the script become:


a.equips()[1]


1 because array (= list) in javascript starts at 0.


In this case the full script in skill's note become:


<Custom Requirement>
if (a.equips()[1]) {
value = true;
} else {
value = false;
}
</Custom Requirement>




Hope this helps 🙂

Original thread: https://forums.rpgmakerweb.com/threads/solved-skill-custom-requirement-armor-equipped.63035/