I'm trying to go about creating a skill that would restore the user's hp if it kills an enemy, in a similar vein to Fell Stinger from Pokemon. Would there be any way to create this skill using damage formulas?
Creating a "finishing blow" skill
RPG Maker VXAce SupportThere is a way of doing this using damage formula but I think there are better ways. To do it using damage formulae you have to:
Another way of doing this (if you don't want/know how script it) is to use troop events.
These two methods are just few ways of handling this without using scripts. Keep in mind that - of course this is my opinion - using a script is the best way.
- check if target has any immortal state;
- check if target has any kind of resistance to that damage;
- calculate virtual damage dealt (taking into account damage reduction);
- calculate virtual remaining hp (b.hp - b.virtual_dmg);
- if your virtual damage reduces enemy's hp to 0 then you can heal the user.
Another way of doing this (if you don't want/know how script it) is to use troop events.
- Store both user and target in a variable then turn on a switch;
- At the end of each turn check if the switch is on then turn it off (don't forget to turn it off!!!!);
- If the switch is on force your character (the one stored previously) to cast another skill on the target (the one stored in your other variable);
- After the skill is executed check if the number of alive enemies is the same as before;
- If the number of enemies decreased heal your character.
These two methods are just few ways of handling this without using scripts. Keep in mind that - of course this is my opinion - using a script is the best way.
Yeah, I was thinking that using some kind of script would be much easier in achieving this effect, but I can't seem to find any that'll help me create this skill. Thanks for the help, though.
If you can't find anything then you can try one of the methods above. They are not the best solution to your problem since they have pros and cons but they still work.
Original thread: https://forums.rpgmakerweb.com/threads/creating-a-finishing-blow-skill.86293/