Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend give command "skill level" & shortening /talent all #1865

Merged
merged 15 commits into from
Oct 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changeSkillLevel now acts as intermediate operation to fetch skillIds
  • Loading branch information
natsurepo committed Oct 17, 2022
commit 24f0d795c0e6e746acbd10c66704f27cf96541d1
13 changes: 6 additions & 7 deletions src/main/java/emu/grasscutter/game/avatar/Avatar.java
Original file line number Diff line number Diff line change
Expand Up @@ -774,18 +774,17 @@ public boolean setSkillLevel(int skillId, int level) {
this.save();

// Packet
this.getPlayer().sendPacket(new PacketAvatarSkillChangeNotify(this, skillId, oldLevel, level));
this.getPlayer().sendPacket(new PacketAvatarSkillUpgradeRsp(this, skillId, oldLevel, level));
val player = this.getPlayer();
if (player != null) {
player.sendPacket(new PacketAvatarSkillChangeNotify(this, skillId, oldLevel, level));
player.sendPacket(new PacketAvatarSkillUpgradeRsp(this, skillId, oldLevel, level));
}
return true;
}

public void changeSkillLevel(int skillLevel) {
natsurepo marked this conversation as resolved.
Show resolved Hide resolved
if (skillLevel < 1) skillLevel = 1;
if (skillLevel > 12) skillLevel = 12; // Set max to 12 at the moment instead of 15 (it will conflict with constellation's talent level bonus)
int finalSkillLevel = skillLevel;
skillDepot.getCombatSkills().forEach(id -> this.skillLevelMap.put(id, finalSkillLevel));
this.save();
this.recalcStats(true);
skillDepot.getCombatSkills().forEach(id -> this.setSkillLevel(id, skillLevel));
}

public boolean unlockConstellation() {
Expand Down