feat: add valk command

This commit is contained in:
Naruse
2025-06-14 16:51:41 +08:00
parent 07ec2f9abf
commit 969adeca34
10 changed files with 98 additions and 371 deletions

View File

@@ -3,6 +3,7 @@ using KianaBH.Database;
using KianaBH.Database.Inventory;
using KianaBH.Enums.Item;
using KianaBH.GameServer.Game.Player;
using KianaBH.GameServer.Server.Packet.Send.Item;
using KianaBH.Proto;
using KianaBH.Util;
using static KianaBH.Proto.MasterPupilRetcode.Types;
@@ -13,8 +14,7 @@ public class InventoryManager(PlayerInstance player) : BasePlayerManager(player)
{
public InventoryData Data = DatabaseHelper.GetInstanceOrCreateNew<InventoryData>(player.Uid);
public async ValueTask<ItemData?> AddItem(int itemId, int count, ItemMainTypeEnum type, int level = 1, int equipAvatar = 0, bool notify = true,
bool sync = true)
public async ValueTask<ItemData?> AddItem(int itemId, int count, ItemMainTypeEnum type, int level = 1, int equipAvatar = 0, bool sync = true)
{
ItemData? itemData = null;
@@ -34,6 +34,8 @@ public class InventoryManager(PlayerInstance player) : BasePlayerManager(player)
break;
}
if (sync) await Player.SendPacket(new PacketGetEquipmentDataRsp(Player));
return itemData;
}