okay, I tried to help a little with different approach of sealed card, you can try to learn this thing to fit your need or your like
find GLCharData.h, change
to
PHP:
BOOL m_bRebuildOption[SRANDOM_GEN::MAX_OPT];
find GLContrlInvenMsg.h, change this code
PHP:
struct SNET_REBUILD_OPTION
{
NET_MSG_GENERIC nmg;
int nOption;
SNET_REBUILD_OPTION()
: nOption(-1)
{
nmg.dwSize = sizeof( SNET_REBUILD_OPTION );
nmg.nType = NET_MSG_REBUILD_OPTION;
GASSERT( nmg.dwSize <= NET_DATA_BUFSIZE );
}
};
to
PHP:
struct SNET_REBUILD_OPTION
{
NET_MSG_GENERIC nmg;
int nOption;
BOOL bOptionStats;
SNET_REBUILD_OPTION()
: nOption(-1)
{
nmg.dwSize = sizeof( SNET_REBUILD_OPTION );
nmg.nType = NET_MSG_REBUILD_OPTION;
GASSERT( nmg.dwSize <= NET_DATA_BUFSIZE );
}
};
find GLCharInvenMsg.cpp, replace HRESULT GLChar::MsgReqRebuildSetOption( NET_MSG_GENERIC* nmg ) function with this one
PHP:
HRESULT GLChar::MsgReqRebuildSetOption( NET_MSG_GENERIC* nmg )
{
GLMSG::SNET_REBUILD_OPTION* pNetMsg = (GLMSG::SNET_REBUILD_OPTION*)nmg;
GLMSG::SNET_REBUILD_OPTION NetMsg;
// m_nRebuildOption = -1;
if( pNetMsg->nOption != -1 )
{
NetMsg.nOption = pNetMsg->nOption;
//m_nRebuildOption = NetMsg.nOption;
m_bRebuildOption[pNetMsg->nOption] = pNetMsg->bOptionStats;
}
GLGaeaServer::GetInstance().SENDTOCLIENT( m_dwClientID, &NetMsg );
return S_OK;
}
find GLCharacterMsg.cpp, synchronize part of your code with this one (inside MsgProcess function)
PHP:
case NET_MSG_REBUILD_OPTION:
{
GLMSG::SNET_REBUILD_OPTION* pNetMsg = (GLMSG::SNET_REBUILD_OPTION*)nmg;
m_bRebuildOption[pNetMsg->nOption] = pNetMsg->bOptionStats;
//CInnerInterface::GetInstance().PrintConsoleText("Sealed Card Item Option: %d", m_nRebuildOption );
}
break;
find GLCharactorReq.cpp, replace ReqRebuildSetOption function with this one
PHP:
HRESULT GLCharacter::ReqRebuildSetOption( int nOpt, BOOL bOptStats )
{
GLMSG::SNET_REBUILD_OPTION NetMsg;
SITEMCUSTOM sItemRebuild = GLGaeaClient::GetInstance().GetCharacter()->GET_REBUILD_ITEM();
SITEMCUSTOM sItemRebuildSealed = GLGaeaClient::GetInstance().GetCharacter()->GET_REBUILD_SEALED_CARD();
if( sItemRebuild.sNativeID != NATIVEID_NULL() && sItemRebuildSealed.sNativeID != NATIVEID_NULL() )
{
SITEMCUSTOM sPreItem = GET_REBUILD_SEALED_CARD();
SITEM* pItem = GLItemMan::GetInstance().GetItem( sPreItem.sNativeID );
if( pItem && pItem->sBasicOp.emItemType == ITEM_SEALED_CARD )
{
NetMsg.nOption = nOpt;
NetMsg.bOptionStats = bOptStats;
}
else
{
m_sPreInventoryItem.RESET();
m_sRebuildSealedCard.RESET();
}
}
NETSENDTOFIELD( &NetMsg );
return S_FALSE;
}
find ItemRebuild.cpp, find TranslateUiMessage function and syncronize your code with this code
PHP:
case ITEM_REBUILD_ITEM_OPTION00:
case ITEM_REBUILD_ITEM_OPTION01:
case ITEM_REBUILD_ITEM_OPTION02:
case ITEM_REBUILD_ITEM_OPTION03:
{
if ( CHECK_MOUSEIN_LBUPLIKE( dwMsg ) )
{
int nIndex = ControlID - ITEM_REBUILD_ITEM_OPTION00;
m_pItemOption[nIndex]->SetCheck();
m_nOption = nIndex;
//for(int i = 0; i < 4; i++)
//{
// if ( !m_pItemOption[i]->IsVisible() ) continue;
// if ( i == m_nOption ) continue;
// m_pItemOption[i]->HideCheckOption();
//}
if ( m_nOption != -1 )
{
//CInnerInterface::GetInstance().PrintConsoleText("Selected Option %d", m_nOption);
GLGaeaClient::GetInstance().GetCharacter()->ReqRebuildSetOption( m_nOption, m_pItemOption[m_nOption]->IsChecked() );
}
}
}
break;
you must change MsgReqRebuildResult on GLCharInvenMsg.cpp code to fit this option, especially for pInvenItem->sItemCustom.GENERATE_RANDOM_OPT call, because my code already have heavy modification, I lost original modification for this sealed card
for GENERATE_RANDOM_OPT, you can use original sealed card original sealed card instruction, but for me, it does not fit, because it can generate 2 same option, then I modification for GENERATE_RANDOM_OPT call parameter, and make new RESETOptVALUE with selected option,
(sorry, I cant explain with simple word, because code explain more than words)