Jump to content
  • 0

Asking massive help-Npe


Question

Posted

Guys,i have this npe and i see no ways to fix it...

I just dont understand how can stats go null lol.

 

http://img190.imageshack.us/f/eleosds.jpg/

 

I searched at the l2j team i use and this issue was never mentioned.

L2J gameserver rev.2018

 

When i unequip all my armor parts,all my stats go to 0.

8 answers to this question

Recommended Posts

  • 0
Posted

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();
	}
}

  • 0
Posted

Thank you a lot jimaras,i appreciate it.

 

The problem was here:

 
		                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; 

 

Request for lock.

Guest
This topic is now closed to further replies.


×
×
  • Create New...