[lua] Fix Casket Drop Rate Prowess #6406
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I affirm:
What does this pull request do?
Fixes treasure casket drop rate bonus from GoV Prowess effects. The bonus being based on effect power was being fed into
rand < utils.clamp(xi.settings.main.CASKET_DROP_RATE + kupowersMMBPower + prowessCasketsPower, 0, 1)
without any adjustments to convert it into a float. This caused the casket drop rate to be capped out because the value would always be more than 1(The clamp for the float).
This PR divides the effect power by 100 so that the final bonus value reflects the proper percent bonus to be added to the base casket drop rate. An effect power of 4 will now be 0.04 which would equate to a 4% increase.
Steps to test these changes
!exec player:addStatusEffect(xi.effect.PROWESS_CASKET_RATE, 4, 0, 0)
to give yourself 1 rank of Prowess Casket Rate bonus(4%).2b. Use a print in the above function to verify the actual drop rate is correct.