retail like cancelaration formula

Issue #221 new
FinalDestination created an issue

canceleration formula rate depends on magic lvl difference also on buff time duraction however the max and min chance is 10-70 the resist formula need a bit change to be affected from effects here it is

public static boolean calcCancelSuccess(BuffInfo info, int cancelMagicLvl, int rate, Skill skill, L2Character activeChar, L2Character target)
    {
        final double resistDispelByCategory = 1 + (target.calcStat(Stats.CANCEL_VULN, 0, null, null) / 100.);
        final double dispelByCategory = (rate + ((cancelMagicLvl - info.getSkill().getMagicLevel()) * 2) + (info.getAbnormalTime() / 120));
        final double nLandRate = dispelByCategory * resistDispelByCategory;
        final double successRate = Util.constrain(nLandRate, 10, 70);

        if (activeChar.isDebug())
        {
            final StatsSet set = new StatsSet();
            set.set("resistDispelByCategory", resistDispelByCategory);
            set.set("dispelByCategory", dispelByCategory);
            set.set("nLandRate", nLandRate);
            set.set("successRate: ", successRate);
            Debug.sendSkillDebug(activeChar, target, skill, set);
        }

        return Rnd.get(100) < successRate;
    }

Comments (0)

  1. Log in to comment