I'm looking for help on how to make a state that utilizes counters for each hit on a target, then uses those to stack up lifesteal, up to a limit of 20, worth 5% each. I think this would be easier if I knew how to (call?) lifesteal like other values but right now I have this complicated mixture that doesn't work from other skills I wrote and found.
TLDR; Hit enemy, get 5% lifesteal per hit, not steal 5% life per hit, but actually increase the rate of lifestealing.
I'm not sure if user.LifeStealRate works at all.
I thought it'd start sort of like this (this clearly doesn't work but the idea is there) :
TLDR; Hit enemy, get 5% lifesteal per hit, not steal 5% life per hit, but actually increase the rate of lifestealing.
I'm not sure if user.LifeStealRate works at all.
I thought it'd start sort of like this (this clearly doesn't work but the idea is there) :
Code:
<Custom Confirm Effect>
// Check if the damage dealt deals physical HP damage.
if (value > 0 && this.isHpEffect()) {
user._stackinglife = user._stackinglife || 0;
// Get the current number of stacks. Min 0, Max 20.
var stacks = user._stackinglife.clamp(0, 20);
// Increase stack count.
stacks += 1;
// Set stack count min to 0, max to 20.
stacks = stacks.clamp(0, 20);
user.setStateCounter(stateId, 'x' + stacks);
user._stackinglife = stacks;
var bonus = (stacks * 0.05)
dmg = Math.ceil(value * bonus);
user.gainHp(dmg);
user.startDamagePopup();
user.clearResult();
}
</Custom Confirm Effect>
<Custom Remove Effect>
// Reset the stack count.
user._stackinglife = 0;
</Custom Remove Effect>