Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 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 642 08-30-2023, 08:54 PM
Last Post: kyonides
   Klass Change & Skills kyonides 1 574 05-29-2023, 07:39 AM
Last Post: kyonides
   KDualWield & Accessory Skills kyonides 1 726 02-10-2023, 06:53 AM
Last Post: kyonides
   ACBS - Atoa Custom Battle System 3.2 Victor Sant 150 221,459 03-02-2019, 04:47 AM
Last Post: dragonprincess44
   DoubleX RMVXA Unison Skills/Items DoubleX 1 6,072 07-23-2015, 11:47 AM
Last Post: DoubleX
   Lycan Slip-Thru Items/Skills DerVVulfman 0 4,349 03-14-2013, 07:02 AM
Last Post: DerVVulfman
   Victor Engine - Cooperation Skills Victor Sant 2 7,819 02-14-2013, 04:44 PM
Last Post: Ace
   Skills : Replacements Kain Nobel 0 4,262 12-29-2012, 07:16 AM
Last Post: Kain Nobel
   Victor Engine - Active Time Battle Victor Sant 0 4,857 12-16-2012, 08:17 PM
Last Post: Victor Sant
   Legacy's 1-Man Custom Menu System Legacy 2 6,659 11-13-2012, 04:53 AM
Last Post: Legacy



Users browsing this thread: