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()));
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.
DISCORD :
utchiha_market
telegram :
https://t.me/utchiha_market
SELLIX STORE :
https://utchihamkt.mysellix.io/
Join our server for more products :
https://discord.gg/hood-services
https://campsite.bio/utchihaamkt
hello everyone !
I need help with a l2script Rev H5-Salvation/Classic build. I compiled the project, installed everything but I can't log in to the server, it won't log me in. I tried a thousand ways without good results. I leave you the error when logging in either with the H5-Salvation Client.
ERROR ---> WARN: IPBANMANAGER ---> IP !!!!
I'm waiting for help! Thank you!
Question
GameBlonD
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
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.