Party XP/SP not working.
A hardcoded fix:
private final long calculateExpSpPartyCutoff(L2PcInstance player, int topLvl, long addExp, int addSp, boolean vit) {
long xp = addExp;
int sp = addSp;
if (character().getPartyXpCutoffMethod().equalsIgnoreCase("highfive")) {
int i = 0;
final int lvlDiff = topLvl - player.getLevel();
for (Entry<Integer, Integer> gap : character().getPartyXpCutoffGaps().entrySet()) {
int baranka = 0;
if(i==0)
baranka = 100;
if(i==1)
baranka = 30;
if(i==2)
baranka = 0;
System.out.print("Baranka prasideda");
System.out.print(i);
System.out.print(baranka);
System.out.print(gap.getKey());
System.out.print(gap.getValue());
System.out.print(i);
if ((lvlDiff >= gap.getKey()) && (lvlDiff <= gap.getValue())) {
xp = (addExp * baranka) / 100;
sp = (addSp * baranka) / 100;
player.addExpAndSp(xp, sp, vit);
break;
}
i++;
}
} else {
player.addExpAndSp(addExp, addSp, vit);
}
return xp;
}
Comments (7)
-
-
the problem is in config file,
PartyXpCutoffGaps
instead of “;” it should be seperated with “,” commas so that CharacterConfiguration can convert it into a list of 3 elements, in this case it only takes 1 element 100;30;0 so Integer parse error occurs -
Have sense, let’s see.
-
-
assigned issue to
-
assigned issue to
-
The line that interests us is in the
src/main/resources/config/character.properties
:
PartyXpCutoffGapPercent = 100;30;0
It is parsed bysrc/main/java/com/l2jserver/gameserver/config/CharacterConfiguration.java
as a config statement into the list of integers:@Key("PartyXpCutoffGapPercent") List<Integer> getPartyXpCutoffGapPercent()
The thing is – the
CharacterConfiguration
is inherited fromorg.aeonbits.owner.Reloadable
and parses list of integers from property files using its own internal logic.
According toowner
library we can use an explicit@Separator(”;”)
decorator or we can change the line in the config file itself.So, there are two ways to fix this:
- Change the delimiter in the
src/main/resources/config/character.properties
to comma,
.
Which automatically inflicts problems on those running L2J long term and updating the server using Git, because they will suddenly find out that their old character configs are incompatible with the current version. - Add
@Separator
decorator, which enforces;
delimiter.
- Change the delimiter in the
-
-
- changed status to resolved
- Log in to comment
Hi and thanks for your contribution.
Can you provide a patch?
Thanks