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

limit #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions Commands/CommandBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions Language/LanguageCHS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ public class PluginLanguage
public string UnloadedCharacterBuilder => "角色构建器插件已卸载!";
public string NoRecommend => "Excel中不存在推荐遗器";
public string BuildSuccess => "构建成功!";
public string InventoryRelicMax => "背包遗器已满,请先清理背包后再试!";
}