Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Sealed Card problem

Junior Spellweaver
Joined
Jan 3, 2009
Messages
166
Reaction score
6
What wrong with this ?

markalejo11 - Sealed Card problem - RaGEZONE Forums



markalejo11 - Sealed Card problem - RaGEZONE Forums


navirius

Please can you help me ?? i cant put any item.. and no option show up .. i already make it card but still nothing..
 
Last edited:
Skilled Illusionist
Joined
Feb 11, 2010
Messages
302
Reaction score
26
Find this code on ItemRebuild.cpp

PHP:
        if( dwMsg & UIMSG_LB_UP )
	{
	      GLGaeaClient::GetInstance().GetCharacter()->ReqRebuildMoveSealedCard();
		m_bSEAL = true;
	}

follow ReqRebuildMoveSealedCard function, maybe different function on your source,
your ReqRebuildMoveSealedCard must be like this
PHP:
HRESULT GLCharacter::ReqRebuildMoveSealedCard()
{
	GLMSG::SNET_REBUILD_MOVE_SEALED_CARD NetMsg;

	if( m_sPreInventoryItem.VALID() )
	{
		SITEMCUSTOM sPreItem = GET_PREHOLD_ITEM();
		SITEM* pItem = GLItemMan::GetInstance().GetItem( sPreItem.sNativeID );
		if( pItem && pItem->sBasicOp.emItemType == ITEM_SEALED_CARD )
		{
			NetMsg.wPosX = m_sPreInventoryItem.wPosX;
			NetMsg.wPosY = m_sPreInventoryItem.wPosY;
		}
		m_sPreInventoryItem.RESET();
	}

	NETSENDTOFIELD( &NetMsg );

	return S_OK;
}

then you must follow that message to server, make sure you add this line to GLCharMsg.cpp function MsgProcess

PHP:
case NET_MSG_REBUILD_SEALED_CARD:	MsgReqRebuildMoveSealedCard(nmg);	break;

of course , you must have MsgReqRebuildMoveSealedCard function, if you follow instruction on original thread I think its okay
 
Upvote 0
Junior Spellweaver
Joined
Jan 3, 2009
Messages
166
Reaction score
6
@navirius

I already follow your post and post in sealed card.. Still no luck.. I already put all and check it.. May problem nothing appear random option
 
Upvote 0
Junior Spellweaver
Joined
Jan 3, 2009
Messages
166
Reaction score
6
I can put sealed card on slot but i can pud anything ang and i cant see random option ..
I think the problem is glcharactereq.. Can you share yours? navirius
 
Upvote 0
Skilled Illusionist
Joined
Feb 11, 2010
Messages
302
Reaction score
26
I still on the way, if you cant put item, you must make sure that item have random option setting on item editor

random option will showed if item already have random option

 
Upvote 0
Junior Spellweaver
Joined
Jan 3, 2009
Messages
166
Reaction score
6
markalejo11 - Sealed Card problem - RaGEZONE Forums



What about this navirius ... still no ok i already make your instruction but still no luck... :(
 
Last edited:
Upvote 0
Skilled Illusionist
Joined
Feb 11, 2010
Messages
302
Reaction score
26
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
PHP:
int					m_nRebuildOption;

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)
 
Last edited:
Upvote 0
Junior Spellweaver
Joined
Jan 3, 2009
Messages
166
Reaction score
6
@navirius its working but the problem is.. when i rebuild the item... cant move the item that i rebuild.. even to loot item from mobs... whats wrong with that ?? i think got bug

GLCharData.cpp is that correct or not ?
VOID SCHARDATA2::InitRebuildData()
{
m_sRebuildItem.RESET();
m_sPreInventoryItem.RESET();
m_i64RebuildCost = 0;
m_i64RebuildInput = 0;
m_sRebuildSealedCard.RESET(); // add sealed card
m_bRebuildOption [SRANDOM_GEN::MAX_OPT];
}
 
Last edited:
Upvote 0
Experienced Elementalist
Joined
Mar 18, 2013
Messages
280
Reaction score
14
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
PHP:
int                    m_nRebuildOption;

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)

Can you help me because I did not see the declaration of " ReqRebuildSetOption " ?
 
Upvote 0
Skilled Illusionist
Joined
Feb 11, 2010
Messages
302
Reaction score
26
Can you help me because I did not see the declaration of " ReqRebuildSetOption " ?

if you dont have ReqRebuildSetOption, maybe it named with different name, but with same purpose, it can be your code really do not have that function, then you should add it as new method
 
Upvote 0
Back
Top