public bool NpcCanFetchAll(Pathea.NpcPackageCmpt npcPackage) { List <MaterialItem> items = new List <MaterialItem>(); foreach (IDroppableItemList dropItems in _itemLists) { int n = dropItems.DroppableItemCount; for (int i = 0; i < n; i++) { ItemSample item = dropItems.GetDroppableItemAt(i); items.Add(new MaterialItem() { protoId = item.protoId, count = item.stackCount }); } } return(npcPackage.CanAddItemList(items)); }
public void NpcFetchAll(Pathea.NpcPackageCmpt npcPackage) { List <MaterialItem> items = new List <MaterialItem>(); foreach (IDroppableItemList dropItems in _itemLists) { int n = dropItems.DroppableItemCount; for (int i = 0; i < n; i++) { ItemSample item = dropItems.GetDroppableItemAt(i); items.Add(new MaterialItem() { protoId = item.protoId, count = item.stackCount }); } } if (!npcPackage.CanAddItemList(items)) { return; } foreach (MaterialItem item in items) { npcPackage.Add(item.protoId, item.count); } foreach (IDroppableItemList itemDrop in _itemLists) { itemDrop.RemoveDroppableItemAll(); } if (_skAlive != null && GetCount() == 0) { PeEventGlobal.Instance.PickupEvent.Invoke(_skAlive); } }