void CDbManager::SaveOneItem( CItemElem* pItemElem, PItemStruct pItemStruct )
{
char szPiercing[32] = {0,};
if( pItemElem->IsEmpty() == FALSE )
{
#if __VER >= 11 // __MA_VER11_05 // 케릭터 봉인 거래 기능 world,database,neuz
if( pItemElem->m_dwItemId == II_SYS_SYS_SCR_SEALCHARACTER )
#if __VER >= 19
sprintf( pItemStruct->szItem, "%d,%d,%d,%d,,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d" ,
#else
sprintf( pItemStruct->szItem, "%d,%d,%d,%d,,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d ,%d/",
#endif
pItemElem->m_dwObjId, pItemElem->m_dwItemId,
0, 0,
pItemElem->m_nItemNum, pItemElem->m_nRepairNumber,
pItemElem->m_nHitPoint, pItemElem->m_nRepair,
0, pItemElem->m_byFlag,
pItemElem->GetSerialNumber(), pItemElem->GetOption(),
pItemElem->m_bItemResist, pItemElem->m_nResistAbilityOption,
pItemElem->m_idGuild,
pItemElem->m_nResistSMItemId
);
else
#if __VER >= 19
sprintf( pItemStruct->szItem, "%d,%d,%d,%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% d"
#ifdef __ITEMGRADE
",%d,%d,%I64d"
#endif
#ifdef __OLD_NEW_GLOW_V2
",%d"
#endif // __OLD_NEW_GLOW_V2
#ifdef __BLING_BLING
",%d"
#endif
#ifdef __MODEL_CHANGE
",%d"
#endif // __MODEL_CHANGE
"/",
#else
sprintf( pItemStruct->szItem, "%d,%d,%d,%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% d/",
#endif
pItemElem->m_dwObjId, pItemElem->m_dwItemId,
0, 0, pItemElem->m_szItemText,
pItemElem->m_nItemNum, pItemElem->m_nRepairNumber,
pItemElem->m_nHitPoint, pItemElem->m_nRepair,
0, pItemElem->m_byFlag,
pItemElem->GetSerialNumber(), pItemElem->GetOption(),
pItemElem->m_bItemResist, pItemElem->m_nResistAbilityOption,
pItemElem->m_idGuild,
pItemElem->m_nResistSMItemId
#ifdef __ITEMGRADE
, pItemElem->nGetGrade()
, pItemElem->GetItemGradeMain()
, pItemElem->GetItemGradeOpt()
#endif
#ifdef __OLD_NEW_GLOW_V2
, pItemElem->m_nNewGlow
#endif // __OLD_NEW_GLOW_V2
#ifdef __BLING_BLING
, pItemElem->m_nReflect
#endif
#ifdef __MODEL_CHANGE
, pItemElem->m_dwnewID
#endif // __MODEL_CHANGE
);
int CDbManager::GetOneItem( CItemElem* pItemElem, char* pstrItem, int *pLocation )
{
int IndexItem = 0;
IndexItem = GetIntPaFromStr( pstrItem, pLocation );
pItemElem->m_dwItemId = (DWORD)GetIntPaFromStr( pstrItem, pLocation );
BOOL bEquip = GetIntPaFromStr( pstrItem, pLocation );
int nTrade = GetIntPaFromStr( pstrItem, pLocation );
GetStrPaFromStr( pstrItem, pItemElem->m_szItemText, pLocation );
pItemElem->m_nItemNum = GetIntPaFromStr( pstrItem, pLocation );
if( CheckValidItem( pItemElem->m_dwItemId, pItemElem->m_nItemNum ) == FALSE )
pItemElem->m_nItemNum = 1;
pItemElem->m_nRepairNumber = (BYTE)GetIntPaFromStr( pstrItem, pLocation );
pItemElem->m_nHitPoint = GetIntPaFromStr( pstrItem, pLocation );
pItemElem->m_nRepair = GetIntPaFromStr( pstrItem, pLocation );
int nMaterial = GetIntPaFromStr( pstrItem, pLocation );
pItemElem->m_byFlag = (BYTE)GetIntPaFromStr( pstrItem, pLocation );
pItemElem->SetSerialNumber( GetSerialNumberPaFromStr( pstrItem, pLocation ) );
pItemElem->SetOption( GetIntPaFromStr( pstrItem, pLocation ) );
pItemElem->m_bItemResist = (BYTE)GetIntPaFromStr( pstrItem, pLocation );
pItemElem->m_nResistAbilityOption = GetIntPaFromStr( pstrItem, pLocation );
pItemElem->m_idGuild = (u_long)GetIntPaFromStr( pstrItem, pLocation );
pItemElem->m_nResistSMItemId = GetIntPaFromStr( pstrItem, pLocation );
#ifdef __ITEMGRADE
pItemElem->nSetGrade(GetIntPaFromStr(pstrItem, pLocation));
pItemElem->SetItemGradeMain(GetIntPaFromStr(pstrItem, pLocation));
pItemElem->SetItemGradeOpt(GetInt64PaFromStr(pstrItem, pLocation));
#endif
// #ifdef __WEAPON_MERGE
// if( pItemElem->IsMerged() )
// {
// pItemElem->SetMergedRandomOptItemId(GetInt64PaFromStr( pstrItem, pLocation ));
// pItemElem->SetMergedWeaponATK(GetIntPaFromStr( pstrItem, pLocation ));
// }
// #endif
pItemElem->m_dwObjId = IndexItem;
#if __VER >= 11 // __MA_VER11_05 // 케릭터 봉인 거래 기능 world,database,neuz
if( pItemElem->m_dwItemId == II_SYS_SYS_SCR_SEALCHARACTER )
{
#if __VER >= 11 // __SYS_PLAYER_DATA
CPlayerDataCenter::GetInstance()->m_Access.Enter();
const char* lpszPlayer = CPlayerDataCenter::GetInstance()->GetPlayerString( pItemElem->m_nHitPoint );
#else // __SYS_PLAYER_DATA
LPCSTR lpszPlayer = prj.GetPlayerString( pItemElem->m_nHitPoint );
#endif // __SYS_PLAYER_DATA
if( lpszPlayer != NULL)
memcpy(pItemElem->m_szItemText,lpszPlayer,sizeof(pItemElem->m_szItemText));
#if __VER >= 11 // __SYS_PLAYER_DATA
CPlayerDataCenter::GetInstance()->m_Access.Leave();
#endif // __SYS_PLAYER_DATA
}
#endif // __MA_VER11_05 // 케릭터 봉인 거래 기능 world,database,neuz
#ifdef __OLD_NEW_GLOW_V2
pItemElem->m_nNewGlow = GetIntPaFromStr( pstrItem, pLocation );
if( pItemElem->m_nNewGlow < FALSE )
pItemElem->m_nNewGlow = NULL;
else
if( pItemElem->m_nNewGlow > TRUE )
pItemElem->m_nNewGlow = NULL;
#endif // __OLD_NEW_GLOW_V2
// #ifdef __BLING_BLING
// pItemElem->m_nReflect = GetIntPaFromStr( pstrItem, pLocation );
// if( pItemElem->m_nReflect < FALSE )
// pItemElem->m_nReflect = NULL;
// else
// if( pItemElem->m_nReflect > TRUE )
// pItemElem->m_nReflect = NULL;
// #endif
#ifdef __MODEL_CHANGE
pItemElem->m_dwnewID = GetIntPaFromStr( pstrItem, pLocation);
ItemProp * pItemProp = prj.GetItemProp( pItemElem->m_dwnewID);
if(!pItemProp)
{
pItemElem->m_dwnewID = NULL;
}
else if(pItemElem->m_dwnewID == NULL_ID)
{
pItemElem->m_dwnewID = NULL;
}
#endif
++*pLocation;
return IndexItem;
}