L2JMobius

The Source of Flame Level Diff edit

the_coca_ · 1 · 147

Online the_coca_

  • Knight
  • ***
    • Posts: 65
private double[] calculateExpAndSp(int charLevel, long damage, long totalDamage) {
      int levelDiff = charLevel - this.getLevel();
      double xp = 0.0D;
      double sp = 0.0D;
      if (levelDiff < Config.MONSTER_EXP_MAX_LEVEL_DIFFERENCE && levelDiff > -Config.MONSTER_EXP_MAX_LEVEL_DIFFERENCE) {
         xp = (double)Math.max(0L, this.getExpReward() * damage / totalDamage);
         sp = (double)Math.max(0L, (long)this.getSpReward() * damage / totalDamage);
         if (charLevel > 84 && levelDiff <= -3) {
            double mul;
            switch(levelDiff) {
            case -10:
               mul = 0.03D;
               break;
            case -9:
               mul = 0.05D;
               break;
            case -8:
               mul = 0.09D;
               break;
            case -7:
               mul = 0.15D;
               break;
            case -6:
               mul = 0.25D;
               break;
            case -5:
               mul = 0.42D;
               break;
            case -4:
               mul = 0.67D;
               break;
            case -3:
               mul = 0.97D;
               break;
            default:
               mul = 1.0D;
            }

            xp *= mul;
            sp *= mul;
         }
      }


To change the difference of exp per level you must change the "case" for example if we only want there to be 3 levels of difference we only leave the case -3 mul = 0.97D and leave the rest at mul = 0.00 and so on with the levels that you want them to work.

I posted it as a question and I edit it as an answer for whoever needs it kekw


"org\l2jmobius\gameserver\model\actor\Attackable.java" before of compile server