[core] [lua] Fix player BST charm calculations and move to lua space
I affirm:
- [x] I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
- [x] I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
- [x] I have read and understood the Contributing Guide and the Code of Conduct.
- [x] I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.
What does this pull request do?
This PR does several things:
- This PR adjusts the calculations of players charming (chance and duration) mobs with the beastmaster charm ability to match retail testing. The charm duration calculations are from this bg wiki which includes a link to an alla page with testing data. While the calculations for charm chance are based on retail testing by Monti, Carnap, and Jimmayus (see page of Jimmy sheet) of around 10000 charms. The previous charm calculations were based on an old ffxicyclopedia page with simple logic and unclear data origins.
- The PR also moves this charm logic into Lua space via a new xi.job_utils.beastmaster file, while removing several unneeded c++ functions and adding a duration param to the luabaseentity charm function.
- The PR also fixes some small issues like light staff double counting for charm chance and some messaging for the charm ability.
- Adjusts Maiden's Virelai (when cast by players) to have a base duration of 30 seconds with potential resistance to the song (similar to the current calculation when mobs cast it). The dependence of Maiden's Virelai on any bst charm-ability logic or calculations is removed as there is no evidence to support such dependence as far as I could find.
Note that this does not impact how mobs charm players as that is done via a different mechanism based on status resistance of the charm status effect.
This is a partly an ASB PR coming upstream.
Steps to test these changes
Charm various mobs with varying level diff and CHR, results should match retail charm rates.
✨ Thanks for the PR! ✨
This is a friendly automated reminder that the maintainers won't look at your PR until you've properly completed all of the checkboxes in the pre-filled template.
I am also awaiting some small retail checks from Jimmayus before marking the PR as ready to go (non-draft status).
I am also awaiting some small retail checks from Jimmayus before marking the PR as ready to go (non-draft status).
We got the captures from several more mobs and validated the formula so this PR should be ready to go. Let me know if anything else that would be needed, thanks!
I like what I'm seing in general. Please do take a look at magic-hit-rate calculations in case that logic can be used.
Yeah from my checking the magic hit rate cannot be used because for example the multipliers and calculations are different.