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

Fix item distribution on level tresholds #848

Closed
wants to merge 2 commits into from

Conversation

T1biriy
Copy link
Contributor

@T1biriy T1biriy commented May 14, 2024

MIGHT fix #838, not sure just test it bruh idk anymore im dead inside

attempt at fixing shiny charm acquisition and changing shinyness
@Glazelf Glazelf requested a review from Skaidus May 14, 2024 14:16
@Glazelf Glazelf added the bug Something isn't working label May 14, 2024
@Glazelf Glazelf self-assigned this May 14, 2024
},
async changeAutoFeed(id, mode) {
let shinx = await this.getShinx(id, ['user_id', 'auto_feed']);
return shinx.setAutoFeed(mode);
},
async addExperience(id, experience) {
let shinx = await this.getShinx(id, ['user_id', 'experience']);
let shinx = await this.getShinx(id, ['user_id', 'experience', 'level']);
Copy link
Owner

@Glazelf Glazelf May 14, 2024

Choose a reason for hiding this comment

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

Level is determined from the EXP count instead of being stored seperately so it doesn't really make sense to pass that in the arguments.
Level is calculated here: https://github.com/Glazelf/NinigiBot/blob/4b1e535883475dbf3293e34b36c4e2660619d76c/util/shinx/getExpFromLevel.js

Also doesn't look like you're using the level anyways so idk.

Comment on lines -43 to +49
return shinx.switchShininessAndGet();
let user = await this.getUser(id, ['user_id']);
let hasShinyCharm = await this.hasEventTrophy(user.user_id, 'Shiny Charm');
if (hasShinyCharm) {
return shinx.switchShininessAndGet();
} else {
throw new Error('User does not have the Shiny Charm');
}
Copy link
Owner

Choose a reason for hiding this comment

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

From what I've gathered this bug is not in the functionality for switching between shiny and non-shiny.
This seems to work correctly already.
The bug seems to be in users not receiving a shiny charm, or any level-up rewards, when reaching the required level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i will look into it tomorrow if i remember

@Glazelf Glazelf changed the title Attempt on fixing issue #838 Fix item distribution on level tresholds May 14, 2024
@Glazelf Glazelf marked this pull request as draft May 15, 2024 05:59
@Glazelf Glazelf marked this pull request as ready for review May 15, 2024 05:59
@Glazelf Glazelf marked this pull request as draft May 15, 2024 05:59
@Glazelf
Copy link
Owner

Glazelf commented Jun 5, 2024

Going to close this in favor of #849.

@Glazelf Glazelf closed this Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shiny Charm not granted after reaching level 50
3 participants