CWndQueryEquip question

01/11/2016 10:45 raventh1984#1
Hi elitepvpers,

When i vie my item inside the inventory i see extra stats.
However when someone else is viewing my item it doesnt see the extra stats.

is it because QueryEquip is an array that holds the basic things?

For example my weapon has 400~600 Damage output
But when someone else is viewing it it shows the standard damage that is inside Spec_Item.
01/12/2016 16:19 alfredico#2
CWndQueryEquip::OnMouseWndSurface
I don't know what you are trying to say exactly. But adding new param to show in tooltip is there. Also need to add serverside part (User.cpp, DPSrvr.cpp and CDPClient.cpp) IF needed.
01/12/2016 18:54 raventh1984#3
Well i tested it out.

CWndQueryEquip::OnMouseWndSurface

Code:
g_WndMng.PutToolTip_Item((CItemBase*)&itemElem, point2, &DrawRect, APP_QUERYEQUIP);
So basicly its saying for all the ItemElem show the toolTip.

But here is the catch.

PutToolTip has
PutItemMinMax(pMover, pItemElem, &strEdit); To show the min max damage of the weapon.

when i am viewing my weapon it shows the min~max like this

Code:
int nMin = (int)(pMover->GetItemAbilityMin(pItemElem->GetProp()->dwID) + pItemElem->GetMinMaxAttack() * f);
			int nMax = (int)(pMover->GetItemAbilityMax(pItemElem->GetProp()->dwID) + pItemElem->GetMinMaxAttack() * f);
So example Guardian Sword. Min Max = 258 263 according Spec_Item
Now i add +100 so total is 358~363 damage

However when someone else is viewing my inventory then its showing 258~263 weapon damage. Thus not showing the Extra damage.

So thats why i was wondering if i missed something?
01/12/2016 19:28 alfredico#4
It should be in CWndMgr::MakeToolTipText
But dunno how the extra damage is calculated, it may require something else on server part.

01/12/2016 20:21 raventh1984#5
This is is what i also have inside MakeToolTip_Text
Code:
case IK2_WEAPON_DIRECT:
	case IK2_WEAPON_MAGIC:
	case IK2_ARMORETC:
	case IK2_CLOTHETC:
	case IK2_ARMOR:
	case IK2_CLOTH:
	case IK2_BLINKWING:
	{
						  PutItemMinMax(pMover, pItemElem, &strEdit); //Min Max Attack/Defence of the Weapon/Shield/Armor
if i take an look @ Item Linking
void CWndLinkedItem::OnDraw(C2DRender *p2DRender)

then we have it like this
g_WndMng.PutItemMinMax( pMover, m_pItem, &strEdit );

So that is working correctly.
So it must be located somewhere else.

Also inside void CWndQueryEquip::OnMouseWndSurface(CPoint point)

If i do this
//itemElem.m_dwItemId = pMover->m_aEquipInfo[i].dwId;

Then there is no tooltip to show.
So it looks to me that its stored in m_aEquipInfo
01/12/2016 21:01 alfredico#6
I would try replacing pItemElem->GetMinMaxAttack() for a random number, like 100 for example. If it shows correctly the problem might be in pItemElem (not in pItemElem->GetProp() which is ItemProp class), in that case you need to send information to server first, for later retrieve on client.


Quote:
If i do this
//itemElem.m_dwItemId = pMover->m_aEquipInfo[i].dwId;

Then there is no tooltip to show.
So it looks to me that its stored in m_aEquipInfo
If you remove that, obviously it's not going to work.

Code:
void CWndMgr::MakeToolTipText(CItemBase* pItemBase, CEditString& strEdit, int flag)
{
	if (pItemBase == NULL)
		return;
	ItemProp *pItemProp = pItemBase->GetProp();
	if (pItemProp == NULL)
	{
		Error("(ERROR) CWndMgr::MakeToolTipText(%d): ItemProp for item %d is NULL",
			__LINE__, pItemBase->m_dwItemId);
		assert(0);
		return;
	}
01/12/2016 21:17 raventh1984#7
Thanks the problem is indeed pItemElem->GetMinMaxAttack().

Replaced it by an random number and that worked.

Here i found the AddQueryEquip

Code:
void CUser::AddQueryEquip( CUser* pUser )
{
	if( IsDelete() )	return;
	
	m_Snapshot.cb++;
	m_Snapshot.ar << GETID( pUser );
	m_Snapshot.ar << SNAPSHOTTYPE_QUERYEQUIP;

	u_long uOffset	= m_Snapshot.ar.GetOffset();
	int cbEquip		= 0;
	
	m_Snapshot.ar << cbEquip;
	
	for( int i = 0; i < MAX_HUMAN_PARTS; i++ )
	{
		CItemElem* pItemElem	= pUser->GetEquipItem( i );
		if( pItemElem )
		{
			m_Snapshot.ar << i;
#ifdef __ITEMGRADE
			m_Snapshot.ar << pItemElem->nGetGrade();
			m_Snapshot.ar << pItemElem->GetMinMaxAttack();
			m_Snapshot.ar << pItemElem->GetPrimaryStat();
			m_Snapshot.ar << pItemElem->GetSecondaryStat();
#endif
			m_Snapshot.ar << pItemElem->GetRandomOptItemId();
//			m_Snapshot.ar.Write( &pItemElem->m_piercingInfo, sizeof(PIERCINGINFO) );
			pItemElem->SerializePiercing( m_Snapshot.ar );
			m_Snapshot.ar << pItemElem->m_bItemResist;
			m_Snapshot.ar << pItemElem->m_nResistAbilityOption;
			cbEquip++;
		}
	}

	GETBLOCK( m_Snapshot.ar, lpBlock, nBlockSize );
	*(UNALIGNED int*)( lpBlock + uOffset )	= cbEquip;

	
}
I believe this is where it will update the item. I will test it.
Will post result here.