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 Leveling Command

Newbie Spellweaver
Joined
Jul 27, 2018
Messages
72
Reaction score
5
The files im using has a Weapon leveling system, work just fine.
I'm tryin' to add level up command. So i edit the file FuncTextCmd.cpp and re-compile but the command does not work in the game itself.
This is how i set the code:


Code:
#ifdef __WEAPON_LEVELING
ON_TEXTCMDFUNC( TextCmd_SetWeaponLevel,                    "SetWeaponLevel",            "setweaponlevel",    "swl",        "SWL",        TCM_BOTH,    AUTH_ADMINISTRATOR,    ""    )
#endif __WEAPON_LEVELING

What i did wrong?
 
Skilled Illusionist
Joined
May 11, 2011
Messages
316
Reaction score
28
try this:
Code:
#ifdef __WEAPON_LEVELING
BOOL TextCmd_SetWeaponLevel( CScanner& scanner )
{
#ifdef __WORLDSERVER
CUser* pUser = (CUser*)scanner.dwValue;
if( !IsValidObj( pUser ) )
return FALSE;

CItemElem* pItemElem = pUser->m_Inventory.GetAt(0);
if( !pItemElem )
return FALSE;

ItemProp* pProp = pItemElem->GetProp();
if( !pProp )
return FALSE;

int nLevel = scanner.GetNumber();
int nExp = 0;
if( pItemElem )
{
if( pProp->dwItemKind3 == IK3_SWD
|| pProp->dwItemKind3 == IK3_AXE
|| pProp->dwItemKind3 == IK3_KNUCKLEHAMMER
|| pProp->dwItemKind3 == IK3_CHEERSTICK
|| pProp->dwItemKind3 == IK3_WAND
|| pProp->dwItemKind3 == IK3_STAFF
|| pProp->dwItemKind3 == IK3_BOW
|| pProp->dwItemKind3 == IK3_YOYO 
|| pProp->dwItemKind3 == IK3_SHIELD )
{
if( nLevel < 1 )
nLevel = 1;
if( nLevel > 100 )
nLevel = 100;

if( pUser && pUser->IsMode( TRANSPARENT_MODE ) == 0 )
{
g_UserMng.AddCreateSfxObj( pUser, XI_INT_SUCCESS, pUser->GetPos().x, pUser->GetPos().y, pUser->GetPos().z );
pUser->AddPlaySound( SND_INF_UPGRADESUCCESS );
}

pUser->UpdateItem( (BYTE)pItemElem->m_dwObjId, UI_WEAPON_LEVEL, nLevel );
pUser->UpdateItem( (BYTE)pItemElem->m_dwObjId, UI_WEAPON_EXP, nExp );

}
else
pUser->AddDefinedText( TID_REALLY_NIGGA );
}
#endif // __WORLDSERVER
return TRUE;
}
#endif // __WEAPON_LEVELING
 
Newbie Spellweaver
Joined
Jul 27, 2018
Messages
72
Reaction score
5
try this:
Code:
#ifdef __WEAPON_LEVELING
BOOL TextCmd_SetWeaponLevel( CScanner& scanner )
{
#ifdef __WORLDSERVER
CUser* pUser = (CUser*)scanner.dwValue;
if( !IsValidObj( pUser ) )
return FALSE;

CItemElem* pItemElem = pUser->m_Inventory.GetAt(0);
if( !pItemElem )
return FALSE;

ItemProp* pProp = pItemElem->GetProp();
if( !pProp )
return FALSE;

int nLevel = scanner.GetNumber();
int nExp = 0;
if( pItemElem )
{
if( pProp->dwItemKind3 == IK3_SWD
|| pProp->dwItemKind3 == IK3_AXE
|| pProp->dwItemKind3 == IK3_KNUCKLEHAMMER
|| pProp->dwItemKind3 == IK3_CHEERSTICK
|| pProp->dwItemKind3 == IK3_WAND
|| pProp->dwItemKind3 == IK3_STAFF
|| pProp->dwItemKind3 == IK3_BOW
|| pProp->dwItemKind3 == IK3_YOYO 
|| pProp->dwItemKind3 == IK3_SHIELD )
{
if( nLevel < 1 )
nLevel = 1;
if( nLevel > 100 )
nLevel = 100;

if( pUser && pUser->IsMode( TRANSPARENT_MODE ) == 0 )
{
g_UserMng.AddCreateSfxObj( pUser, XI_INT_SUCCESS, pUser->GetPos().x, pUser->GetPos().y, pUser->GetPos().z );
pUser->AddPlaySound( SND_INF_UPGRADESUCCESS );
}

pUser->UpdateItem( (BYTE)pItemElem->m_dwObjId, UI_WEAPON_LEVEL, nLevel );
pUser->UpdateItem( (BYTE)pItemElem->m_dwObjId, UI_WEAPON_EXP, nExp );

}
else
pUser->AddDefinedText( TID_REALLY_NIGGA );
}
#endif // __WORLDSERVER
return TRUE;
}
#endif // __WEAPON_LEVELING
I tried /SetWeaponLevel and /WeaponLevel.
Still doesn't work..
 
Inactive
Joined
Jan 20, 2009
Messages
1,014
Reaction score
1,830
Command works fine, make sure the item is in the first slot of your inventory.
 
Newbie Spellweaver
Joined
Jul 27, 2018
Messages
72
Reaction score
5
Command works fine, make sure the item is in the first slot of your inventory.
I did it, still not work...
Maybe i need to put " " and then the number? (/WeaponLevel "100" ? )
What is the command for this exactly?
 
Inactive
Joined
Jan 20, 2009
Messages
1,014
Reaction score
1,830
Newbie Spellweaver
Joined
Jul 27, 2018
Messages
72
Reaction score
5
Use: http://forum.ragezone.com/f483/weapon-leveling-command-1157265-post8921682/#post8921682

In game move the weapon or armor to the first slot of your inventory.

Then:
Code:
/SetWeaponLevel 50

If it's still not working then your weapon level in your source is messed up.
I re-compile (again) , Apparently I forgot to save the code that ratpack gave me..:/:

When im trying to compile WorldServer:
Source\_Interface\FuncTextCmd.cpp(283): error C2065: 'TID_REALLY_NIGGA' : undeclared identifier
 
Last edited:
Inactive
Joined
Jan 20, 2009
Messages
1,014
Reaction score
1,830
I re-compile (again) , Apparently I forgot to save the code that ratpack gave me..:/:

When im trying to compile WorldServer:

Replace:
Code:
pUser->AddDefinedText( TID_REALLY_NIGGA );

With:
Code:
pUser->AddText("You cannot do that");
 
Newbie Spellweaver
Joined
Jul 27, 2018
Messages
72
Reaction score
5
Replace:
Code:
pUser->AddDefinedText( TID_REALLY_NIGGA );

With:
Code:
pUser->AddText("You cannot do that");
Still not work..:\ as you said , The code is probably messed up.
Thanks for the help, Appreciate that .
 
Back
Top