diff --git a/src/main/java/emu/grasscutter/command/commands/TalentCommand.java b/src/main/java/emu/grasscutter/command/commands/TalentCommand.java index c14954370..db4747543 100644 --- a/src/main/java/emu/grasscutter/command/commands/TalentCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/TalentCommand.java @@ -12,7 +12,7 @@ import java.util.List; @Command( label = "talent", - usage = {"set ", "(n|e|q) ", "getid"}, + usage = {"set ", "(n|e|q|all) ", "getid"}, permission = "player.settalent", permissionTargeted = "player.settalent.others") public final class TalentCommand implements CommandHandler { @@ -22,7 +22,7 @@ public final class TalentCommand implements CommandHandler { var name = Language.getTextMapKey(nameHash); CommandHandler.sendTranslatedMessage(sender, "commands.talent.set_id", skillId, name, newLevel); } else { - CommandHandler.sendTranslatedMessage(sender, "commands.talent.lower_16"); + CommandHandler.sendTranslatedMessage(sender, "commands.talent.out_of_range"); } } @@ -87,6 +87,27 @@ public final class TalentCommand implements CommandHandler { }; setTalentLevel(sender, avatar, skillId, newLevel); } + case "all" -> { + if (args.size() < 2) { + sendUsageMessage(sender); + return; + } + try { + newLevel = Integer.parseInt(args.get(1)); + } catch (NumberFormatException ignored) { + CommandHandler.sendTranslatedMessage(sender, "commands.talent.invalid_level"); + return; + } + // This stops setTalentLevel from outputting 3 "levels out of range" messages + if (newLevel < 1 || newLevel > 15) { + CommandHandler.sendTranslatedMessage(sender, "commands.talent.out_of_range"); + return; + } + // This is small so array is not needed imo + setTalentLevel(sender, avatar, skillDepot.getSkills().get(0), newLevel); + setTalentLevel(sender, avatar, skillDepot.getSkills().get(1), newLevel); + setTalentLevel(sender, avatar, skillDepot.getEnergySkill(), newLevel); + } case "getid" -> { var map = GameData.getAvatarSkillDataMap(); skillDepot.getSkillsAndEnergySkill().forEach(id -> { diff --git a/src/main/resources/languages/en-US.json b/src/main/resources/languages/en-US.json index 76b61daa3..529e1e580 100644 --- a/src/main/resources/languages/en-US.json +++ b/src/main/resources/languages/en-US.json @@ -292,7 +292,7 @@ "description": "Stops the server" }, "talent": { - "lower_16": "Invalid talent level. Level should be lower than 16.", + "out_of_range": "Invalid talent level. Level should be in range of 1-15.", "set_id": "Set talent %s - \"%s\" to %s.", "id_desc": "Talent %s - \"%s\" - \"%s\"", "invalid_skill_id": "Invalid skill ID.", diff --git a/src/main/resources/languages/es-ES.json b/src/main/resources/languages/es-ES.json index 657ff8073..e1f536e0c 100644 --- a/src/main/resources/languages/es-ES.json +++ b/src/main/resources/languages/es-ES.json @@ -292,7 +292,7 @@ "description": "Detiene el servidor" }, "talent": { - "lower_16": "Nivel de talento inválido. El nivel debe ser menor que 16.", + "out_of_range": "🇺🇸Invalid talent level. Level should be in range of 1-15.", "set_id": "🇺🇸Set talent %s - \"%s\" to %s.", "id_desc": "🇺🇸Talent %s - \"%s\" - \"%s\"", "invalid_skill_id": "ID de habilidad inválido.", diff --git a/src/main/resources/languages/fr-FR.json b/src/main/resources/languages/fr-FR.json index 050917a72..35da92fe2 100644 --- a/src/main/resources/languages/fr-FR.json +++ b/src/main/resources/languages/fr-FR.json @@ -292,7 +292,7 @@ "description": "Arrête le serveur" }, "talent": { - "lower_16": "Niveau de talent invalide. Le niveau doit être inférieur a 16.", + "out_of_range": "🇺🇸Invalid talent level. Level should be in range of 1-15.", "set_id": "🇺🇸Set talent %s - \"%s\" to %s.", "id_desc": "🇺🇸Talent %s - \"%s\" - \"%s\"", "invalid_skill_id": "ID de talent invalide.", diff --git a/src/main/resources/languages/ja-JP.json b/src/main/resources/languages/ja-JP.json index f96aa0dd7..97398b699 100644 --- a/src/main/resources/languages/ja-JP.json +++ b/src/main/resources/languages/ja-JP.json @@ -292,7 +292,7 @@ "description": "サーバーを停止中" }, "talent": { - "lower_16": "天賦レベルが無効です。 レベルは16未満である必要があります。", + "out_of_range": "🇺🇸Invalid talent level. Level should be in range of 1-15.", "set_id": "%s - の天賦\"%s\" を %s に設定しました", "id_desc": "天賦 %s - \"%s\" - \"%s\"", "invalid_skill_id": "スキル ID が無効です。", diff --git a/src/main/resources/languages/ko-KR.json b/src/main/resources/languages/ko-KR.json index 07298ec87..ca8e79c9a 100644 --- a/src/main/resources/languages/ko-KR.json +++ b/src/main/resources/languages/ko-KR.json @@ -292,7 +292,7 @@ "description": "서버를 중지합니다" }, "talent": { - "lower_16": "불분명한 특성 레벨. 특성의 레벨은 16 미만이여야합니다.", + "out_of_range": "🇺🇸Invalid talent level. Level should be in range of 1-15.", "set_id": "🇺🇸Set talent %s - \"%s\" to %s.", "id_desc": "🇺🇸Talent %s - \"%s\" - \"%s\"", "invalid_skill_id": "잘못된 스킬ID.", diff --git a/src/main/resources/languages/pl-PL.json b/src/main/resources/languages/pl-PL.json index f1f9bd162..8b74424ca 100644 --- a/src/main/resources/languages/pl-PL.json +++ b/src/main/resources/languages/pl-PL.json @@ -292,7 +292,7 @@ "description": "Zatrzymaj serwer." }, "talent": { - "lower_16": "Błędny poziom talentu. Poziom ten powinien być mniejszy niż 16.", + "out_of_range": "🇺🇸Invalid talent level. Level should be in range of 1-15.", "set_id": "🇺🇸Set talent %s - \"%s\" to %s.", "id_desc": "🇺🇸Talent %s - \"%s\" - \"%s\"", "invalid_skill_id": "Błędne ID umiejętności.", diff --git a/src/main/resources/languages/ro-RO.json b/src/main/resources/languages/ro-RO.json index 1d337def6..1578d2192 100644 --- a/src/main/resources/languages/ro-RO.json +++ b/src/main/resources/languages/ro-RO.json @@ -292,7 +292,7 @@ "description": "Oprește serverul" }, "talent": { - "lower_16": "Nivel de talent nevalabil. Nivelul trebuie să fie mai mic ca 16.", + "out_of_range": "🇺🇸Invalid talent level. Level should be in range of 1-15.", "set_id": "🇺🇸Set talent %s - \"%s\" to %s.", "id_desc": "🇺🇸Talent %s - \"%s\" - \"%s\"", "invalid_skill_id": "Skill ID nevalabil.", diff --git a/src/main/resources/languages/ru-RU.json b/src/main/resources/languages/ru-RU.json index 99a42a0c4..97b81e91d 100644 --- a/src/main/resources/languages/ru-RU.json +++ b/src/main/resources/languages/ru-RU.json @@ -292,7 +292,7 @@ "description": "Останавливает работу сервера" }, "talent": { - "lower_16": "Некорректный уровень таланта. Уровень должен быть ниже 16.", + "out_of_range": "🇺🇸Invalid talent level. Level should be in range of 1-15.", "set_id": "Уровень таланта %s - \"%s\" установлен на %s.", "id_desc": "Талант %s - \"%s\" - \"%s\"", "invalid_skill_id": "Некорректный ID способности.", diff --git a/src/main/resources/languages/zh-CN.json b/src/main/resources/languages/zh-CN.json index 881e9a675..d7c5738e1 100644 --- a/src/main/resources/languages/zh-CN.json +++ b/src/main/resources/languages/zh-CN.json @@ -292,7 +292,7 @@ "description": "停止服务器" }, "talent": { - "lower_16": "无效的天赋等级,天赋等级应在 1-15 之间。", + "out_of_range": "🇺🇸Invalid talent level. Level should be in range of 1-15.", "set_id": "修改技能 %s - \"%s\" 至 %s。", "id_desc": "技能 %s - \"%s\" - \"%s\"", "invalid_skill_id": "无效的技能ID。", diff --git a/src/main/resources/languages/zh-TW.json b/src/main/resources/languages/zh-TW.json index f0a715130..8ff040888 100644 --- a/src/main/resources/languages/zh-TW.json +++ b/src/main/resources/languages/zh-TW.json @@ -292,7 +292,7 @@ "description": "以正常的方式關閉伺服器。" }, "talent": { - "lower_16": "無效的天賦等級,技能等級應低於 16。", + "out_of_range": "🇺🇸Invalid talent level. Level should be in range of 1-15.", "set_id": "🇺🇸Set talent %s - \"%s\" to %s.", "id_desc": "🇺🇸Talent %s - \"%s\" - \"%s\"", "invalid_skill_id": "無效的技能ID。",