Expertise Penalty wrong check

Horyon

Пляшущий с бубном
Участник
Сообщения
220
Розыгрыши
0
Решения
4
Репутация
53
Реакции
77
Баллы
273
Хроники
  1. Shadow of the Kamael
Исходники
Присутствуют
Сборка
L2jMobius Master class ch2
Hi again guys.

I try to re-install the expertise, and everything is going fine until, the grade check everything that i equip as a high grade.

1675682330717.png

Lv. 85 character with R grade expertise, getting penalty from D ring.

So far i understand this is the check is here. Player.java

Java:
public void refreshExpertisePenalty()
    {
 if (! Config.EXPERTISE_PENALTY)
        {
            return;
        }
       
        final CrystalType expertiseLevel = _expertiseLevel.plusLevel(_expertisePenaltyBonus);
        int armorPenalty = 0;
        int weaponPenalty = 0;
        for (Item item : _inventory.getPaperdollItems(item -> (item != null) && ((item.getItemType() != EtcItemType.ARROW) && (item.getItemType() != EtcItemType.BOLT)) && item.getTemplate().getCrystalType().isGreater(expertiseLevel)))
        {
            if (item.isArmor())
            {
  Armor penalty level increases depending on amount of penalty armors equipped, not grade level difference.
                armorPenalty = CommonUtil.constrain(armorPenalty + 1, 0, 4);
            }
            else
            {
  Weapon penalty level increases based on grade difference.
                weaponPenalty = CommonUtil.constrain(item.getTemplate().getCrystalType().getLevel() - expertiseLevel.getLevel(), 0, 4);
            }
        }
       
        boolean changed = false;
        if ((_expertiseWeaponPenalty != weaponPenalty) || (getSkillLevel(CommonSkill.WEAPON_GRADE_PENALTY.getId()) != weaponPenalty))
        {
            _expertiseWeaponPenalty = weaponPenalty;
            if (_expertiseWeaponPenalty > 0)
            {
                addSkill(SkillData.getInstance().getSkill(CommonSkill.WEAPON_GRADE_PENALTY.getId(), _expertiseWeaponPenalty));
            }
            else
            {
                removeSkill(CommonSkill.WEAPON_GRADE_PENALTY.getId(), true);
            }
            changed = true;
        }
       
        if ((_expertiseArmorPenalty != armorPenalty) || (getSkillLevel(CommonSkill.ARMOR_GRADE_PENALTY.getId()) != armorPenalty))
        {
            _expertiseArmorPenalty = armorPenalty;
            if (_expertiseArmorPenalty > 0)
            {
                addSkill(SkillData.getInstance().getSkill(CommonSkill.ARMOR_GRADE_PENALTY.getId(), _expertiseArmorPenalty));
            }
            else
            {
                removeSkill(CommonSkill.ARMOR_GRADE_PENALTY.getId(), true);
            }
            changed = true;
        }
       
        if (changed)
        {
 sendSkillList();  Update expertise penalty icon in skill list.
            sendPacket(new EtcStatusUpdate(this));
        }
    }

As always ty for help. =)

Hi again guys.

I try to re-install the expertise, and everything is going fine until, the grade check everything that i equip as a high grade.

1675682330717.png

Lv. 85 character with R grade expertise, getting penalty from D ring.

So far i understand this is the check is here. Player.java

