Lifesteal

Discussion in 'RPG Maker MV' started by lithkast, Oct 26, 2015.

  1. lithkast

    lithkast Quirky mini boss Veteran

    Messages:
    105
    Likes Received:
    47
    Location:
    Nebraska, USA
    First Language:
    english
    Simple question.  Is there a way to make attacks lifesteal in MV. 



    Ex: Blood sword.  Its a weapon that will drain life from whatever it damages.  Preferably at a rate of 15-30% of the damage dealt.  So if 100 damage is dealt, you get 30 hp back. 

     

    I just want to know if there is a way in the base game to do that, or do I need to write a script for it.  Thanks in advance! ​
     
    #1
    PrkchpsNaplsaws likes this.
  2. OtakuD50

    OtakuD50 Villager Member

    Messages:
    26
    Likes Received:
    18
    Location:
    California
    First Language:
    English
    The closest thing I've found is in the Kadokawa plugins, there's a plugin called WeaponSkill.  What this does is allow you to add a tag for a weapon to make it perform a Skill when you use it to attack (default is the "Attack" skill, which should be your reserved #1 skill).  You can make a Skill that uses the HP Drain damage type and have the weapon use that skill for its attack.  However, as far as I can tell, you'll always absorb exactly the amount of damage you deal.
     
    #2
  3. SgtBusCake

    SgtBusCake Villager Member

    Messages:
    15
    Likes Received:
    7
    Location:
    East Coast
    First Language:
    English
    Hello Lithkast,

    Posting this here in case of future searches for things like HP Steal, Blood Drinker, Life Steal and Health Steal. Disclaimer: Still learning myself and may end up being a reference for myself if I put the tool down for a month for some reason.

    If you're using the HP Damage formula, you may be able to break down your equation in three pieces. The formula box likes to calculate statuses and recovering first, then damage last. In this case, we calculate the damage first to determine how much damage you could have dealt and store it, then apply the lifesteal's recovery effect (and make sure it does not return a decimal), then place the damage you stored at the end.

    For example, if you would like Blood Sword to life steal 15% of the damage you deal, then the following should work in MV (give or take how much Variance you have):

    c = a.atk * 4 - b.def * 2; a.gainHp(Math.round(c * 0.15)); cSimilarly, if you want a life steal of 30% of damage dealt:

    c = a.atk * 4 - b.def * 2; a.gainHp(Math.round(c * 0.30)); cHope that helps some.
     
    #3
    lithkast and therpgfanatic like this.
  4. highlord90

    highlord90 Aspiring Creator Veteran

    Messages:
    32
    Likes Received:
    10
    Location:
    Scotland
    First Language:
    English
    oh my god I am so darn stupid, I spent ages thinking I would have to script in a Leech Life effect when it was under my nose the entire time. I'm sorry this isn't what was asked for but thanks you OtakuD50, I made a rookie mistake
     
    #4

Share This Page