[SOLVED] Skill Custom Requirement armor equipped

Raystorm7

Villager
Member
Joined
Aug 14, 2014
Messages
29
Reaction score
0
First Language
Italian,English
Primarily Uses
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!
 
Last edited by a moderator:

Astfgl66

Veteran
Veteran
Joined
Jan 5, 2016
Messages
722
Reaction score
578
First Language
French
Primarily Uses
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.
 

Raystorm7

Villager
Member
Joined
Aug 14, 2014
Messages
29
Reaction score
0
First Language
Italian,English
Primarily Uses
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 :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top