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
Show file tree
Hide file tree
Changes from 2 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private static Avatar makeAvatar(AvatarData avatarData, int level, int promoteLe
Avatar avatar = new Avatar(avatarData);
avatar.setLevel(level);
avatar.setPromoteLevel(promoteLevel);
avatar.setSkillLevel(null, skillLevel);
avatar.setSkillLevel(-1 , skillLevel);
avatar.forceConstellationLevel(constellation);
avatar.recalcStats(true);
avatar.save();
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/emu/grasscutter/game/avatar/Avatar.java
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,10 @@ public boolean upgradeSkill(int skillId) {
return true;
}

public boolean setSkillLevel(Integer skillId, int level) {
public boolean setSkillLevel(int skillId, int level) {
if (level < 0 || level > 15) return false;
if (skillId == null) {
// Special case for GiveCommand
if (skillId == -1) {
skillDepot.getSkillsAndEnergySkill().forEach(id -> this.setSkillLevel(id, level));
}
else {
Expand Down