LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI. Just an X-34 landspeeder out for a drive.

Home Page:https://landsandboat.github.io/server/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› Max HP/MP gear and effects are calculated incorrectly

DiscipleOfEris opened this issue Β· comments

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my issue will be ignored.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.

OS / platform the server is running (if known)

Windows10

Branch affected by issue

base

Steps to reproduce

  1. Equip a variety of HP/MP+ gear, convert HP <-> MP gear, HP/MP+% gear. Eat HP/MP+ food and HP/MP+% food.
  2. Check HP/MP in various combinations, including with weakness, curse, and Mantra.
  3. See it does not follow the behavior outlined below.

Expected behavior

From retail tests I and Siknoz have conducted, HP+% gear is applied after HP changes from all non-HP+X% mods. This includes HP gained/lost from HP+X gear, convert HP<->MP gear, and HP+X food.

Food HP+X% mods are multiplicative with gear/ability HP+X% mods.

On the other hand, weakness still affects only the base HP, before gear or other mods. That means it must be handled different from gear HP+%, such as with a different mod. Curse seems to apply after gear HP+X mods but before convert mods and HP+X food.

So the formula should look something like this:

maxHP = ( { [ (baseHP * weaknessHPP) + gearHP] * curseHPP} + foodHP + convertHP) * gearHPP * mantraHPP * foodHPP

With a floor after each multiplication.

In conclusion:

  • baseHP includes merits and job traits.
  • HP+X% gear is more powerful with convert gear and HP+X gear/food, but is nerfed by curse/weakness.
  • Ditto HP+X% food, but also multiplicative with HP+X% gear.
  • HP+X gear ignores weakness but is nerfed by curse.
  • Convert gear and food ignore both weakness and curse.
  • Convert gear is applied after food HP+X. That is, if you have 1 HP and 0 MP and equip convert 25 HP to MP, you'll still have 1HP and 0 MP. But if you eat HP+25 food and equip the convert gear, you'll have 1 HP and 25 MP.
  • From other testing Mantra stacks multiplicatively with HP+% gear, so it is either a third multiplicative HP+% or it stacks additively with food HP+%.
  • I didn't test the interaction between Convert HP to MP gear equipped at the same time as Convert MP to HP gear.
  • I have not tested where HP/MP merits come in.
  • My testing with curse was done using the Beadeaux curse aura, which has a ~-70% curse (multiplies max HP by 75/256 or 12/41), and I'm assuming it follows the same rules as other max HP curses.

Related, on LSB HP/MP % latent trigger thresholds are currently based off of your base HP/MP with no modifiers whatsoever, rather than the current max HP/MP. Not even Max HP/MP boost traits count for the calculation, but HP/MP merits do count for that.

Thank you for bringing Max HP traits to my attention. I didn't think to test where those might exist in the formula.

That's a separate issue where the latent effect is checking health.maxhp instead of health.modhp or GetHPP(). Also, some HPP latent effects work differently than others. Namely, Medicine Ring and Minstrel Ring are based on current HP < 76% (includes all HP sources), whereas Sorcerer's Ring is based on some arcane (and likely unintentional on SE's part) combination, ignoring convert HP and HP+% gear and treats slots somewhat inconsistently (it seems to ignore specifically the back slot and the right ring slot).

From the formula here, Medicine Ring would just be:

GetHPP() <= latent

Whereas Sorcerer's Ring would be:

latentMaxHP = (baseHP * weaknessHPP) + gearHP
health.hp / latentMaxHP * 100 <= latent

I'm just ignoring the slot-inconsistency (and assuming for now that trait HP is at the same spot as food HP). Also not sure which side of the equation curse is on.

https://www.bluegartr.com/threads/56931-Sorcerer-s-Ring?p=1981832&viewfull=1#post1981832

Tested, and max HP job traits (and presumably merits) affect baseHP.

From testing, Max HP Down debuff is a HP multiplier that is probably either additive with or multiplicative with curse. Gear HP was reduced but convert HP had its full effect. The duration of ram's Great Bleat is quite short so it's hard to test.