L2JMobius

Etina's Fate CriticalRatePositionBonus makes positional critical rate negative

hexash14 · 2 · 5097

Offline hexash14

  • Vassal
  • *
    • Posts: 4
Hello, as the title says, sometimes the positional critical rate turns out to be negative. This happens (if I am not mistaken) when a skill that increases positional critical rate ends.

To solve this, the method "onExit" in  "scripts / handlers / effecthandlers / CriticalRatePositionBonus.java" needs to divide the same amount that was multiplied in the onStart method. So

This:
Code: [Select]
@Override
public void onExit(L2Character effector, L2Character effected, Skill skill)
{
effected.getStat().mergePositionTypeValue(Stats.CRITICAL_RATE, _position, (-_amount / 100) - 1, MathUtil::div);
}

Should be changed to this:
Code: [Select]
@Override
public void onExit(L2Character effector, L2Character effected, Skill skill)
{
effected.getStat().mergePositionTypeValue(Stats.CRITICAL_RATE, _position, (_amount / 100) + 1, MathUtil::div);
}

I didn't check all the sources in the free repository, but from the ones I checked all of them had the bug (from ertheia to etina's fate at least).