Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Flyff > Flyff Private Server
You last visited: Today at 09:59

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



CWndQueryEquip question

Discussion on CWndQueryEquip question within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
CWndQueryEquip question

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.
raventh1984 is offline  
Old 01/12/2016, 16:19   #2
 
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 227
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.
alfredico is offline  
Old 01/12/2016, 18:54   #3
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
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?
raventh1984 is offline  
Old 01/12/2016, 19:28   #4
 
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 227
It should be in CWndMgr::MakeToolTipText
But dunno how the extra damage is calculated, it may require something else on server part.

alfredico is offline  
Old 01/12/2016, 20:21   #5
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
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
raventh1984 is offline  
Old 01/12/2016, 21:01   #6
 
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 227
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;
	}
alfredico is offline  
Thanks
1 User
Old 01/12/2016, 21:17   #7
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
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.
raventh1984 is offline  
Reply




All times are GMT +1. The time now is 09:59.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.