i will post all the part related to this line.
if (env.player instanceof L2PcInstance)
{
L2PcInstance p = (L2PcInstance) env.player;
if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER) != null) env.value -= 5;
if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER) != null) env.value -= 5;
if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEAR) != null) env.value -= 9;
if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_REAR) != null) env.value -= 9;
if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK) != null) env.value -= 13;
}
env.value *= MENbonus[env.player.getMEN()] * env.player.getLevelMod();
}
}
static class FuncPDefMod extends Func
{
static final FuncPDefMod _fmm_instance = new FuncPDefMod();
static Func getInstance()
{
return _fmm_instance;
}
private FuncPDefMod()
{
super(Stats.POWER_DEFENCE, 0x20, null);
}
@Override
public void calc(Env env)
{
if (env.player instanceof L2PcInstance)
{
L2PcInstance p = (L2PcInstance) env.player;
boolean hasMagePDef = (p.getClassId().isMage() || p.getClassId().getId() == 0x31); // orc mystics are a special case
if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD) != null)
env.value -= 12;
if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST) != null)
env.value -= hasMagePDef ? 15 : 31;
if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS) != null || p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST).getItem().getBodyPart() == L2Item.SLOT_FULL_ARMOR)
env.value -= hasMagePDef ? 8 : 18;
if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES) != null)
env.value -= 8;
if (p.getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET) != null)
env.value -= 7;
}
env.value *= env.player.getLevelMod();
}
}