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

Add character’s experience and level-up threshold to /characters #596

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

scy
Copy link

@scy scy commented Jan 6, 2018

I love tracking a character’s progress over time, and I’m already able to retrieve the wallet, inventory and level. However, in higher levels it takes a large amount of time to reach the next one. Therefore I think it would be useful to be able to track the experience bar of a character.

I’m proposing three new values that are available via /characters if the token has progression permission:

{ experience: {
  current: 123456,
  this_level: 1168459,
  next_level: 1236659
}}

These allow you to retrieve the current absolute amount of experience as well as the amount required to reach the current and the next level.

You can use these to calculate an XP bar percentage: (current - next_level) / (next_level - this_level) * 100.

Once a character reaches level 80, XP gained will instead count towards masteries (if the player owns HoT/PoF), which are tracked account-wide and not per character. Therefore they are out of scope for this PR. For level 80 characters, current and this_level will become and stay the same number (maximum XP, currently 4,860,359), while next_level will change to false, meaning that there is no next level.

An alternative way to implement this would be to just return a single number for experience, without providing this_level or next_level. Applications would then need to consult the XP table or a (not yet implemented) separate endpoint providing it. This would be easier to implement on the server side, but harder for clients.

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.

1 participant