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 maker monster crystal level calculation #275

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

nutnnut
Copy link

@nutnnut nutnnut commented Oct 7, 2024

Description

Maker monster crystal level calculation is off by 1 because the level get -1 twice

itemid = getCrystalForLevel(LifeFactory.getMonsterLevel(dropperid) - 1);

private static int getCrystalForLevel(int level) {
        int range = (level - 1) / 10;

        if (range < 5) {
            return ItemId.BASIC_MONSTER_CRYSTAL_1;
        } else if (range > 11) {
            return ItemId.ADVANCED_MONSTER_CRYSTAL_3;
        } else {
            return switch (range) {
                case 5 -> ItemId.BASIC_MONSTER_CRYSTAL_2;
                case 6 -> ItemId.BASIC_MONSTER_CRYSTAL_3;
                case 7 -> ItemId.INTERMEDIATE_MONSTER_CRYSTAL_1;
                case 8 -> ItemId.INTERMEDIATE_MONSTER_CRYSTAL_2;
                case 9 -> ItemId.INTERMEDIATE_MONSTER_CRYSTAL_3;
                case 10 -> ItemId.ADVANCED_MONSTER_CRYSTAL_1;
                default -> ItemId.ADVANCED_MONSTER_CRYSTAL_2;
            };
        }
    }

4260006 - Advanced Monster Crystal 1 - A Monster Crystal that was formed by combining the droppings of monsters on level 101 ~ 110.
4260007 - Advanced Monster Crystal 2 - A Monster Crystal that was formed by combining the droppings of monsters on level 111 ~ 120.

lv 111 item will get Adv Crystal 1
After fix should get Adv Crystal 2

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested my changes
  • I have added unit tests that prove my changes work

Screenshots

@P0nk P0nk merged commit a5b5720 into P0nk:master Oct 19, 2024
1 check passed
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