Jump to content
  • 0

Question

Posted

I am trying to make pets go up to 86 lvl in old gracia pack,
What i change: red= what i add/change

Experience.java:
            11844000000L, // level 83
            15472800000L, // level 84
            25314105600L, //level 86
            32211728640L  }; //level 87

 

    public final static byte MAX_LEVEL = 86;

    public final static byte PET_MAX_LEVEL = 87;
------------------------------------------------------------------
Petstat.java:

    public final boolean addLevel(byte value)
    {

        if (getLevel() + value > (Experience.PET_MAX_LEVEL - 1))
            return false;

-------------------------------------------------------------------
PlayableStat.java
    public boolean addExp(long value)
    {
        if ((getExp() + value) < 0 || (value > 0 && getExp() == (getExpForLevel(Experience.PET_MAX_LEVEL) - 1)))
            return true;
        
        if (getExp() + value >= getExpForLevel(Experience.PET_MAX_LEVEL))
            value = getExpForLevel(Experience.PET_MAX_LEVEL) - 1 - getExp();
        
        setExp(getExp() + value);
        
        byte minimumLevel = 1;
        if (getActiveChar() instanceof L2PetInstance)
        {
            // get minimum level from L2NpcTemplate
            minimumLevel = ((L2PetInstance) getActiveChar()).getTemplate().level;
        }
        
        byte level = minimumLevel; // minimum level
        
        for (byte tmp = level; tmp <= Experience.PET_MAX_LEVEL; tmp++)
        {
            if (getExp() >= getExpForLevel(tmp))
                continue;
            level = --tmp;
            break;
        }
        if (level != getLevel() && level >= minimumLevel)
            addLevel((byte) (level - getLevel()));
        
        return true;
    }


    public boolean removeExp(long value)
    {
        if ((getExp() - value) < 0)
            value = getExp() - 1;
        
        setExp(getExp() - value);
        
        byte minimumLevel = 1;
        if (getActiveChar() instanceof L2PetInstance)
        {
            // get minimum level from L2NpcTemplate
            minimumLevel = ((L2PetInstance) getActiveChar()).getTemplate().level;
        }
        byte level = minimumLevel;
        
        for (byte tmp = level; tmp <= Experience.PET_MAX_LEVEL; tmp++)
        {
            if (getExp() >= getExpForLevel(tmp))
                continue;
            level = --tmp;
            break;
        }
        if (level != getLevel() && level >= minimumLevel)
            addLevel((byte) (level - getLevel()));
        return true;
    }



    public boolean addLevel(byte value)
    {
        if (getLevel() + value > Experience.PET_MAX_LEVEL - 1)
        {
            if (getLevel() < Experience.PET_MAX_LEVEL - 1)
                value = (byte) (Experience.PET_MAX_LEVEL - 1 - getLevel());
            else
                return false;
        }
        
        boolean levelIncreased = (getLevel() + value > getLevel());
        value += getLevel();
        setLevel(value);
        
        // Sync up exp with current level
        if (getExp() >= getExpForLevel(getLevel() + 1) || getExpForLevel(getLevel()) > getExp())
            setExp(getExpForLevel(getLevel()));
        
        if (!levelIncreased)
            return false;
        
        getActiveChar().getStatus().setCurrentHp(getActiveChar().getStat().getMaxHp());
        getActiveChar().getStatus().setCurrentMp(getActiveChar().getStat().getMaxMp());
        
        if (getActiveChar() instanceof L2PcInstance)
            CommunityServerThread.getInstance().sendPacket(new WorldInfo((L2PcInstance) getActiveChar(), null, WorldInfo.TYPE_UPDATE_PLAYER_DATA));

        return true;
    }
   

The problem is after the playableStat.java changes pets can leven up up to 86 lvl but Players can too

Any ideas what to change in order to PET_MAX_LEVEL apply only to pets?

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

I fixed for now  but something blocking pet_max_experience ,

One question when pet goes 86 lvl = max lvl   when i kill a mob pet doesnt take any xp only owner(takes full XP like without pet) is this normal if a pet is max level?

Edited by GameBlonD

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...