Draining Skills! / Compatible with ABSes and custom non-active BSes / No SDK required
#1
Greetings, companions of RPG Maker XP!

Today, I've developed a small add-on which adds Draining Skills to RMXP, which means that some heroes (and enemies as well!) may recover HPs depending on the damage inflicted to their target. Since this is not a proper script, but an add-on, you must follow those instructions to make them work^^

Instructions

First of all, you need to create an element in the database which will be the one for our draining skills (important!). You can name it as you wish. Then, to set how much percentage of HP will be recovered, (e.g. 50%, 30%...) you must put inside the STR_F field of the skill the proper number (e.g. 50, 30...). Then, check if your BS has a configuration module (you can recognize it by the format "module [name]"). If you have one, just copy this small string inside the configuration module:
Code:
DRAINING_MOVE = 28 # In my case it's the 28th element. Be sure you put the proper number

If you DON'T have a custom a BS, here's the module:

Code:
module Doc
  DRAINING_MOVE = 28
end

Be sure to place this module above the Game_Battler scripts

Then, right-click on the list of scripts, and search for the string "def skill_effect(user, skill)" and jump on that page (keep in mind, if you have a custom BS/ABS, you must use its scripts, not the game defaults!)

Scroll some lines down until you find the string "self.hp -= self.damage"

Then, DIRECTY below it, paste this code:

Code:
      # Draining Skills
      if skill.element_set.include?([yourmodulename]::DRAINING_MOVE) && user.hp != user.maxhp
        percentage = skill.str_f.to_f / 100
        user.damage = [(0 - [last_hp, self.damage].min*percentage),0].min.to_i
        user.hp -= user.damage
      end

That's it. After you've done all the steps correctly, you can use your draining skills at your wish to recover the desired amount of HPs. Furthermore, as long as you have maximum HP, you won't recover more

Happy making^^
"Fairies are bad. I had to kill an innocent and fight my own sister to save the world, and they looked at me disgusted and left me dying. Two years later, I was revived and had to sacrifice another innocent with a Dark Ritual to save the world again. That's why I became a Succubus. And I don't regret it"
- The Khaleesi, Queen of Apocalypse and of the Succubi
[Image: katy-succubus-on-couch-modding-union-signature.png]
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   MKXP Compatible Mouse Add-on DerVVulfman 1 1,478 08-30-2023, 08:54 PM
Last Post: kyonides
   Klass Change & Skills XP kyonides 1 1,334 05-29-2023, 07:39 AM
Last Post: kyonides
   KDualWield & Accessory Skills XP kyonides 1 1,416 02-10-2023, 06:53 AM
Last Post: kyonides
   ACBS - Atoa Custom Battle System 3.2 Victor Sant 150 259,792 03-02-2019, 04:47 AM
Last Post: dragonprincess44
   Lycan Slip-Thru Items/Skills DerVVulfman 0 4,867 03-14-2013, 07:02 AM
Last Post: DerVVulfman
   Skills : Replacements Kain Nobel 0 4,884 12-29-2012, 07:16 AM
Last Post: Kain Nobel
   MrMo's Item-Using Skills DerVVulfman 0 5,442 04-05-2012, 03:52 AM
Last Post: DerVVulfman
   Passive Skills DVV DerVVulfman 12 24,559 08-03-2011, 03:53 AM
Last Post: DerVVulfman
   Conditional + Combo Skills Trickster 1 8,836 10-21-2010, 04:17 AM
Last Post: DerVVulfman
   FFIX Skills Learning System aka Equipment Skills, NEW!!! v2.3 (8-8-2010) Charlie Fleed 13 30,086 10-13-2010, 05:17 PM
Last Post: Charlie Fleed



Users browsing this thread: 1 Guest(s)