otland/forgottenserver

Items with percentage bonus attributes should recalculate the bonus value on level change

Open

#3,575 opened on Aug 17, 2021

View on GitHub
 (0 comments) (2 reactions) (0 assignees)C++ (1,145 forks)auto 404
good first issue

Repository metrics

Stars
 (1,813 stars)
PR merge metrics
 (PR metrics pending)

Description

Before creating an issue, please ensure:

  • This is a bug in the software that resides in this repository, and not a support matter (use https://otland.net/forums/support.16/ for support)
  • This issue is reproducible without changes to the C++ code in this repository

Steps to reproduce (include any configuration/script required to reproduce)

  1. Ensure that your hitpoints are set to your max hitpoints.
  2. Equip an item that utilizes an attribute such as maxhitpointspercent.
  3. Level up your character.
  4. (Optional: Take note of your hitpoints and relog, the value will change).

Expected behaviour

A character with 1000 health, on equipping an item with maxhitpointspercent attribute and a value of 105 (+5% bonus hitpoints) will have 1050 health (the value 50 will be put into varStats for this slot item). Once your character levels up (ex. a Knight gains 25 hitpoints per level) now you have 1025 hitpoints by default. The value inside varStats should be updated from 50 to 76 (rounded down from 76.25) for a total hitpoints value of 1076.

Actual behaviour

The value inside of varStats when leveling up in the above example is still 50 because the +5% bonus hitpoints from the equipped item does not get recalculated on level up.

Final thoughts

  • This is likely an extension of #2716.
  • This should account for when characters lose levels as well.
  • This should happen with the maxmanapointspercent attribute as well, or really, any attributes that use percentages.

Contributor guide