GithubHelp home page GithubHelp logo

Comments (2)

Dalayeth avatar Dalayeth commented on August 24, 2024

I looked into this issue a bit and found that it is a little more complicated than just multiplying every number by 10. While that is effectively what it's doing they do it before calculations which makes a difference. The only fix would be to add a new value to the table of every enemy that has its max hit for Adventure Mode or to calculate it like the game does. I don't have access to every enemy on Adventure Mode yet but if we go the calculate route it would be pretty easy to get all the enemies and make it future proof when they add more too. The list of in game monsters and their data can be found here. The damage calculation for enemies looks like it is mostly the same as for players.

function calculateEnemyStrength(enemy = enemyInCombat) {
    if (enemy !== null && enemy !== undefined) {
        if (combatData.enemy.attackType === CONSTANTS.attackType.Melee) {
            combatData.enemy.effectiveStrengthLevel = Math.floor(combatData.enemy.strengthLevel + 8 + 1);
            combatData.enemy.maximumStrengthRoll = Math.floor(numberMultiplier * (1.3 + combatData.enemy.effectiveStrengthLevel / 10 + combatData.enemy.strengthBonus / 80 + (combatData.enemy.effectiveStrengthLevel * combatData.enemy.strengthBonus) / 640));
        } else if (combatData.enemy.attackType === CONSTANTS.attackType.Ranged) {
            combatData.enemy.effectiveStrengthLevel = Math.floor(combatData.enemy.rangedLevel + 8 + 1);
            combatData.enemy.maximumStrengthRoll = Math.floor(numberMultiplier * (1.3 + combatData.enemy.effectiveStrengthLevel / 10 + combatData.enemy.strengthBonusRanged / 80 + (combatData.enemy.effectiveStrengthLevel * combatData.enemy.strengthBonusRanged) / 640));
        } else if (combatData.enemy.attackType === CONSTANTS.attackType.Magic) {
            if (!isGolbinRaid) {
                if (MONSTERS[enemy].selectedSpell === null || MONSTERS[enemy].selectedSpell === undefined) combatData.enemy.maximumStrengthRoll = Math.floor(numberMultiplier * (MONSTERS[enemy].setMaxHit + MONSTERS[enemy].setMaxHit * (combatData.enemy.damageBonusMagic / 100)));
                else combatData.enemy.maximumStrengthRoll = Math.floor(numberMultiplier * (SPELLS[MONSTERS[enemy].selectedSpell].maxHit + SPELLS[MONSTERS[enemy].selectedSpell].maxHit * (combatData.enemy.damageBonusMagic / 100)));
            } else {
                combatData.enemy.effectiveStrengthLevel = Math.floor(combatData.enemy.magicLevel + 8 + 1);
                combatData.enemy.maximumStrengthRoll = Math.floor(numberMultiplier * (1.3 + combatData.enemy.effectiveStrengthLevel / 10 + combatData.enemy.magicStrengthBonus / 80 + (combatData.enemy.effectiveStrengthLevel * combatData.enemy.magicStrengthBonus) / 640));
            }
        }
    }
}

Then it just does damage reduction and formats it.

function updateEnemyMaxHit() {
    if (isInCombat && !newEnemyLoading) {
        if (damageReduction > 0) $("#combat-enemy-strength-bonus").text("(" + numberWithCommas(Math.floor(combatData.enemy.maximumStrengthRoll * (1 - damageReduction / 100))) + ")");
        else $("#combat-enemy-strength-bonus").text(numberWithCommas(combatData.enemy.maximumStrengthRoll));
    }
}

The code for the combat stuff can be found here

from caniidle.

Silberdrachi avatar Silberdrachi commented on August 24, 2024

Sorry this was fixed ages back and i shouldve closed this out. I have fully changed over to using actual level calculation of damage in early .20 release of Melvor Idle. Though this needs to be updated for .21 as the formula have changed for some things.

from caniidle.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.