Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Quest API] Add GetAAEXPPercentage() and GetEXPPercentage() to Perl/Lua #4044

Merged
merged 3 commits into from
Feb 4, 2024

Conversation

Kinglykrab
Copy link
Contributor

Perl

  • Add $client->GetAAEXPPercentage().
  • Add $client->GetEXPPercentage().

Lua

  • Add client:GetAAEXPPercentage().
  • Add client:GetEXPPercentage().

Notes

  • Allows operators to get current AA or regular experience percentages.
  • Math is verified by @hgtw to match what the client does so we're not +/- 1%.

Copy link
Contributor

@hgtw hgtw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to match the client tooltip these depend on matching the scaled values sent to client in exp packets. Also the math is slightly different than what the client does (they use a different double constant 0.303031 than 100.0 / 330.0 and the gauge value is multiplied by 10 when stored before it's rounded which could just be optimization).

This tested ok for all possible values when I tried it though. Not sure on use case vs returning a more precise float that quests can choose to round themselves or not but this seems low impact enough.

@Kinglykrab
Copy link
Contributor Author

Note to match the client tooltip these depend on matching the scaled values sent to client in exp packets. Also the math is slightly different than what the client does (they use a different double constant 0.303031 than 100.0 / 330.0 and the gauge value is multiplied by 10 when stored before it's rounded which could just be optimization).

This tested ok for all possible values when I tried it though. Not sure on use case vs returning a more precise float that quests can choose to round themselves or not but this seems low impact enough.

Yeah, I'm fine with just having the rounded number since that's how it's displayed in the UI.

@Kinglykrab Kinglykrab merged commit 0ffea36 into master Feb 4, 2024
2 checks passed
@Kinglykrab Kinglykrab deleted the quest_api/getaa_getexp_percentage branch February 4, 2024 23:16
@Akkadius Akkadius mentioned this pull request Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants