Recalculate stats after learning revelation skills.

This commit is contained in:
MobiusDevelopment
2022-12-11 04:14:37 +00:00
parent 038ee0ee41
commit 373376549c
26 changed files with 303 additions and 30 deletions

View File

@ -20,6 +20,7 @@ import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.commons.network.ReadablePacket;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.gameserver.data.xml.SkillData;
import org.l2jmobius.gameserver.data.xml.SkillTreeData;
import org.l2jmobius.gameserver.enums.AcquireSkillType;
@ -391,6 +392,12 @@ public class RequestAcquireSkill implements ClientPacket
final String varName = count == 0 ? REVELATION_VAR_NAMES[0] : REVELATION_VAR_NAMES[1];
player.getVariables().set(varName, skill.getId());
giveSkill(player, trainer, skill);
ThreadPool.schedule(() ->
{
player.getStat().recalculateStats(false);
player.broadcastInfo();
}, 100);
}
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.BASECLASS);
@ -441,6 +448,12 @@ public class RequestAcquireSkill implements ClientPacket
final String varName = count == 0 ? DUALCLASS_REVELATION_VAR_NAMES[0] : DUALCLASS_REVELATION_VAR_NAMES[1];
player.getVariables().set(varName, skill.getId());
giveSkill(player, trainer, skill);
ThreadPool.schedule(() ->
{
player.getStat().recalculateStats(false);
player.broadcastInfo();
}, 100);
}
final List<SkillLearn> skills = SkillTreeData.getInstance().getAvailableRevelationSkills(player, SubclassType.DUALCLASS);