Similar to games such as Etrian Odyssey or Romancing SaGa 3, this small snippet allows you to equip armors in armor slot with a shared name, but prevents you from wearing two armors of the same type. For example if you equipped an armor labeled as Head Gear, you're be prevented from equipping any other armors with that armor type.
Requirements:
YEP_EquipCore
YEP_X_EquipRequirements
While the code can more than likely be reduced in size, I've still a novice in javascript. The above example utilizes the Custom Equip Requirements Lunatic code in Equip Requirements.
To explain whats happening
refers to the Armor Slot ID.
refers to the Armor Type ID
The rest is basically a set of if and else statements that runs a check for each armor slot.
The End Results in this...
and this for the fourth, empty slot
Hope you have as much fun using it as I had making it!
Requirements:
YEP_EquipCore
YEP_X_EquipRequirements
Code:
<Custom Equip Requirement Condition>
if (user.equips()[4] && user.equips()[4].atypeId == 3) {
condition = false;
} else if (user.equips()[5] && user.equips()[5].atypeId == 3) {
condition = false;
} else if (user.equips()[6] && user.equips()[6].atypeId == 3) {
condition = false;
} else if (user.equips()[7] && user.equips()[7].atypeId == 3) {
condition = false;
} else {
condition = true;
}
</Custom Equip Requirement Condition>
While the code can more than likely be reduced in size, I've still a novice in javascript. The above example utilizes the Custom Equip Requirements Lunatic code in Equip Requirements.
To explain whats happening
Code:
user.equips()[x]
Code:
.atypeId == x
The rest is basically a set of if and else statements that runs a check for each armor slot.
The End Results in this...
Hope you have as much fun using it as I had making it!