ItemUsage SubType 8

06/05/2012 02:33 Zeroxelli#1
Just wondering what it was in 4274. I see some players are generating an unknown subtype of 8 for p1009, and cannot seem to replicate it myself (and they don't know what they did to cause it.) The two who have fired off the error are both archers, so I thought maybe it was autoloading arrows (is that handled by the server?) but I don't get it when mine drop to zero. I remember something around there having to do with stacking items, but surely item stacking wasn't supported in 4274? Anyway, if anyone knows what I can do to replicate it, that'd be the only help I need. :)
06/05/2012 02:50 Korvacs#2
Auto-reloading is a 2.0 feature, and item stacking wasnt changed from the whole drop loads of items on 1 tile untill 2.0 aswell...its also not handled by the item usage packet. I've not encountered it to my knowledge, not really sure what it would be to be honest, arrows that cast a spell? No idea really...
06/05/2012 02:54 Zeroxelli#3
Quote:
Originally Posted by Korvacs View Post
Auto-reloading is a 2.0 feature, and item stacking wasnt changed from the whole drop loads of items on 1 tile untill 2.0 aswell...its also not handled by the item usage packet. I've not encountered it to my knowledge, not really sure what it would be to be honest, arrows that cast a spell? No idea really...
Odd.. shouldn't be any spell related arrows, as I have those disabled (haven't implemented them yet). The client is one of the first 2.0 clients (like the look of it better, and slightly better stability imo). Hmm.. I wish I could figure out what to do to get the subtype, then I could work from there. :/

Oh well, back to trying random crap until it shows up I guess.
06/05/2012 13:05 Korvacs#4
If i were you i would dump the entire character information and current status into a log file when you encounter it, you'll have a better overview of exactly what the character was doing at that time that way.
06/05/2012 14:20 CptSky#5
It happens with archer, when you finish all your arrows. By memory, it's with ranged attack only, not with skills. The best things would be to check in the EO source. I never implemented it, but I still receive it. I don't think that it's much useful, but if you want to implement it, take a look in the EO source.
06/05/2012 19:39 Zeroxelli#6
Yeah, after testing that's what it looks like. Only through archer melee (bow) attacks is it sent, if you run out of arrows in scatter/rf/etc you never get a packet. Ahh, TQ. Thanks guys.
06/05/2012 19:41 #Peer#7
Yeah but if you dont need^^ it is not a Problem ;) you kno
06/05/2012 19:56 Zeroxelli#8
Quote:
Originally Posted by #Peer View Post
Yeah but if you dont need^^ it is not a Problem ;) you kno
True. But I do like to know what all the packets do, it's one of the "fun" parts of making a server. For me, anyway.
06/05/2012 21:00 Korvacs#9
I guess it triggers the arrow reload? Or possibly it's not unique to archers and actually signals dura dropping to 0 on an item, and since archers arrow count is the same dura it just appears to be archer related as that's the most common time it occurs.
06/05/2012 21:13 Zeroxelli#10
Quote:
Originally Posted by Korvacs View Post
I guess it triggers the arrow reload? Or possibly it's not unique to archers and actually signals dura dropping to 0 on an item, and since archers arrow count is the same dura it just appears to be archer related as that's the most common time it occurs.
Tried on other classes and can't get it to happen. It also doesn't always happen when arrows reach 0. So I'm just going to ignore it for now and leave arrow reloading to my handler.
06/06/2012 01:00 Korvacs#11
Hmm, ill have to take a look at this some time if i get a chance...
06/06/2012 02:43 Zeroxelli#12
Actually, oddly enough, I was mistaken. It seems to be sent when you run out of arrows, but only after equipping a new set of arrows. Going to check the contents of the packet.

Edit: Your 1009s "Position" and "UniqueID" will both be set the UniqueID of an item. One is usually the bow, the other is the UID of an empty set of arrows. It occurs when an empty set of arrows exist in the inventory and possibly the equipment. I guess it's to tell you to remove the empty set, or something like that. Considering my handler deletes the arrows before they make it back to inventory, I don't get it unless I actually let them go there. It is a rather useless packet.
06/06/2012 09:22 Korvacs#13
Have you tested wearing a piece of gear and reducing its dura to absolute 0?
06/06/2012 09:35 Zeroxelli#14
Quote:
Originally Posted by Korvacs View Post
Have you tested wearing a piece of gear and reducing its dura to absolute 0?
Yeah, didn't send the packet in that case either, though it could be different for the 4274 client (I only tested other gear on the 4283, which has minor differences, mainly in item info structures for the addition of bless and enchant)

Hopefully I'll have the time to test it a bit more tomorrow.
06/06/2012 09:57 Korvacs#15
Had a look in the EO source and its used to combine 2 sets of items together, so its triggered in an attempt to combine 2 sets of arrows togeather. But it is not archer specific.

Code:
bool CUser::CombineItem		(OBJID idItem, OBJID idOther)
{
	CItemPtr pItem = GetItem(idItem);
	CItemPtr pOther = GetItem(idOther);
	if(!pItem || !pOther || !pItem->IsPileEnable() || pItem->GetInt(ITEMDATA_TYPE) != pOther->GetInt(ITEMDATA_TYPE))
		return false;

	int nNewNum		= pItem->GetInt(ITEMDATA_AMOUNT) + pOther->GetInt(ITEMDATA_AMOUNT);
	if(nNewNum > pItem->GetInt(ITEMDATA_AMOUNTLIMIT))
	{
		pOther->SetInt(ITEMDATA_AMOUNT, nNewNum - pItem->GetInt(ITEMDATA_AMOUNTLIMIT));
		{
			CMsgItem	msg;
			IF_OK(msg.Create(pOther->GetID(), ITEMACT_SYNCHRO_AMOUNT, pOther->GetInt(ITEMDATA_AMOUNT)))
				SendMsg(&msg);
		}
		pItem->SetInt(ITEMDATA_AMOUNT, pItem->GetInt(ITEMDATA_AMOUNTLIMIT));
		{
			CMsgItem	msg;
			IF_OK(msg.Create(pItem->GetID(), ITEMACT_SYNCHRO_AMOUNT, pItem->GetInt(ITEMDATA_AMOUNT)))
				SendMsg(&msg);
		}
	}
	else
	{
		EraseItem(idOther, SYNCHRO_TRUE);
		pItem->SetInt(ITEMDATA_AMOUNT, nNewNum);
		{
			CMsgItem	msg;
			IF_OK(msg.Create(pItem->GetID(), ITEMACT_SYNCHRO_AMOUNT, pItem->GetInt(ITEMDATA_AMOUNT)))
				SendMsg(&msg);
		}
	}

	return true;
}