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!

Weapon rarity increase problem, ask for help!

Newbie Spellweaver
Joined
May 12, 2022
Messages
85
Reaction score
2
I added a __WEAPON_RARITY, and the upgrade was successful, but once the client is restarted, the save effect will be lost, can someone teach me how to do it?
 
Newbie Spellweaver
Joined
Nov 24, 2023
Messages
17
Reaction score
3
How do I update the initial value in BASE_VALUE_TBL, can you teach me? I've tried a lot of methods, but I can't update it! Thanks in advance, big guy!
this does not need to be updated.
#ifdef __WEAPON_RARITY
",%d"
#endif // __WEAPON_RARITY

#ifdef __WEAPON_RARITY
, pItemElem->GetWeaponRarity()
#endif // __WEAPON_RARITY
you just need to put this on the right line on your
C++:
CDbManager::SaveOneItem
 
Upvote 0
Newbie Spellweaver
Joined
May 12, 2022
Messages
85
Reaction score
2
this does not need to be updated.

you just need to put this on the right line on your
C++:
CDbManager::SaveOneItem

if( pItemElem->m_dwItemId == II_SYS_SYS_SCR_SEALCHARACTER )
sprintf( pItemStruct->szItem, "%d,%d,%d,%d,,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d/",
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

sprintf( pItemStruct->szItem, "%d,%d,%d,%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d"

#ifdef __LOOKCHANGE
",%d"
#endif

#ifdef __WEAPON_RARITY
",%d"
#endif // __WEAPON_RARITY

#ifdef __SYS_LOCK_ITEM
",%d"
#endif //__SYS_LOCK_ITEM






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 __LOOKCHANGE
, pItemElem->GetLook()
#endif

#ifdef __WEAPON_RARITY
, pItemElem->GetWeaponRarity() // 1x %d added.
#endif // __WEAPON_RARITY

#ifdef __SYS_LOCK_ITEM
, pItemElem->IsItemLocked() // 1x %d added.
#endif //__SYS_LOCK_ITEM

#ifdef __CHIP_PLAYERSHOP
pItemElem->m_nBuyMode, // 1x %d added.
#endif // __CHIP_PLAYERSHOP

#ifdef __UPGRADE_SUCCESS
pItemElem->m_nUpgradeTries // 1x %d added.
#endif //__UPGRADE_SUCCESS

#ifdef __WEAPON_MERGE
, pItemElem->GetMergedRandomOptItemId() // 1x %I64d added.
, pItemElem->GetMergedWeaponATK() // 1x %d added.
#endif //__WEAPON_MERGE

#ifdef __PET_GLOW
, pItemElem->m_nPetGlow // 1x %d added.
#endif // __PET_GLOW

#ifdef __CRYSTAL
, pItemElem->GetCrystal() // 1x %d added.
#endif //__CRYSTAL

#ifdef __SWITCH_GLOW_OLDNEW
, pItemElem->m_bGlowOld
#endif // __SWITCH_GLOW_OLDNEW

#ifdef __RUNES_BONUS_FASHION
, pItemElem->m_dwRuneID
#endif
 
Upvote 0
Newbie Spellweaver
Joined
Jan 24, 2024
Messages
9
Reaction score
3
You still getting the same problem after inserting the snippet "
Code:
#ifdef __WEAPON_RARITY
",%d"
#endif // __WEAPON_RARITY
in your SaveOneItem( CItemElem* pItemElem, PItemStruct pItemStruct ) function? That should fix the problem.
 
Upvote 0
Newbie Spellweaver
Joined
May 12, 2022
Messages
85
Reaction score
2
You still getting the same problem after inserting the snippet "
Code:
#ifdef __WEAPON_RARITY
",%d"
#endif // __WEAPON_RARITY
in your SaveOneItem( CItemElem* pItemElem, PItemStruct pItemStruct ) function? That should fix the problem.
I've inserted this code, and still won't save it!
 
Upvote 0
Newbie Spellweaver
Joined
Jan 24, 2024
Messages
9
Reaction score
3
Try this, you are missing a lot of format specifier.
Code:
if( pItemElem->m_dwItemId == II_SYS_SYS_SCR_SEALCHARACTER )
sprintf( pItemStruct->szItem, "%d,%d,%d,%d,,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d/",
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

sprintf( pItemStruct->szItem, "%d,%d,%d,%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d"",%d"",%d"",%d"",%d"",%d"",%d"",%d"",%d"

#ifdef __LOOKCHANGE
",%d"
#endif

#ifdef __WEAPON_RARITY
",%d"
#endif // __WEAPON_RARITY

#ifdef __SYS_LOCK_ITEM
",%d"
#endif //__SYS_LOCK_ITEM





"/",
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 __LOOKCHANGE
, pItemElem->GetLook()
#endif

#ifdef __WEAPON_RARITY
, pItemElem->GetWeaponRarity() // 1x %d added.
#endif // __WEAPON_RARITY

#ifdef __SYS_LOCK_ITEM
, pItemElem->IsItemLocked() // 1x %d added.
#endif //__SYS_LOCK_ITEM

#ifdef __CHIP_PLAYERSHOP
pItemElem->m_nBuyMode, // 1x %d added.
#endif // __CHIP_PLAYERSHOP

#ifdef __UPGRADE_SUCCESS
pItemElem->m_nUpgradeTries // 1x %d added.
#endif //__UPGRADE_SUCCESS

#ifdef __WEAPON_MERGE
, pItemElem->GetMergedRandomOptItemId() // 1x %I64d added.
, pItemElem->GetMergedWeaponATK() // 1x %d added.
#endif //__WEAPON_MERGE

#ifdef __PET_GLOW
, pItemElem->m_nPetGlow // 1x %d added.
#endif // __PET_GLOW

#ifdef __CRYSTAL
, pItemElem->GetCrystal() // 1x %d added.
#endif //__CRYSTAL

#ifdef __SWITCH_GLOW_OLDNEW
, pItemElem->m_bGlowOld
#endif // __SWITCH_GLOW_OLDNEW

#ifdef __RUNES_BONUS_FASHION
, pItemElem->m_dwRuneID
#endif
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
May 12, 2022
Messages
85
Reaction score
2
Try this, you are missing a lot of format specifier.
Code:
if( pItemElem->m_dwItemId == II_SYS_SYS_SCR_SEALCHARACTER )
sprintf( pItemStruct->szItem, "%d,%d,%d,%d,,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d/",
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

sprintf( pItemStruct->szItem, "%d,%d,%d,%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d"",%d"",%d"",%d"",%d"",%d"",%d"",%d"",%d"

#ifdef __LOOKCHANGE
",%d"
#endif

#ifdef __WEAPON_RARITY
",%d"
#endif // __WEAPON_RARITY

#ifdef __SYS_LOCK_ITEM
",%d"
#endif //__SYS_LOCK_ITEM





"/",
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 __LOOKCHANGE
, pItemElem->GetLook()
#endif

#ifdef __WEAPON_RARITY
, pItemElem->GetWeaponRarity() // 1x %d added.
#endif // __WEAPON_RARITY

#ifdef __SYS_LOCK_ITEM
, pItemElem->IsItemLocked() // 1x %d added.
#endif //__SYS_LOCK_ITEM

#ifdef __CHIP_PLAYERSHOP
pItemElem->m_nBuyMode, // 1x %d added.
#endif // __CHIP_PLAYERSHOP

#ifdef __UPGRADE_SUCCESS
pItemElem->m_nUpgradeTries // 1x %d added.
#endif //__UPGRADE_SUCCESS

#ifdef __WEAPON_MERGE
, pItemElem->GetMergedRandomOptItemId() // 1x %I64d added.
, pItemElem->GetMergedWeaponATK() // 1x %d added.
#endif //__WEAPON_MERGE

#ifdef __PET_GLOW
, pItemElem->m_nPetGlow // 1x %d added.
#endif // __PET_GLOW

#ifdef __CRYSTAL
, pItemElem->GetCrystal() // 1x %d added.
#endif //__CRYSTAL

#ifdef __SWITCH_GLOW_OLDNEW
, pItemElem->m_bGlowOld
#endif // __SWITCH_GLOW_OLDNEW

#ifdef __RUNES_BONUS_FASHION
, pItemElem->m_dwRuneID
#endif
This is the code in this function, it looks like there is no error, and it is estimated that it is a database problem


if( pItemElem->m_dwItemId == II_SYS_SYS_SCR_SEALCHARACTER )
sprintf( pItemStruct->szItem, "%d,%d,%d,%d,,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d/",
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

sprintf( pItemStruct->szItem, "%d,%d,%d,%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d"

#ifdef __LOOKCHANGE
",%d"
#endif

#ifdef __WEAPON_RARITY
",%d"
#endif // __WEAPON_RARITY

#ifdef __SYS_LOCK_ITEM
",%d"
#endif //__SYS_LOCK_ITEM

#ifdef __CHIP_PLAYERSHOP
",%d"
#endif // __CHIP_PLAYERSHOP

#ifdef __UPGRADE_SUCCESS
",%d"
#endif //__UPGRADE_SUCCESS

#ifdef __WEAPON_MERGE
",%I64d"
",%d"
#endif //__WEAPON_MERGE

#ifdef __PET_GLOW
",%d"
#endif // __PET_GLOW

#ifdef __CRYSTAL
",%d"
#endif //__CRYSTAL

#ifdef __SWITCH_GLOW_OLDNEW
",%d"
#endif // __SWITCH_GLOW_OLDNEW

#ifdef __RUNES_BONUS_FASHION
",%d"
#endif

#ifdef __chongwujinjie
",%d,%d,%d,%I64d,%d"
#endif

#ifdef __WEAPON_LEVELING
",%d,%d"
#endif
#ifdef __linghunsuolian
",%s/",
#else
"/",
#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 __LOOKCHANGE
, pItemElem->GetLook()
#endif

#ifdef __WEAPON_RARITY
, pItemElem->GetWeaponRarity() // 1x %d added.
#endif // __WEAPON_RARITY

#ifdef __SYS_LOCK_ITEM
, pItemElem->IsItemLocked() // 1x %d added.
#endif //__SYS_LOCK_ITEM

#ifdef __CHIP_PLAYERSHOP
pItemElem->m_nBuyMode, // 1x %d added.
#endif // __CHIP_PLAYERSHOP

#ifdef __UPGRADE_SUCCESS
pItemElem->m_nUpgradeTries // 1x %d added.
#endif //__UPGRADE_SUCCESS

#ifdef __WEAPON_MERGE
, pItemElem->GetMergedRandomOptItemId() // 1x %I64d added.
, pItemElem->GetMergedWeaponATK() // 1x %d added.
#endif //__WEAPON_MERGE

#ifdef __PET_GLOW
, pItemElem->m_nPetGlow // 1x %d added.
#endif // __PET_GLOW

#ifdef __CRYSTAL
, pItemElem->GetCrystal() // 1x %d added.
#endif //__CRYSTAL

#ifdef __SWITCH_GLOW_OLDNEW
, pItemElem->m_bGlowOld
#endif // __SWITCH_GLOW_OLDNEW

#ifdef __RUNES_BONUS_FASHION
, pItemElem->m_dwRuneID
#endif

#ifdef __chongwujinjie

, pItemElem->m_dwAbility
, pItemElem->m_Pinji
, pItemElem->m_QianZhi
, pItemElem->m_Exp
, pItemElem->m_PAdjA
#endif

#ifdef __WEAPON_LEVELING
, pItemElem->m_nWeaponLevel
, pItemElem->m_nWeaponExp
#endif

#ifdef __linghunsuolian
, szTmp
#endif //
);

try to debug the database .
Everything that needs to be added to the database has been added, but it just doesn't save it, and I haven't found the problem!
 
Upvote 0
Newbie Spellweaver
Joined
Nov 24, 2023
Messages
17
Reaction score
3
You will never gonna found the problem unless you debug your database .
 
Upvote 0
Back
Top