Skip to content

Calculate leech with the PoE2 leech rules - #2550

Open
515k4 wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
515k4:feature/poe2-leech
Open

515k4 wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
515k4:feature/poe2-leech

Conversation

@515k4

@515k4 515k4 commented Sep 27, 2026 •

Copy link
Copy Markdown

Part of #328.

Description of the problem being solved:

Leech was still calculated the PoE1 way:

  • every leech instance recovered 2% of the pool per second, so how long it lasted depended on maximum life, mana or energy shield
  • instances stacked without limit, so leech kept scaling with attack speed
  • each instance was capped at 10% of the pool, and the total at 20% of life or mana (10% of energy shield) per second
  • "X% increased amount of Life/Mana Leeched" was parsed as an increase to that total cap, so the most common leech modifier on the tree did nothing unless a build was already at the cap

The PoE2 rules (poe2wiki: Leech, revision covering 0.5.0) are different. A hit leeches a percentage of its damage, recovered over one second. Only one leech instance per resource recovers at a time. Hits above 40,000 damage leech as though they dealt 40,000. There is no cap on a single instance or on the total rate.

What this PR changes

  • Amount: "increased amount of Life/Mana Leeched" (base_life_leech_amount_+%) now multiplies the leech per hit (LifeLeechAmount / ManaLeechAmount).
  • Duration: each instance recovers its amount over 1 second, divided by leech speed ("Leech Life X% faster"). The instant part of the leech is recovered on hit and shortens the instance by the same share, as in the wiki's example (1000 life with 20% instant: 200 at once, 800 over 0.8s).
  • One instance at a time: sustained leech is the rate of one instance times the share of time an instance is active, amount / duration × min(1, hit rate × duration). Hitting more often than once per instance duration no longer raises leech.
  • 40,000 damage cap: a hit that deals more than 40,000 total damage leeches as though it dealt 40,000, with every damage type scaled down evenly. This uses the existing EffectiveMaxDamageForLeech game constant.
  • PoE1 caps removed: the base cap mods and the "Leech Cap" rows are gone. So are the PoE1-only parser entries ("maximum recovery per leech", "maximum total recovery per second from leech", and two mods scaling with the leech rate cap) and two unused skill stat mappings. None of them appears in PoE2 item, tree or gem data.
  • Parsing: "Leech X% faster/slower" without a named resource now applies to life, mana and energy shield leech. It was unparsed before (IncreasedLifeLeechRateUniqueAmulet20).
  • Breakdown: the leech rate breakdown shows the rate of one instance and its uptime, and the leech rows list the amount and speed modifiers.

When dual wielding, per-weapon leech is combined the same way as average damage. Skills that alternate weapons, or hit once with each weapon, use the average leech per hit at the combined hit rate.

Not in this PR

  • Monster leech resistance. [0.5] Apply Enemy Leech Resistance and add Damage Cap for Leech #1938 adds it on top of the PoE1 caps. With this model it becomes a multiplier on the leech per hit.
  • The 40,000 cap and the choice of the active instance use the average hit. In game, a crit's larger instance takes priority over a smaller one while both are active.
  • "Leech X% faster" is taken to shorten each instance without changing the amount leeched. The wiki does not state this directly; it follows from its instant leech example.
  • Recovery rate modifiers still scale leech as before.

Steps taken to verify a working solution:

  • New spec/System/TestLeech_spec.lua with 12 tests. They cover amount modifiers for life and mana, the missing pool-based cap, one active instance above one hit per second and hit-rate scaling below it, faster leech, instant leech, the 40,000 cap with one and two damage types, "Leech X% faster", dual wield, and the breakdown. All 12 fail on dev and pass on this branch.
  • Full suite passes (884 tests).
  • ModCache regenerated. The only changes are the 26 "amount of Life/Mana Leeched" lines, now mapped to the amount modifiers, and "Leech 30% faster", which now parses.
  • Headless comparison: Punch, "Leech 10% of Physical Attack Damage as Life", 1115 life, 1725 average hit, 1.2 attacks per second, no crits:
Case Before (dev) After
Baseline 133.8/s (each hit cut to 111.5, 10% of life) 172.5/s
+ 50% increased amount of Life Leeched 133.8/s (only the unused cap rises) 258.8/s
+ 100% increased Attack Speed 223.0/s (at the 20% cap) 172.5/s

With 65 life and a 57 average hit, "Leech Life 50% faster" raised the leech per hit from 5.3 to 8.0 on dev. It now keeps the leech per hit at 5.7 and raises the rate from 5.7/s to 6.8/s, limited by 1.2 hits per second.

Link to a build that showcases this PR:

N/A

Before screenshot:

image

After screenshot:

image

🤖 Generated with Claude Code

Leech was still modelled on PoE1: every instance recovered 2% of the
pool per second, instances stacked without limit, each instance was
capped at 10% of the pool, and the total rate was capped at 20% of
life/mana (10% of energy shield) per second. "Increased amount of Life
Leeched" and "increased amount of Mana Leeched" only raised that total
rate cap, so they did nothing unless a build hit the cap.

PoE2 leech works differently (poe2wiki Leech, 0.5.0):
- a hit leeches a percentage of its damage, recovered over 1 second
- only one leech instance per resource recovers at a time
- hits above 40,000 damage leech as though they dealt 40,000, with
  every damage type scaled down evenly
- there is no cap on a single instance or on the total leech rate

Now:
- "amount of Life/Mana Leeched" multiplies the amount leeched per hit
- an instance lasts 1s divided by leech speed ("Leech X% faster"), and
  the instant part of the leech shortens it by the same proportion
- the sustained rate is one instance's rate times the time an instance
  is active, so hitting more than once per instance duration no longer
  raises leech
- the PoE1 caps, their base mods, parser entries and calcs rows are
  removed
- "Leech X% faster/slower" without a resource applies to life, mana and
  energy shield leech

Monster leech resistance is not included yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant