Jump to content

[декомпил] Формула расчёта магического резиста


Recommended Posts

Многим известно, что шанс отразить магическую атаку равен:
шанс % = (маг. защита цели - маг. точность атакующего)/10

почти верно), но есть ньюансы

Оригинальная формула выглядит так:
 

        int resistChance = (int) ((float)((int) ((float)((targetMagResist - attackerHitAcc) * 1) + magResistLvlAdj));

        if (resistChance > 900) {
                resistChance = 900;
        } else if (resistChance < 0) {
            resistChance = 0;
        }

        return RandomUtil.getIntInRange(1, 1000) > resistChance;


Как видно из формулы шанс отразить маг атаку не может превышать 90%

Но самое интересно здесь это разница в уровне, при чём оно не зависит игрок или НПС
 

        int lvlDiff = target.getCreatureStats().getLevel() - attacker.getCreatureStats().getLevel();

        if (4 < lvlDiff) {
            return (lvlDiff - 4) * 100;
        }
        if (lvlDiff < -4) {
            return (lvlDiff + 4) * 100;
        }
        return 0;


Так же не стоит забывать, что если цель игрок, то точность атакующего меняется следующим образом

        if (attacker instanceof Player) {
            attackerHitAcc += hitAccMod;
        }

где hitAccMod - это мод который прописан в скилах <effect_acc_mod1/2>

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...