lunatic states -> drain hp over time/ heal if enemy hit

Thanks for looking into this post!

So first of all: I just started using the rpg maker, so i don't really know scripting well. And there lies probably my problem.

I really wanted to make a spell which gives the enemy a status effect, which deals dmg to them each round and heals the party member who used it in the first place at the same amount.

Or the other solution was a spell which gives the enemy a debuff and everytime the enemy suffers dmg, the caster of the debuff gains health in the amount of dmg the enemy took or a fraction of it.

I tried to make the functions with the in-build status effects and spells but i don't know how it would exactly work and so i searched the internet for possible solutions.

It was then when i come across the script of Yanfly which should be able to do atleast one part of what i wanted.

Links:

https://yanflychannel.wordpress.com/rmvxa/battle-scripts/lunatic-states/

https://yanflychannel.wordpress.com/rmvxa/battle-scripts/lunatic-states/lsp-punishment/

But as inexperienced as I am, i don't know how to use them....

The actual solution looks easy because in the lsp punishment link is a status effect, which i want to use, but i just don't know how.

The specific status effect i would like to use is called "Punish Effect No.7: Drain HP"

#---------------------------------------------------------------------- # Punish Effect No.7: Drain HP # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Best used with shock effect. Whenever user takes HP damage, the # original caster of the state will heal HP based on HP damage dealt. # # Recommended notetag: # <shock effect: drain hp x%> #---------------------------------------------------------------------- when /DRAIN HP[ ](\d+)([%%])/i return unless @result.hp_damage > 0 dmg = (@result.hp_damage * $1.to_i * 0.01).to_i if $imported["YEA-BattleEngine"] && dmg > 0 Sound.play_recovery text = sprintf(YEA::BATTLE:😛OPUP_SETTINGS[:hp_heal], dmg.group) user.create_popup(text, "HP_HEAL") end state_origin.hp += dmg Well that's where i stand now and would like you to help me.

I know it's a very dumb scenario, because Yanfly even said that it would require scripting knowledge to use her scripts, so.....

Thank you for reading this

Maybe someone is able to help me.

Edit:

Found out how to use the scrips....
I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/lunatic-states-drain-hp-over-time-heal-if-enemy-hit.42455/