Convert Damage

Last Updated: 2013.01.18
Download Link
Github Link

This script gives actors, classes, equipment, enemies, and states passive convert damage HP/MP traits. By dealing physical or magical damage (dependant on the type of attack), attackers may recover HP or MP depending on what kinds of convert damage types they have.

These notetags can go in actor, class, weapons, armours, enemies, and state noteboxes.

<convert hp physical: +x%>
<convert hp physical: -x%>

Converts any physical damage dealt to recover HP by x% of the damage dealt. Bonus converted damage rates are additive. There will be no effects if HP to be healed is 0 or below.

<convert hp magical: +x%>
<convert hp magical: -x%>

Converts any magical damage dealt to recover HP by x% of the damage dealt. Bonus converted damage rates are additive. There will be no effects if HP to be healed is 0 or below.

<convert mp physical: +x%>
<convert mp physical: -x%>

Converts any physical damage dealt to recover MP by x% of the damage dealt. Bonus converted damage rates are additive. There will be no effects if MP to be healed is 0 or below.

<convert mp magical: +x%>
<convert mp magical: -x%>

Converts any magical damage dealt to recover MP by x% of the damage dealt. Bonus converted damage rates are additive. There will be no effects if MP to be healed is 0 or below.

You may set certain skills and/or items to not trigger any converted damage effects. This is primarily used for things that wouldn’t make sense to have converted damage (such as throwing a bomb).

<no convert>

Prevents any kind of converted damage effects from being applied when this skill is used.

Set certain actors, classes, weapons, armours, enemies, or states to prevent converted damage effects from being applied. These notetags can go under any of the mentioned noteboxes:

<anticonvert hp physical>
<anticonvert hp magical>
<anticonvert mp physical>
<anticonvert mp magical>

Prevents attackers from converting damage of those particular types. All converted recovery effects of that type will be reduced to 0.

And that’s all, folks!

