LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
302 stars 608 forks source link

[lua] Fix Casket Drop Rate Prowess #6406

Closed UmeboshiXI closed 2 weeks ago

UmeboshiXI commented 2 weeks ago

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

  1. Go to a GoV book zone, complete regime until you get casket rate increase or use !exec player:addStatusEffect(xi.effect.PROWESS_CASKET_RATE, 4, 0, 0) to give yourself 1 rank of Prowess Casket Rate bonus(4%).
  2. Kill mobs and see that the drop rate is not 100%. 2b. Use a print in the above function to verify the actual drop rate is correct.