mirror of
https://github.com/MikuLeaks/KianaBH3.git
synced 2025-12-12 13:04:33 +01:00
feat: add giveall material
This commit is contained in:
@@ -31,4 +31,17 @@ public class CommandGiveall : ICommands
|
||||
await arg.Target!.Player!.SyncInventory();
|
||||
await arg.SendMsg(I18NManager.Translate("Game.Command.GiveAll.GiveAllItems", I18NManager.Translate("Word.Stigmata")));
|
||||
}
|
||||
|
||||
[CommandMethod("material")]
|
||||
public async ValueTask GiveMaterial(CommandArg arg)
|
||||
{
|
||||
if (!await arg.CheckOnlineTarget()) return;
|
||||
foreach (var conf in GameData.MaterialData.Values)
|
||||
{
|
||||
var quantity = conf.Id == 100 ? 99999999 : (conf.QuantityLimit > 999 ? 999 : conf.QuantityLimit);
|
||||
var item = await arg.Target!.Player!.InventoryManager!.AddItem(conf.Id, quantity, ItemMainTypeEnum.Material, 0, sync: false);
|
||||
}
|
||||
await arg.Target!.Player!.SyncInventory();
|
||||
await arg.SendMsg(I18NManager.Translate("Game.Command.GiveAll.GiveAllItems", I18NManager.Translate("Word.Material")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ public class PacketGetEquipmentDataRsp : BasePacket
|
||||
{
|
||||
WeaponList = { player.InventoryManager!.Data.WeaponItems.Select(weapon => weapon.ToWeaponProto()) },
|
||||
StigmataList = { player.InventoryManager!.Data.StigmataItems.Select(stigmata => stigmata.ToStigmataProto()) },
|
||||
MaterialList = { player.InventoryManager!.Data.MaterialItems.Select(material => material.ToMaterialProto()) }
|
||||
MaterialList = { player.InventoryManager!.Data.MaterialItems.Select(material => material.ToMaterialProto()) },
|
||||
IsAll = true,
|
||||
};
|
||||
|
||||
SetData(proto);
|
||||
|
||||
Reference in New Issue
Block a user