Requesting 'Exploding state'

Need a "State Script" that activates when the character with the state is attacked.

Here is the mechanic:

Spoiler
>Caster curses an enemy with stun, not just stun effect...

horriblesubs-log-horizon-04-720p-mkv_snapshot_19-59_2013-10-27_23-35-06.jpg


...when the stunned enemy is attacked, it will deal pure damage to the enemy who has the stun state.

Log-Horizon-Thorns.jpg


KABOOM! He dies,....

just as planned

6936bbb69a3d9ff4f4850f0e927f5ca7.jpg
...so basically, just like "Thorn Bind Hostage" effect.
You don't need a script if it's just one skill which will do this.

Create your state - let's call it Cursed chains with the ID of 43 for the sake of argument which is inflicted with the skill Curse.

In the damage formula for the skill which will take advantage of this state you have

[SIZE=10.5pt]b.state?(43)? b.add_state(1) :normal_attack_formula_here[/SIZE]

[SIZE=10.5pt]That is saying - if state 43 is present, add state 1 (death), if not do this normal damage, or whatever you want to happen if the state is not inflicted.[/SIZE]

[SIZE=10.5pt]If you wanted to combine the skill Curse with the damage dealing skill, it would be[/SIZE]

[SIZE=10.5pt]b.state?43)? b.add_state(1) : b.add_state(43)[/SIZE]

Original thread: https://forums.rpgmakerweb.com/threads/requesting-exploding-state.42337/