52 comments on “Convert Damage

  1. Pingback: Stu-dying >.<" « Klaine's Zone

  2. With RPG Maker VX Ace in general, is it possible to have a skill that damages both your HP and your MP with different formulas? So, like dealing damage based on the default formula and decreasing your MP by x% of that amount?

  3. Is it possible to do something like lifesteal harming you if it is used against undead for example? So a “reverse” option in an enemy notetag? :) Just a suggestion though, this does what I need already.

  4. Hello Yanfly!
    While this script is great, I’m having trouble finding a way to edit the script so it can be applied to skills, as well as states, actors, classes, and so on. In most cases, when a feature like this is not extended to all aspects of the database, it can already be easily done with the default engine, however, I’m not finding this to be the case.

  5. If I equip a weapon which has [convert hp physical: +50%] in its notebox and I attack with a normal attack and I deal 100 damage, shouldn’t my actor get 50 HP healed? It doesn’t happen and I don’t know why. Am I misunderstanding something?

  6. Would it be possible to make only skills with certain attributes/elements trigger the conversion? For example, having something like so that a character only recovers HP/MP if they use a skill with the fire element?

    • Argh, it removed by tag. I mean, having something like [convert hp fire: +50%] so that a character only recovers HP/MP if they use a skill with the fire element.

      • I don’t think Element Absorb does what I suggested. Element Absorb allows you to set an actor, Actor A to be able to heal from damage from certain elements, right? What I suggested though, was that if Actor A deals fire damage to the enemy, Actor A will also heal, or convert, some of that damage dealt as health back to himself. Like lifesteal that only works if you do damage with a certain element. The only options in this script seem to be to differentiate whether you want to heal from physical or magical, but I didn’t see any ability to further specify whether you want to heal from elements or not.

  7. For me, this script doesn’t work at all as well, even though I put it under the Ace Battle Engine and tested many times, putting notes in states, weapons, and actors. My characters were not able to absorb any HP or MP using either physical or magical attacks. I copied and pasted both the script and notetages, and checked for errors, so I can’t for the life of me figure out what could possibly be wrong.

  8. To see the value on the Yanfli’s Ace Status Menu Script
    draw on “Draw_Property”:

    when :hp_physical
    return dy unless $imported[“YEA-ConvertDamage”]
    value = sprintf(fmt, @actor.convert_dmg_rate(:hp_physical) * 100)

    (example for hp_physical value)
    and on Properties_column

    [:hp_physical, “Drain Hp physical”], # You can change “Drain hp physical”

    to see the others values just change “:hp_physical” for :mp_physical, :hp_magical, :mp_magical….

    • You can aply your Recovery Rate changing:

      line 517 hp_healed = (@result.hp_damage * hp_rate).to_i
      by
      line 517 hp_healed = (@result.hp_damage * hp_rate * user.rec).to_i

      and

      line 537 hp_healed = (@result.hp_damage * hp_rate).to_i
      by
      line 537 hp_healed = (@result.hp_damage * hp_rate * user.rec).to_i

      If don’t work the scrip copy this script just ahead of Ace Battle Engine

  9. This script is not working for me even if I inserted above Ace Battle Engine or below it. Do I need any other script for this to work? I’ve tried putting the notetags onto everything, monsters and weapons and it fails to work either way.

  10. yeah, it about looks to me like this script just simply does not work. that’s a pity, i was hoping to make something like a “burn” state where an attacker suffers part of the damage they deal to their target. i really hope some sort of fix for this happens soon

  11. So I gave it a test and it works precisely as it says it should! :D (Note that I didn’t test too extensively, like with the no convert tag and whatnot, I haven’t gotten around to testing everything in every possible condition, aha)
    The only probelm I ran into is that “Certain Hit” is not an option. D= How would I set Certain Hit techniques to be converted?

    • Oh also, techniques that already have Drain cause a popup of both the original drain AND this drain, and it’d probably be nice if it were setup to stack as one single popup number.
      Um, this one is just an aesthetic request though really, so unless it’s a quick and easy fix you can ignore it. owo

  12. It works fine to me. A shame you cannot put the convert damage on skills or itens. Because if you wan’t to make an specific skill or item to steal hp/mp from the target at an specific rate (percentage) you just can’t.
    The other problem I’m having is that it is not showing the converted damage above the attacker (like in the image). Am I missing something?

  13. How do I change the script to convert any received damage instead? So I want to set up a state that absorbs magical attacks for x turns which will heal my mp x%.

  14. Okey guys all works fine,but specially for dummies like me:
    You cannot use CONVERT state for skills
    You cannot change ABSORB to CONVERT EFFECT(Ex:Lifedrain)and then put ANTICONVERT to your buff/passive to Null healing from dealed damage..
    ANTICONVERT cant Null helaling from ABSORB.
    U cant(not 100% sure)change the 100%-Nuliize ANTICONVERT,you cant make lets say 80%(Ex:Enemy dealed 100 dmg and with the help of my ANTICONVERT,enemy drains only 20 hp(convert rate is 100%)).
    P.S I’d very like to see TP convert in next update
    Hope this helps you.

  15. Great script once again.
    If you want the Rec (recovery) trait to be taken into account, you can add, in
    new method: apply_convert_physical_effect
    and right below
    hp_healed = (@result.hp_damage * hp_rate).to_i
    the following lines:

    if hp_healed > 0 #
    hp_healed*=user.rec #added to take Rec into account
    hp_healed=hp_healed.to_i #
    end #

    I use this so the characters can’t gain HP using damage conversion when affected by a “no healing” state, but it works with any Rec value. It won’t affect HP lost if the damage to HP conversion is negative.

    Disclaimer: I’m a newbie with Ruby, sorry if the code isn’t optimised.

  16. Is there any way to convert INCOMING damage into either Mp or Hp? Like take 100 physical and instead of losing hp you lose Mp instead?

  17. This script just ain’t working even when it’s in a new project by itself. I’ve placed the notetag every area to test it but still no joy. Any ideas how to make it work?

  18. I’m in the same boat as others with regards to MP conversion. HP conversion is working fine, but does nothing

  19. Found out the error
    at line 521 mp_healed = (@result.mp_damage * mp_rate).to_i should be
    mp_healed = (@result.hp_damage * mp_rate).to_i
    same for line 541

  20. Pingback: RMVXA Scripting Proficiency Levels | doublexrpgmaker

  21. I’m hitting a wall with this script in combination with Fomar’s Counter-Skill script: http://cobbtocs.co.uk/wp/?p=345
    When my actor counters with a skill, I get this error window:
    “Script ‘YEA – Convert Damage’ line 507 NoMethodError occured
    undefined method `no_convert’ for nil:NilClass”.
    How can I fix that?

  22. This is great. Any plans on making a script to convert costs?
    For example if an actor is inflicted with a state or something like that then the magic they have that costs MP will cost HP instead or TP. That would be really cool.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s