Durability?

03/19/2011 15:35 Lateralus#1
I've done some tests, and can't seem to find a relation for depletion of durability on an item and its representation (35/38 for example).

1. How is durability calculated?
2. How often is the update durability subtype for packet 0x3F1 sent?
03/19/2011 15:49 iStefan#2
Durablity is sent by GeneralData ??? Naaw I Don't think so rofl.
03/19/2011 15:58 Lateralus#3
Quote:
Originally Posted by iStefan View Post
Durablity is sent by GeneralData ??? Naaw I Don't think so rofl.
My bad, I meant 0x3F1. Subtype for v4267 is 0x11.
03/19/2011 22:18 .Kinshi#4
An item's durability is in the itemtype.dat.
The value shown in the client is the value / 100.
03/19/2011 22:21 Lateralus#5
Quote:
Originally Posted by .Kinshi View Post
An item's durability is in the itemtype.dat.
The value shown in the client is the value / 100.
Thanks... But more specifically, how is the durability depleted when a monster attacks a character for example? It's not a 1:1 ratio between attacks and durability, definitely.
03/20/2011 00:39 .Kinshi#6
I would image, if the attack hits, take off 1 from the durability?
03/20/2011 00:50 KraHen#7
@K: I guess you`re using mets to repair it after every xp skill?

IMO just try different ratios, like 1 dura / 8 hits or something like that. Or start debugging binaries.
03/20/2011 03:43 nTL3fTy#8
Quote:
Originally Posted by KraHen View Post
Or start debugging binaries.
Or you could poke around the EO server source. There's a lot of useful information inside it.

The main function that decrements durability:
Code:
bool CUser::DecEquipmentDurability(bool bBeAttack, bool bMagic, int bDurValue/*=1*/)
{
	int nInc = -1 * bDurValue;
	for(int i = ITEMPOSITION_EQUIPBEGIN; i < ITEMPOSITION_EQUIPEND; i++)
	{
		if (!bMagic)
		{
			if (i == ITEMPOSITION_RINGR || 
					i == ITEMPOSITION_RINGL ||
						i == ITEMPOSITION_SHOES ||
							i == ITEMPOSITION_WEAPONR ||
								i == ITEMPOSITION_WEAPONL)
			{
				if(!bBeAttack)
					AddEquipmentDurability(i, nInc);
			}
			else
			{
				if(bBeAttack)
					AddEquipmentDurability(i, nInc);
			}
		}
		else
		{
			if (i == ITEMPOSITION_RINGR || 
					i == ITEMPOSITION_RINGL ||
						i == ITEMPOSITION_SHOES ||
							i == ITEMPOSITION_WEAPONR ||
								i == ITEMPOSITION_WEAPONL)
			{
				if(!bBeAttack)
					AddEquipmentDurability(i, -5);
			}
			else
			{
				if(bBeAttack)
					AddEquipmentDurability(i, nInc);
			}
		}
	}
	return true;
}
You can find where/how its called fairly easily.
03/20/2011 04:04 Lateralus#9
Quote:
Originally Posted by nTL3fTy View Post
Or you could poke around the EO server source. There's a lot of useful information inside it.

The main function that decrements durability:
Code:
bool CUser::DecEquipmentDurability(bool bBeAttack, bool bMagic, int bDurValue/*=1*/)
{
	int nInc = -1 * bDurValue;
	for(int i = ITEMPOSITION_EQUIPBEGIN; i < ITEMPOSITION_EQUIPEND; i++)
	{
		if (!bMagic)
		{
			if (i == ITEMPOSITION_RINGR || 
					i == ITEMPOSITION_RINGL ||
						i == ITEMPOSITION_SHOES ||
							i == ITEMPOSITION_WEAPONR ||
								i == ITEMPOSITION_WEAPONL)
			{
				if(!bBeAttack)
					AddEquipmentDurability(i, nInc);
			}
			else
			{
				if(bBeAttack)
					AddEquipmentDurability(i, nInc);
			}
		}
		else
		{
			if (i == ITEMPOSITION_RINGR || 
					i == ITEMPOSITION_RINGL ||
						i == ITEMPOSITION_SHOES ||
							i == ITEMPOSITION_WEAPONR ||
								i == ITEMPOSITION_WEAPONL)
			{
				if(!bBeAttack)
					AddEquipmentDurability(i, -5);
			}
			else
			{
				if(bBeAttack)
					AddEquipmentDurability(i, nInc);
			}
		}
	}
	return true;
}
You can find where/how its called fairly easily.
That's a good idea for these types of calculations; I completely forgot about that source.
03/20/2011 11:36 iStefan#10
aaaaa Okay my apologizes. There's a thread by 12talis for durablity, you can check it and take example from there.
03/20/2011 15:11 Lateralus#11
Quote:
Originally Posted by iStefan View Post
aaaaa Okay my apologizes. There's a thread by 12talis for durablity, you can check it and take example from there.
Yes, but it's far from close to the official calculation. I have no problem implementing it, it's getting the official calculation that's the problem.
03/23/2011 18:58 pintinho12#12
I didnt read all posts
but on the binaries, its like 10000 = 100 Durability '-'
then its 100 hits = 1 Dura '-'