I want to make a weapon that has an interesting ability, but am wondering if it is possible and what I need to do to get it to work. I want an axe to hit an enemy and heal the wielder for half the damage they deal to the enemies, but then, at the end of each turn, the axe saps away a small part of the wielders health. I know how to do the sapping away health part, but am a bit lost on how to do the hit and heal for damage part. How would I do this? Thanks for any help.
Special Weapons
RPG Maker MV SupportThere is this thread that explain it for you.
HP Drain - Skills
Hello, I would like to understand how the HP drain option works in the skill section. How can I create a standard move that deals, for example, 100 damage and heals the user for half of the damage inflicted on enemies? I've searched within the forum threads for similar topics, but I'm having...
forums.rpgmakerweb.com
That's a fairly simple request. The life leech can be accomplished within the damage formula. Example:
As for the DoT on the weapon itself, you probably want to be using yanfly's Battle engine core, buff/States core, Auto passive states and Extended DoT plugins. With those you can simply give your axe a notetag that applies a state to the wielder, in which you can simply add a damage formula into the states notetag. Example:
Code:
c = a.atk - b.def; a.gainHp(Math.round(c * 0.5)); c
As for the DoT on the weapon itself, you probably want to be using yanfly's Battle engine core, buff/States core, Auto passive states and Extended DoT plugins. With those you can simply give your axe a notetag that applies a state to the wielder, in which you can simply add a damage formula into the states notetag. Example:
Code:
<DoT Formula: a.atk * 0.5>
basically store the damage calculation in a temporary variable before using it twice, first healing the user by half and then doing damage.
It can be dome in the damage formula as long as you never use auto battle, although using action sequences is cleaner if you have such a plugin.
example:
r=4*a.atk - 2*b.def; a.hp += r/2; r
(untested quick answer)
EDIT:
@SGHarlekin while your answer is cleaner than mine, it doesn't work that way. damage is always the last number processed in the formula, that's why you need to store the number and use it after healing, not before
It can be dome in the damage formula as long as you never use auto battle, although using action sequences is cleaner if you have such a plugin.
example:
r=4*a.atk - 2*b.def; a.hp += r/2; r
(untested quick answer)
EDIT:
@SGHarlekin while your answer is cleaner than mine, it doesn't work that way. damage is always the last number processed in the formula, that's why you need to store the number and use it after healing, not before
Right, I edited the formula.
its worth noting that if the axe is meant to drain damage dealt as a passive and its supposed to work for all skills or certain types of skills, youd want to use yanfly's buffs and states plugin alongside the auto passive states plugin to tie it to the axe.
if the axe just has a special skill that drains hp, when it can be done with just the formula as shown above
if the axe just has a special skill that drains hp, when it can be done with just the formula as shown above
Oh right, I complete forgot about that, ha.
Thank you all so much for the help. I was able to get it to work and I appreciate yall.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/special-weapons.174849/