Player Invincibility

Hello!

I am trying to make a skill that turns an ally invincible for 3 turns, but immobilizes the user for the same 3 turns.

Now, I’ve dealt with the immobilization part… but I can’t seem to turn the target invincible…

And by that I mean not taking any damage... everything I found via search seems to be about death resistance...

Does anyone know if it requires a script or something… or if it can be done with rpg maker alone?
You could make physical and magical damage rate to 0%
I would also set magical evasion and evasion to 100%
I used Yanfly's lunatic scripts to do this, and set the invincibility state to block 9999 damage, Will work unless some enemy of mine ever does over 9999 damage.
I tried setting the physical/magical dam. Rate and Evasion, but that only half-worked… 

So I tried Yanfly's scripts… ‘Lunatic states’ and ‘Lunatic states Protection’.

It works just great now! Or at least it seems so…

Thank youuuu! ^_^
Just be careful, I did find a bug in Yanfly's lunatic states where it applies each state as many times as there are states on the party! For instance, if you have poison, blind, and damage block 15 on a player, it runs damage block 15 3 times (as you have 3 states on the character), and ends up blocking 45 damage! You can test this by giving a player 3 - 5 states, the damage block, and then have them fight a monster with no variance that does a flat fixed damage, and notice the difference in damages.

Edit: For the technical people, the reason it happens is Yanfly did for each in states do, then inside that is another for each in states do, so it loops n^2 times, where n is the number of states you have on the player, and the outer loop makes it reapply the lunatic protection the extra times.
@bgillisp

Hmmm... I tested and it seems to work okay with up to 6 states...

I'll keep an eye on it, though, just in case...

... From that edit I only understood the n^2 part... and something about loops...

Man, I have a lot of learning ahead of me...

 
Its not a big deal if you want invincibility, as it will make you invincible (just even more so). Just be careful if you ever want it to block only the first 100 HP of damage, as you might suddenly get it blocking 300 or 400 HP of damage due to that bug.
Oh, I get it... that would be a problem...

Anyway, mission accomplished!

Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/player-invincibility.35273/