- Joined
- Dec 27, 2016
- Messages
- 4
- Reaction score
- 1
- First Language
- German
- Primarily Uses
I wanted to create a warrior class with a lot of different physical skills, depending on the weapon he uses. But I felt that choosing two different weapons as a requirement for the skill wasn't enough. With Yanflys Weapon Mastery Passive (Tips and Tricks) as inspiration and Skill Core plugin I came up with a solution.
So for anyone who was looking for something like this or maybe for those who didn't know they could need it.
This could be useful if the warrior has some melee aswell as ranged skills (with bows for example). He could now use his melee skills only with all the melee weapons and the ranged skills only with all the ranged weapons ingame.
So for anyone who was looking for something like this or maybe for those who didn't know they could need it.
<Custom Requirement>
// Get all currently equipped weapons for the user.
var weapons = user.weapons();
// Set the weapon types to use the skill with. In this case weapon types 1 to 6.
var fav = [1,2,3,4,5,6];
// Set the initial condition to be false.
value = false;
// Loop through each of the weapons.
for (var i = 0; i < weapons.length; ++i) {
// Get the currently looped weapon.
var weapon = weapons;
// Check if the weapon exists and if the weapon type ID is in the array of required weapons.
if (fav.indexOf(weapon && weapon.wtypeId) !== -1) {
// Set the condition to be true.
value = true;
// Break the loop.
break;
}
}
</Custom Requirement>
// Get all currently equipped weapons for the user.
var weapons = user.weapons();
// Set the weapon types to use the skill with. In this case weapon types 1 to 6.
var fav = [1,2,3,4,5,6];
// Set the initial condition to be false.
value = false;
// Loop through each of the weapons.
for (var i = 0; i < weapons.length; ++i) {
// Get the currently looped weapon.
var weapon = weapons;
// Check if the weapon exists and if the weapon type ID is in the array of required weapons.
if (fav.indexOf(weapon && weapon.wtypeId) !== -1) {
// Set the condition to be true.
value = true;
// Break the loop.
break;
}
}
</Custom Requirement>
This could be useful if the warrior has some melee aswell as ranged skills (with bows for example). He could now use his melee skills only with all the melee weapons and the ranged skills only with all the ranged weapons ingame.






