I have not worked it all out either. I guess it comes down to the order the events fire in, for packing the items onto the NPC. Could it be as simple as when you create the item into the NPC's inventory, A check to see if the npc has the item or not. ( It hit the ground ) determins if another one needs to be created?
As far as the NPC themselves, If they aquire all of there inventory before the OnSpawn event. (not sure it has been awhile since I have looked at the orderof the events, again) Place a script in there OnSpawn event that just moves all of there inventory to a store refferenced by a local on the NPC. That way all you have to do is spawn the NPC and you are done. An additinal benifit that I see is that Items may get auto stacked for you in the NPC inventory.
The disadvantage I see, is that it will be harder to loop through the list in the DB to see what is in it.
EDIT: I forgot to say have the NPC destroy himself after moving the items.
Modifié par Lightfoot8, 10 janvier 2012 - 02:02 .