[Question] Item Awakening Database Entry

05/17/2020 14:19 deleonrenz024#1
Hey guys, I'm currently creating an inventory viewer using PHP, I'm able to get the following details: Item ID, Element Type, Element +, Upgrade +, Piercing and Piercing Cards. However, I can't find the awakes on the Database, may I know where it is saved? Thank you.
05/17/2020 14:35 Naltalah#2
The awake is in the usual Item String, it's this big ass 64 bit Integer.

There used to be a released PHP script to convert these into readable awakes again, but it got removed.

I guess you could take a look at how flyff does it and try to code it yourself in PHP.

Code:
BOOL	CRandomOptionProperty::GetParam( __int64 nRandomOptItemId, int i, int* pnDst, int* pnAdj )
{
	if( i >= MAX_RANDOM_OPTION )
		return FALSE;

	int nRandomOption	= static_cast<int>( nRandomOptItemId >> ( 8 + i * 18 ) );
	*pnAdj	= nRandomOption & 0x000001FF;
	if( nRandomOption & 0x00000200 )
		*pnAdj	= -*pnAdj;
	nRandomOption	= nRandomOption >> 10;

	*pnDst	= nRandomOption & 0x0000007F;

	return ( *pnDst > 0 );
}

int CRandomOptionProperty::GetRandomOptionSize( __int64 nRandomOptItemId )
{
	int nSize	= 0;


	bool	bCheckedSafeFlag = false;
	bCheckedSafeFlag	= IsCheckedSafeFlag( nRandomOptItemId );

	if( bCheckedSafeFlag == true )
	{
		return	nSize;
	}


	__int64 i	= 0x3FFFF << 8;
	for( int j = 0; j < MAX_RANDOM_OPTION; j++ )
	{
		if( nRandomOptItemId & i )
			nSize++;
		else
			return nSize;

		i	= i << 18;
	}

	return nSize;
}
To look into deeper, check any randomoption.cpp file.
05/19/2020 11:37 ZeroTwo02#3
[Only registered and activated users can see links. Click Here To Register...]
05/26/2020 13:25 deleonrenz024#4
dang man, thanks for real. was struggling a lot here. But I will try to learn how does the game handles this.