Jump to content
  • 0

Change Exp Values


Question

Posted

Hi, I am using L2jHellas project.

I have changed on experience.xml some values to test how lvl up works.

but i set for example

    <experience level="1" tolevel="0" />

    <experience level="2" tolevel="100" />

    <experience level="3" tolevel="150" />

    <experience level="4" tolevel="200" />

    <experience level="5" tolevel="300" />

and i have this problem

fail_Exp.jpg

 

How can i solve that? i normally get lvl with 100 exp points but on exp bar i get that!! (on 134% i go to lvl 2 and my bar has already 10% on it)

6 answers to this question

Recommended Posts

  • 0
Posted

You should take a look at experience.java as well

 

public class ExperienceData
{
    private static Logger _log = Logger.getLogger(ExperienceData.class.getName());

    private byte MAX_LEVEL;
    private byte MAX_PET_LEVEL;

    private final Map<Integer, Long> _expTable = new HashMap<Integer, Long>();

    private ExperienceData()
    {
        loadData();
    }

    private void loadData()
    {
        final File xml = new File(PackRoot.DATAPACK_ROOT, "data/xml/experience.xml");
        if (!xml.exists())
        {
            _log.warning(getClass().getSimpleName() + ": experience.xml not found!");
            return;
        }

        Document doc = null;
        final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setValidating(false);
        factory.setIgnoringComments(true);
        try
        {
            doc = factory.newDocumentBuilder().parse(xml);
        }
        catch (Exception e)
        {
            _log.warning("Could not parse experience.xml: " + e.getMessage());
            return;
        }

        final Node table = doc.getFirstChild();
        final NamedNodeMap tableAttr = table.getAttributes();

        MAX_LEVEL = (byte) (Byte.parseByte(tableAttr.getNamedItem("maxLevel").getNodeValue()) + 1);
        MAX_PET_LEVEL = (byte) (Byte.parseByte(tableAttr.getNamedItem("maxPetLevel").getNodeValue()) + 1);

        _expTable.clear();

        NamedNodeMap attrs;
        Integer level;
        Long exp;
        for (Node experience = table.getFirstChild(); experience != null; experience = experience.getNextSibling())
        {
            if (experience.getNodeName().equals("experience"))
            {
                attrs = experience.getAttributes();
                level = Integer.valueOf(attrs.getNamedItem("level").getNodeValue());
                exp = Long.valueOf(attrs.getNamedItem("tolevel").getNodeValue());
                _expTable.put(level, exp);
            }
        }

        _log.info(getClass().getSimpleName() + ": Loaded " + _expTable.size() + " levels");
        _log.info(getClass().getSimpleName() + ": Max Player Level is: " + (MAX_LEVEL - 1));
        _log.info(getClass().getSimpleName() + ": Max Pet Level is: " + (MAX_PET_LEVEL - 1));
    }

    public long getExpForLevel(int level)
    {
        return _expTable.get(level);
    }

    public byte getMaxLevel()
    {
        return MAX_LEVEL;
    }

    public byte getMaxPetLevel()
    {
        return MAX_PET_LEVEL;
    }

    public static ExperienceData getInstance()
    {
        return SingletonHolder._instance;
    }

    @SuppressWarnings("synthetic-access")
    private static class SingletonHolder
    {
        protected static final ExperienceData _instance = new ExperienceData();
    }

that is what i found ExperienceData.java but i cant find anything helpful here!

  • 0
Posted

I never had this problem on High5.

 

Maybe it's client sided? Which chronicle are you using

Read my first post.. I am using L2jHellas.. it is for C6

Guest
This topic is now closed to further replies.


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock