Quote:
Originally Posted by gabrola
The UID you get in the item info packet is different from the one you get from the item drop packet, the one you see in the item drop packet changes every time you drop the item. As far as I remember the UID in the item info packet doesn't change.
|
^ this.
Ground uids are based on a counter that tq uses (or so I've been told). Essentially it assigns a uid to items dropped on ground skiping npc uids.
Not that it really helps for any sort of auto looter but that's how it was explained to me. Each time you drop something on the ground it's assigned a uid.... if you were the only one on the map killing anything and dropped items they should increase by uid of 1 each time (skipping any used uids for other objects)
I ASSUME this is for an autohunt/loot type purpose so I'll explain how I always have done looting (I'm sure there are better ways and someone should definitely enlighten us if they can :P)
On picking up and item I determine if it should be dropped... I add it to a list of inventory items to be dropped..
As part of my botting code I check if I have items waiting to drop.. run a calculation to decide if I want to (how long since last dropped items... how many items waiting to be dropped, etc).
If those pass I drop the item and set my character to have last dropped an item now and last droped static id to be the item id I dropped..
In my packet handling code whenever I receive a item usage to remove item from my inventory I check if it's an item I am attempting to drop and if so remove it from the todrop list and from my inventory (cause sometimes you will send drop packet but server will not let you cause you just moved or w/e... it's just safer that way I found)
In my packet handling code whenever I receive a new item being added to the ground I check if the last time I dropped an item was say... less than 500 ms ago.. if so I check if the static id of the item dropped is the same as the last item I attempted to drop. If so I add it to a temporary ignore list (based on ground uid) basically saying for the next 60 seconds do not attempt to pick up a ground item with a uid of XXX
It worked fine in all my tests but I'm sure some others have different ways of doing things.