I have this notetag on one of states
- <JS Post-Damage as Target>
//Does counterattack on enemy
if (this.isSkill() && this.item().id != 154 && user.isActor()) {
if (user.enemyId() === 12) {
target.forceAction(380, 1);
}
if (user.enemyId() === 13) {
target.forceAction(380, 2);
}
if (user.actorId() === 1) {
target.forceAction(381, 0);
} else {
target.forceAction(381, 1);
}
BattleManager.forceAction(target);
}
</JS Post-Damage as Target>
As you can see, it forces an enemy to use certain skill on either enemies or actors when struck, and it does works
on enemies, but doesn't detect actor hits at all.
And this is notetag I took as template for this one. And this one actually works, so I found it weird mine doesn't work. Any ideas how to solve it?
<JS Post-Damage as Target>
//Does counterattack on enemy
if (this.isSkill() && this.item().id != 154 && user.isActor()) {
if (user.actorId() === 1) {
target.forceAction(366, 0);
} else {
target.forceAction(366, 1);
}
BattleManager.forceAction(target);
}
</JS Post-Damage as Target>
EDIT: Solved, this is the right code
<JS Post-Damage as Target>//Does counterattack on enemy
if (user.isEnemy()) {
if (user.enemyId() === 12) {
target.forceAction(384, 1);
}
if (user.enemyId() === 13) {
target.forceAction(380, 2);
}
}
if (this.isSkill() && this.item().id != 154 && user.isActor()) {
if (user.actorId() === 1) {
target.forceAction(381, 0);
}
if (user.actorId() === 2) {
target.forceAction(381, 1);
}
else {
}
BattleManager.forceAction(target);
}
</JS Post-Damage as Target>