Java:
public void refreshExpertisePenalty()
    {
 if (! Config.EXPERTISE_PENALTY)
        {
            return;
        }
      
        final CrystalType expertiseLevel = _expertiseLevel.plusLevel(_expertisePenaltyBonus);
        int armorPenalty = 0;
        int weaponPenalty = 0;
        for (Item item : _inventory.getPaperdollItems(item -> (item != null) && ((item.getItemType() != EtcItemType.ARROW) && (item.getItemType() != EtcItemType.BOLT)) && item.getTemplate().getCrystalType().isGreater(expertiseLevel)))
        {
            if (item.isArmor())
            {
  Armor penalty level increases depending on amount of penalty armors equipped, not grade level difference.
                armorPenalty = CommonUtil.constrain(armorPenalty + 1, 0, 4);
            }
            else
            {
  Weapon penalty level increases based on grade difference.
                weaponPenalty = CommonUtil.constrain(item.getTemplate().getCrystalType().getLevel() - expertiseLevel.getLevel(), 0, 4);
            }
        }
      
        boolean changed = false;
        if ((_expertiseWeaponPenalty != weaponPenalty) || (getSkillLevel(CommonSkill.WEAPON_GRADE_PENALTY.getId()) != weaponPenalty))
        {
            _expertiseWeaponPenalty = weaponPenalty;
            if (_expertiseWeaponPenalty > 0)
            {
                addSkill(SkillData.getInstance().getSkill(CommonSkill.WEAPON_GRADE_PENALTY.getId(), _expertiseWeaponPenalty));
            }
            else
            {
                removeSkill(CommonSkill.WEAPON_GRADE_PENALTY.getId(), true);
            }
            changed = true;
        }
      
        if ((_expertiseArmorPenalty != armorPenalty) || (getSkillLevel(CommonSkill.ARMOR_GRADE_PENALTY.getId()) != armorPenalty))
        {
            _expertiseArmorPenalty = armorPenalty;
            if (_expertiseArmorPenalty > 0)
            {
                addSkill(SkillData.getInstance().getSkill(CommonSkill.ARMOR_GRADE_PENALTY.getId(), _expertiseArmorPenalty));
            }
            else
            {
                removeSkill(CommonSkill.ARMOR_GRADE_PENALTY.getId(), true);
            }
            changed = true;
        }
      
        if (changed)
        {
 sendSkillList();  Update expertise penalty icon in skill list.
            sendPacket(new EtcStatusUpdate(this));
        }
    }

As always ty for help. =)

I believe the problem is the effect of Expertise... the skill are not giving the ability to use the grade.

Really need help on it... Bump <3
 
Обратите внимание, что данный пользователь заблокирован! Не совершайте с ним никаких сделок! Перейдите в его профиль, чтобы узнать причину блокировки.
Look in skill 4267 how much lvl is there
 

First of all, there should be two other Grade Penalty skills. The one you are using is not even complete. It has no effects. Search for Weapon Grade Penalty and Armor Grade Penalty skills.

These two at the bottom here:

1675754890749.png
Anyway, here is what I find peculiar:

- your "armorPenalty" stays 0+1 (or 1) always!

Java:
            if (item.isArmor())
            {
                // Armor penalty level increases depending on amount of penalty armors equipped, not grade level difference.
                armorPenalty = CommonUtil.constrain(armorPenalty + 1, 0, 4);
            }

secondly, in one place you compare expertise level with getCrystalType().getLevel, while the if compares the getCrystalType() without its level - item.getTemplate().getCrystalType().isGreater(expertiseLevel)
 
Последнее редактирование:
First of all, there should be two other Grade Penalty skills. The one you are using is not even complete. It has no effects. Search for Weapon Grade Penalty and Armor Grade Penalty skills.

These two at the bottom here:

Посмотреть вложение 47885
Anyway, here is what I find peculiar:

- your "armorPenalty" stays 0+1 (or 1) always!

Java:
            if (item.isArmor())
            {
                // Armor penalty level increases depending on amount of penalty armors equipped, not grade level difference.
                armorPenalty = CommonUtil.constrain(armorPenalty + 1, 0, 4);
            }

secondly, in one place you compare expertise level with getCrystalType().getLevel, while the if compares the getCrystalType() without its level - item.getTemplate().getCrystalType().isGreater(expertiseLevel)
I'll investigate Salty Mike,

ty
 

Похожие темы

Назад
Сверху Снизу