diff --git a/Commands/CommandBuild.cs b/Commands/CommandBuild.cs index 36fbd4d..8924db4 100644 --- a/Commands/CommandBuild.cs +++ b/Commands/CommandBuild.cs @@ -7,6 +7,7 @@ using EggLink.DanhengServer.Enums.Avatar; using EggLink.DanhengServer.Enums.Item; using EggLink.DanhengServer.Internationalization; +using EggLink.DanhengServer.Util; namespace DanhengPlugin.CharacterBuilder.Commands; @@ -78,6 +79,11 @@ public async ValueTask BuildAvatar(AvatarInfo avatar, CommandArg arg) { // build avatar var player = arg.Target!.Player!; + if (player.InventoryManager!.Data.RelicItems.Count + 6 > GameConstants.INVENTORY_MAX_RELIC) + { + await arg.SendMsg(I18NManager.Translate("CharacterBuilder.InventoryRelicMax")); + return; + } PluginGameData.AvatarRelicRecommendData.TryGetValue(avatar.GetAvatarId(), out var excel); if (excel == null) { diff --git a/Language/LanguageCHS.cs b/Language/LanguageCHS.cs index 640be1f..6489acd 100644 --- a/Language/LanguageCHS.cs +++ b/Language/LanguageCHS.cs @@ -15,4 +15,5 @@ public class PluginLanguage public string UnloadedCharacterBuilder => "角色构建器插件已卸载!"; public string NoRecommend => "Excel中不存在推荐遗器"; public string BuildSuccess => "构建成功!"; + public string InventoryRelicMax => "背包遗器已满,请先清理背包后再试!"; } \ No newline at end of file