Page 1 of 1
Dropping a stack of an item
PostPosted: Sun Aug 26, 2007 2:50 pm
by Tolakram
Howdy,
I want to drop a stack of 50 or so arrows (yea, I'm sticking to the old archery) but there doesn't seem to be a way to drop a quantity of items, just one at a time?
Am I just missing something? Has anyone written a work around for this (assuming I'm not being stupid)?
Thanks.
PostPosted: Sun Aug 26, 2007 3:18 pm
by stealth215
max count field
packsize field
set Max Count to like 200 or w/e and then set packsize to 50...it should would i think
PostPosted: Sun Aug 26, 2007 3:57 pm
by Tolakram
Unfortunately PackSize is not handled by the loot generator.
Ah, I found two problems:
in GameNPC.DropLoot
if (((GameInventoryItem)loot).Item.Id_nb == "aurulite")
{
((GameInventoryItem)loot).Item.Count = ((GameInventoryItem)loot).Item.PackSize;
}
So for whatever reason someone decided only aurulite can recognize packsize.
The second problem is that I can set Count to be what I want to drop when the item is an inventory item, but the loot generator uses itemtemplate not inventory item, so the Count is lost.
So the only way to set how many you want to drop is via packsize. Can someone remove the aurulite restriction to packsize? I'm going ahead and removing it locally, but I question why the restriction is there in the first place. Null or 0 packsize should equal 1, anything else should be used when dropping the loot.
if (((GameInventoryItem)loot).Item.PackSize > 1)
((GameInventoryItem)loot).Item.Count = ((GameInventoryItem)loot).Item.PackSize;
Re: Dropping a stack of an item
PostPosted: Sat Mar 26, 2016 9:29 pm
by Marko
Sorry to revive this old thread, but did you ever get this to work Tola? I'm trying to get DF princes and high lords to drops stacks of seals like 'live' . I've updated both the itemtemplate maxcount (25) and packsize (10), and I've added set count in the loottemplate count (10) just for Princes & Lords.
I'd like other DF mobs to still drop singles though, so... can this be done? Right now I"m getting stacks, but everything is dropping stacks, not just the Princes and Lords..
Re: Dropping a stack of an item
PostPosted: Wed Mar 30, 2016 7:57 am
by Maze
You don't want packsize, you want to set the drop count higher. Packsize is for loot that you want to always buy in stacks.
I don't think my code ever got committed, but I did work on the loot generator some years back, but never finished. I think my loot code works very well:
http://www.dolserver.net/viewtopic.php?f=47&t=20899 it may fix some issues you're having.
I also don't know how old this issue is and what changes happened since the posts in this thread. Would have been better to start a new thread than to necropost.
