Grasscutter/src/main/java/emu/grasscutter/server/packet/send/PacketAvatarSkillInfoNotify.java
AnimeGitB fb1bacb0f8 Refactor avatar skilldepot and constellation/talent changing
Ensures Traveler retains talent levels and constellations on inactive elements when switching elements.
Relevant for any other skillDepot-changing activities like Windtrace too, though keeping those in the db might not be as useful.

Refactor avatar talent upgrade and access
Refactor skillExtraCharges
2022-08-19 16:43:57 +09:30

21 lines
831 B
Java

package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.AvatarSkillInfoNotifyOuterClass.AvatarSkillInfoNotify;
import emu.grasscutter.net.proto.AvatarSkillInfoOuterClass.AvatarSkillInfo;
import it.unimi.dsi.fastutil.ints.Int2IntMap;
public class PacketAvatarSkillInfoNotify extends BasePacket {
public PacketAvatarSkillInfoNotify(long avatarGuid, Int2IntMap skillExtraChargeMap) {
super(PacketOpcodes.AvatarSkillInfoNotify);
var proto = AvatarSkillInfoNotify.newBuilder().setGuid(avatarGuid);
skillExtraChargeMap.forEach((skillId, count) ->
proto.putSkillMap(skillId, AvatarSkillInfo.newBuilder().setMaxChargeCount(count).build()));
this.setData(proto);
}
}