Hi everyone,
I'm trying to create a skill that removes a random buff from the target. So, if the target has 3 buffs, the skill selects one at random and removes it from the enemy, even if that buff has a stack; it's still removed, not just reduced. I've been using this code, but it doesn't seem to be working:
Eu estou usando o plugin YEP Buffs and States core
I'm trying to create a skill that removes a random buff from the target. So, if the target has 3 buffs, the skill selects one at random and removes it from the enemy, even if that buff has a stack; it's still removed, not just reduced. I've been using this code, but it doesn't seem to be working:
JavaScript:
<After Eval>
var chance = 0.25; // 25% de chance
if (Math.random() < chance) {
var buffParams = [2, 3, 4, 5, 6]; // ATK, DEF, AGI
var active = buffParams.filter(id => target.isBuffAffected(id));
if (active.length > 0) {
var paramId = active[Math.floor(Math.random() * active.length)];
target.removeBuff(paramId); // remove um buff aleatório
}
}
</After Eval>
Eu estou usando o plugin YEP Buffs and States core