I'm not sure how to build a state like this, but here's the description:
Passive State - Berserker
Any physical attacks/skills you deal have a 10% chance to apply the "Enrage" state to your character.
Thank you for your time!
On it. I'll post an answer soon enough
That's good, but not quite correct. It should look like this, I think:
<custom establish effect>
//Replace enrageId with whatever state ID you wanna add
enrageId = x
if (value > 0 && this.isPhysical() && this.isHpEffect()){
randNo = Math.random();
//If you wanna change the percentage 1.0 is 100%, 0.01 is 1%, 0.5 is 50%, etc.
if (randNo < 0.1){
user.addState(enrageId);
}
}
</custom establish effect>
First, the effect should be Establish, not Respond. Respond occurs when an enemy attacks the target with the state. Establish occurs when the attacker HAS the state.
Next, to ensure that the effect doesn't trigger off a magic effect, I added this.isPhysical() and this.isHpEffect() to the conditions. Since the effect is only triggered by physical attacks, leaving out this.isPhysical() allows a magical attack to trigger it as well. The HpEffect line checks if the effect alters the HP of the target. You may not need that part, depending on the exact conditions of the Berserk effect, but it's there if you need it.
Ah, I misread the OP and thought they were going for a gets angry when hurt kinda thing. Thanks for having more scrutinous eyes than I