Commit 50c8f43d authored by ImmuState's avatar ImmuState Committed by Melledy
Browse files

Fix giveall and givechar giving broken characters.

parent 5a8a636b
package emu.grasscutter.command.commands; package emu.grasscutter.command.commands;
import emu.grasscutter.GameConstants;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
...@@ -52,9 +53,26 @@ public final class GiveAllCommand implements CommandHandler { ...@@ -52,9 +53,26 @@ public final class GiveAllCommand implements CommandHandler {
Avatar avatar = new Avatar(avatarData); Avatar avatar = new Avatar(avatarData);
avatar.setLevel(90); avatar.setLevel(90);
avatar.setPromoteLevel(6); avatar.setPromoteLevel(6);
// Add constellations.
int talentBase = switch (avatar.getAvatarId()) {
case 10000005 -> 70;
case 10000006 -> 40;
default -> (avatar.getAvatarId()-10000000)*10;
};
for(int i = 1;i <= 6;++i){ for(int i = 1;i <= 6;++i){
avatar.getTalentIdList().add((avatar.getAvatarId()-10000000)*10+i); avatar.getTalentIdList().add(talentBase + i);
}
// Handle skill depot for traveller.
if (avatar.getAvatarId() == GameConstants.MAIN_CHARACTER_MALE) {
avatar.setSkillDepotData(GameData.getAvatarSkillDepotDataMap().get(504));
}
else if(avatar.getAvatarId() == GameConstants.MAIN_CHARACTER_FEMALE) {
avatar.setSkillDepotData(GameData.getAvatarSkillDepotDataMap().get(704));
} }
// This will handle stats and talents // This will handle stats and talents
avatar.recalcStats(); avatar.recalcStats();
// Don't try to add each avatar to the current team // Don't try to add each avatar to the current team
......
package emu.grasscutter.command.commands; package emu.grasscutter.command.commands;
import emu.grasscutter.GameConstants;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.command.Command; import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandHandler; import emu.grasscutter.command.CommandHandler;
...@@ -68,6 +69,14 @@ public final class GiveCharCommand implements CommandHandler { ...@@ -68,6 +69,14 @@ public final class GiveCharCommand implements CommandHandler {
avatar.setLevel(level); avatar.setLevel(level);
avatar.setPromoteLevel(ascension); avatar.setPromoteLevel(ascension);
// Handle skill depot for traveller.
if (avatar.getAvatarId() == GameConstants.MAIN_CHARACTER_MALE) {
avatar.setSkillDepotData(GameData.getAvatarSkillDepotDataMap().get(504));
}
else if(avatar.getAvatarId() == GameConstants.MAIN_CHARACTER_FEMALE) {
avatar.setSkillDepotData(GameData.getAvatarSkillDepotDataMap().get(704));
}
// This will handle stats and talents // This will handle stats and talents
avatar.recalcStats(); avatar.recalcStats();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment