Hi,
I have this script for moving items from one NPC to another, which works fine:
Code:
FUNC void B_TransferInventory(var C_Npc giver, var C_Npc taker)
{
var int itemInstance;
var int slotNr;
var int count;
repeat(itemCategory, INV_CAT_MAX); var int itemCategory;
slotNr = 0;
count = Npc_GetInvItemBySlot(giver, itemCategory, slotNr);
while(count > 0);
itemInstance = Hlp_GetInstanceID(item);
CreateInvItems(taker, itemInstance, count);
NPC_RemoveInvItems(giver, itemInstance, count);
count = Npc_GetInvItemBySlot(giver, itemCategory, slotNr);
end;
end;
};
(Based on this)
(I plan on using the slotNr to ignore certain items in the future)
Can I adjust this or do something similar to transfer items to/from a chest (NPC <=> chest)?
Thanks in advance!