Loot

04/16/2012 12:10 Sturolv#1
In my struggle to learn more about the game and automation I have tried to find out if there is a way to detect if drops like coins and so on from a recently killed mob is locked to the party from where the player that killed the mob belongs.

This to not try to pickup loot that can't be picked up yet. Loot that recently dropped have some sparkeling around it, and can't be picked up by other players (not in my party).

There must not be information about this on the client side though. Maybe the control is only server side when the client tries to pickup it just doesn't get a message back from the server that it has succeeded, or a msg about failed pick up? If it's this way, I could perhaps try to pick it up but keep a list of item ids that has been tried to be picked up and avoid to try to pick them up again.

The drop can sometimes delay to show up after a mobs death so I let it wait 2 seconds before moving on. If loot drops within this time I try to pick it up, and when done I check again if there is new items within a few meters radius from the position the mob was at when it died. This could be an infintive loop if someone generates loot next to my char efter it has killed a mob, but who would generate loot there? Maybe an evil GM would, so I maybe should limit the pickup to say 10 or so items.

Anyone have a few cents to throw in about this? :)
04/16/2012 14:33 dumbfck#2
I've never looked at this but I would expect there's either a client side flag saying whether you can pick it up or a player ID associated with each item on the floor.
Unfortunately there is no sequential list for items on the ground, otherwise it would have been fairly easy to quickly inspect the memory area for an item on the floor. However, perhaps you could make a little script to dump out the base address for each nearby item struct, then quickly view that memory region in CE or something and see if anything changes (flashes red) at the time when the item becomes available for pickup.
There's probably a much better way of doing this... I don't know lol.
04/16/2012 14:48 Sᴡoosh#3
I looked for something like this long ago, never found anything. I check if players are near each drop, that's how I try to stop dropstealing.... but if you do find anything I may have overlooked, do post please :D
04/16/2012 15:16 Sturolv#4
Good idea! I have dumping the memory but wait, I only did that for coins that I dropped my self, maybe if I drop something anyone can grab it immediately? Maybe if there is and id stamped into the item-struct, but perhaps it's not my chars id but instead something else that is for binding the item to the party with players that caused this item to drop from a dead mob. Maybe I should amuse myself with going through the code before, under and after the pickup function in the game.

I will investigate this a bit more, and of course I tell what I find out, thanks guys :)
04/17/2012 09:09 Interest07#5
When trying to pick an item up, I believe it waits for the server to tell whether you succeeded or not. In my bot I just made a list of dropped items near my kill and try to pick each up and remove them from the list whether I managed to pick up or not. That way he wouldn't loop trying to pick the same item.
04/17/2012 09:48 dumbfck#6
I had a little play with this last night and my findings were the same as Interest said. On the client side, the gather function still runs right through and sends a 'pickup' packet to the server. If you can't have the loot, it simply returns the error code which is translated into the "unable to pick up" message.
However, I would think there must be something client side which tells the rendering engine to show sparkly bits around the item on the floor?
Not quite sure how to go about finding that though :p
04/17/2012 10:25 Sᴡoosh#7
dumbfck, the Sparkly bits - what do they actually mean? That the item is yours? I never noticed them really until you said this.
04/17/2012 10:33 dumbfck#8
Quote:
Originally Posted by Sᴡoosh View Post
dumbfck, the Sparkly bits - what do they actually mean? That the item is yours? I never noticed them really until you said this.
I hadn't noticed them until Sturolv mentioned them hehe.
I'm not certain... I don't think they mean the item is yours though, specifically. I had two chars standing next to each other and was dropping items. On the char that the items didn't belong to, I could see sparkly bits.
I'm wondering if it just means that they're not available to everyone yet. The split second those sparkly bits disappear, the item is available for pickup.
I was considering delving into some graphics stuff but it was getting late lol.
Found a couple of files that *might* possibly be related, but I wouldn't swear to it xD (this is just from going through gfx.pck and looking at the images)
Code:
gfx.pck.files\gfx\textures\图案\xingqun.dds
or maybe
gfx.pck.files\gfx\textures\多个粒子\星通道.dds
Just not exactly sure how to proceed :P

Edit: I vaguely remember something in the GM console that could show all loaded textures or something, so I might start there. Or I might just be imagining that.
04/17/2012 10:39 Sᴡoosh#9
Interesting. I will check this out again too - would be awesome to find a flag we oversaw :)

Could perhaps be bitwise in one offset. Like this:

+0x14C Type, 2byte :
0000 0000 0000 0001 - loot
0000 0000 0000 0010 - mines
0000 0000 0000 0011 - coins
...

Perhaps there's a flag hiding in there. I never checked farther then this :D
04/17/2012 10:49 dumbfck#10
Indeed :P
I don't think it's anywhere in the world item struct though. I'm fairly confident now that nothing in there changes when the sparkles turn off. I might just be missing it though.
Btw... That example looks more like an enum than a bitwise flag arrangement?
Those values there are 1, 2 and 3. Normally with flags they would be 1, 2, 4
E.g.,
0x0001 = 0b0000000000000001
0x0002 = 0b0000000000000010
0x0004 = 0b0000000000000100

I was almost worried for a minute that PWE might have done something efficiently lol.
04/17/2012 11:10 Sᴡoosh#11
It could be an enum to - I wasn't sure, that's why I posted it bitwise lol. Yeah, but you are right - nothing changes here.

And no - PWE does nothing efficiently :D
04/17/2012 13:59 Interest07#12
Even if you found this value though, your own drops will also sparkle. So unless you wanna wait with picking up your own drops until everybody can pick em up ...:p
04/17/2012 15:16 Sᴡoosh#13
True.

Also, I have noticed that the message saying unable to pickup doesn't appear as soon as you click - it happens soon afterwards, which further indicates that the client asks server :(
04/17/2012 15:26 dumbfck#14
Yep, it pretty much comes straight from recvPacket straight into a switch table into drawStatusText to output the message. It's definitely decided server side if you're allowed to pick it up - Just thought the sparkles might have been a sneaky way to do it lol. But as Interest pointed out, I think we're going down a dead-end here unfortunately.

Anyway... I have a suspicion that the sparkles might just have a fixed sprite animation duration, defined in the .gfx file, which I think is either: gfx.pck.files\gfx\程序联入\角色出现人类.gfx
or
gfx.pck.files\gfx\策划联入\状态效果\物理反震.gfx
It doesn't seem to be checked against any in-game timers because if you pause the client, it doesn't decrease the duration of the sparkles when you resume.

Oh well :P
I might have a play with d_gfx in the console when I get home later anyway lol.
04/17/2012 21:16 Sturolv#15
Had been nice to know clientside. If it's only serverside control, we can try pickup stuff at least one or a few times without that it looks like a bot.