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!

[Source Edit] [Small] [Rebirth system]

Owner
Loyal Member
Joined
May 13, 2011
Messages
1,497
Reaction score
157
Hi Ragezoners.

Well its time for me to release an rebirth system that is non bugged.
This system will also use the m_nCampusPoint field in the database.

This one is an bit different then the most i encountered.
Feel free to leave any comments on it.

@Credits
blessed flyff and akerius

Re-stat Function
me.

Neuz\VersionCommon.h and WorldServer\VersionCommon.h
#define __REBIRTH

_Interface\FuncTextCmd.cpp
Beneath
BOOL TextCmd_ClearPropose( CScanner & s )
{
#ifdef __WORLDSERVER
CUser* pUser = (CUser*)s.dwValue;
g_dpDBClient.SendClearPropose();
#endif // __WORLDSERVER
return TRUE;
}

Add

#ifdef __REBIRTH
BOOL TextCmd_rebirth( CScanner& scanner )
{
#ifdef __WORLDSERVER
CUser *pUser;
pUser = (CUser*)scanner.dwValue;
if(pUser->m_nCampusPoint >= 5)
{
pUser->AddText("You have already max rebirths!");
}
else if(pUser->m_nLevel >= 149 && pUser->IsLegendHero())
{
pUser->InitLevelRebirth( pUser->m_nJob-16,60);
}
else
pUser->AddText("You do not have the right level for a Rebirth!");
#endif
return TRUE;
}
#endif

#ifdef __REBIRTH
ON_TEXTCMDFUNC( TextCmd_rebirth, "rebirth", "rebirth", "ÅÚ·¹Æ÷Æ®", "ÅÚ·¹", TCM_SERVER, AUTH_GENERAL , "ÅÚ·¹Æ÷Æ®" )
#endif

_Interface\WndField.cpp
Under

#ifdef __3RD_LEGEND16
else if(checkhero == LEGEND_CLASS_LEGENDHERO && m_nCampusPoint == 0) //¿µ¿õÀÏ °æ¿ì.
{
if(g_pPlayer->m_nLevel >= 130 && g_pPlayer->m_nLevel < 176 )
strPath = MakePath( DIR_ICON, "Legend_Mark.png");
pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, strPath, 0xfff0000f );
if(pTexture != NULL)
pTexture->Render( p2DRender, point );
}

#endif

Add

int m_nCampusPoint;
#ifdef __REBIRTH
else if(m_nCampusPoint == 1)
{
strPath = MakePath( DIR_ICON, "Rebirth1.png");
pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, strPath, 0xffff00ff );
//pTexture = g_Neuz.m_pHeroIcon;
if(pTexture != NULL)
{
point.y -= pTexture->m_size.cy + 5;
pTexture->Render( &g_Neuz.m_2DRender, point );
}
}
else if(m_nCampusPoint == 2)
{
strPath = MakePath( DIR_ICON, "Rebirth2.png");
pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, strPath, 0xffff00ff );
//pTexture = g_Neuz.m_pHeroIcon;
if(pTexture != NULL)
{
point.y -= pTexture->m_size.cy + 5;
pTexture->Render( &g_Neuz.m_2DRender, point );
}
}
else if(m_nCampusPoint == 3)
{
strPath = MakePath( DIR_ICON, "Rebirth3.png");
pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, strPath, 0xffff00ff );
//pTexture = g_Neuz.m_pHeroIcon;
if(pTexture != NULL)
{
point.y -= pTexture->m_size.cy + 5;
pTexture->Render( &g_Neuz.m_2DRender, point );
}
}
else if(m_nCampusPoint == 4)
{
strPath = MakePath( DIR_ICON, "Rebirth4.png");
pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, strPath, 0xffff00ff );
//pTexture = g_Neuz.m_pHeroIcon;
if(pTexture != NULL)
{
point.y -= pTexture->m_size.cy + 5;
pTexture->Render( &g_Neuz.m_2DRender, point );
}
}
else if(m_nCampusPoint >= 5)
{
strPath = MakePath( DIR_ICON, "Rebirth5.png");
pTexture = CWndBase::m_textureMng.AddTexture( g_Neuz.m_pd3dDevice, strPath, 0xffff00ff );
//pTexture = g_Neuz.m_pHeroIcon;
if(pTexture != NULL)
{
point.y -= pTexture->m_size.cy + 5;
pTexture->Render( &g_Neuz.m_2DRender, point );
}
}
#endif //__REBIRTH

_Common\Mover.cpp
#ifdef __REBIRTH
void CMover::InitLevelRebirth( int nJob, LONG nLevel, BOOL bGamma )
{
#ifdef __WORLDSERVER
// ¿î¿µÀÚ ¸í·ÉÀ¸·Î ·¹º§¾÷ Çϴ°÷ÀÓ
MoverProp* pProp = GetProp();
if( pProp )
{
if( nJob > 0 && nJob < MAX_LEGEND_HERO )
{
AddChangeJob( nJob );
}else{
return;
}
int nPoint = 0;
if( m_nJob == JOB_MERCENARY )
nPoint += 40;
else if( m_nJob == JOB_ACROBAT )
nPoint += 50;
else if( m_nJob == JOB_ASSIST )
nPoint += 60;
else if( m_nJob == JOB_MAGICIAN )
nPoint += 90;
else if( m_nJob == JOB_KNIGHT || m_nJob == JOB_BLADE )
nPoint += 120;
else if( m_nJob == JOB_JESTER || m_nJob == JOB_RANGER )
nPoint += 150;
else if( m_nJob == JOB_RINGMASTER )
nPoint += 160;
else if( m_nJob == JOB_BILLPOSTER || m_nJob == JOB_PSYCHIKEEPER )
nPoint += 180;
else if( m_nJob == JOB_ELEMENTOR )
nPoint += 390;
else if( nJob == JOB_LORDTEMPLER_HERO || nJob == JOB_STORMBLADE_HERO )
nPoint += 120;
else if( nJob == JOB_WINDLURKER_HERO || nJob == JOB_CRACKSHOOTER_HERO )
nPoint += 150;
else if( nJob == JOB_FLORIST_HERO )
nPoint += 160;
else if( nJob == JOB_FORCEMASTER_HERO || nJob == JOB_MENTALIST_HERO )
nPoint += 180;
else if( nJob == JOB_ELEMENTORLORD_HERO )
nPoint += 390;

AddSkillPoint( nPoint );
m_nLevel = nLevel;

SetJobLevel( nLevel, nJob );
m_nDeathLevel = nLevel;
#if __VER >= 10 // __LEGEND // 10Â÷ Àü½Â½Ã½ºÅÛ Neuz, World, Trans
if(IsMaster())
{
int dwTmpSkLevel = 1;//60, 72, 84, 96, 108
if( nLevel > 59 && nLevel < 72 )
dwTmpSkLevel = 1;
else if( nLevel > 71 && nLevel < 84 )
dwTmpSkLevel = 2;
else if( nLevel > 83 && nLevel < 96 )
dwTmpSkLevel = 3;
else if( nLevel > 95 && nLevel < 108 )
dwTmpSkLevel = 4;
else if( nLevel > 107 && nLevel < 120 )
dwTmpSkLevel = 5;
for( int i = 0; i < MAX_SKILL_JOB; i++ )
{
LPSKILL lpSkill = &(m_aJobSkill);
if( lpSkill && lpSkill->dwSkill != NULL_ID )
{
ItemProp* pSkillProp = prj.GetSkillProp( lpSkill->dwSkill );
if( pSkillProp == NULL )
continue;
if( pSkillProp->dwItemKind1 != JTYPE_MASTER)
continue;
lpSkill->dwLevel = dwTmpSkLevel;
}
}
}
else if(IsHero())
{
for( int i = 0; i < MAX_SKILL_JOB; i++ )
{
LPSKILL lpSkill = &(m_aJobSkill);
if( lpSkill && lpSkill->dwSkill != NULL_ID )
{
ItemProp* pSkillProp = prj.GetSkillProp( lpSkill->dwSkill );
if( pSkillProp == NULL )
continue;
if( pSkillProp->dwItemKind1 != JTYPE_MASTER)
continue;
lpSkill->dwLevel = 5;
}
}
}
else if(IsLegendHero())
{
for( int i = 0; i < MAX_SKILL_JOB; i++ )
{
LPSKILL lpSkill = &(m_aJobSkill);
if( lpSkill && lpSkill->dwSkill != NULL_ID )
{
ItemProp* pSkillProp = prj.GetSkillProp( lpSkill->dwSkill );
if( pSkillProp == NULL )
continue;
if( pSkillProp->dwItemKind1 != JTYPE_MASTER)
continue;
lpSkill->dwLevel = 5;
}
}
}
#endif // __LEGEND // 10Â÷ Àü½Â½Ã½ºÅÛ Neuz, World, Trans
if( bGamma )
{
m_nExp1 = 0;
}

( (CUser*)this )->AddSetChangeJob( nJob );
g_UserMng.AddNearSetChangeJob( this, nJob, &((CUser*)this)->m_aJobSkill[MAX_JOB_SKILL] );


#if __VER >= 11 // __SYS_PLAYER_DATA
g_dpDBClient.SendUpdatePlayerData( (CUser*)this );
#else // __SYS_PLAYER_DATA
g_DPCoreClient.SendPartyMemberJob( (CUser*)this );
g_DPCoreClient.SendFriendChangeJob( (CUser*)this );
if( m_idGuild != 0 )
g_DPCoreClient.SendGuildChangeJobLevel( (CUser*)this );
#endif // __SYS_PLAYER_DATA
SetHitPoint( GetMaxHitPoint() );
SetManaPoint( GetMaxManaPoint() );
SetFatiguePoint( GetMaxFatiguePoint() );

m_nCampusPoint = m_nCampusPoint + 1;

if( nJob >= 1 && nJob <= 4 )
{
m_nStr = m_nSta = m_nDex = m_nInt = 15;
m_nRemainGP = 28;
}
if( nJob >= MAX_PROFESSIONAL && nJob < MAX_MASTER )
{
if ( m_nRemainGP >0)
m_nRemainGP = 0;

if (m_nCampusPoint == 1)
{
m_nRemainGP = 60;
goto end;
}
else if (m_nCampusPoint == 2)
{
m_nRemainGP = 100;
goto end;
}
else if (m_nCampusPoint == 3)
{
m_nRemainGP = 200;
goto end;
}
else if (m_nCampusPoint == 4)
{
m_nRemainGP = 300;
goto end;
}
else if (m_nCampusPoint >= 5)
{
m_nRemainGP = 400;
goto end;
}
}
end:;
m_nStr = m_nSta = m_nDex = m_nInt = 50;
g_UserMng.AddSetLevel( this, (WORD)m_nLevel );
( (CUser*)this )->AddSetGrowthLearningPoint( m_nRemainGP );
( (CUser*)this )->AddSetExperience( GetExp1(), (WORD)m_nLevel, m_nSkillPoint, m_nSkillLevel, m_nCampusPoint );
/*( (CUser*)this )->m_playTaskBar.InitTaskBarShorcutKind( SHORTCUT_SKILL );
( (CUser*)this )->AddTaskBar();*/
( (CUser*)this )->AddSetState( m_nStr, m_nSta, m_nDex, m_nInt, m_nRemainGP );
#if __VER >= 13 // __HONORABLE_TITLE // ´ÞÀÎ
((CUser*)this)->CheckHonorStat();
((CUser*)this)->AddHonorListAck();
g_UserMng.AddHonorTitleChange( this, m_nHonor);
#endif // __HONORABLE_TITLE // ´ÞÀÎ
}
#endif // __WORLDSERVER
}

#endif


_Common\Mover.h
#ifdef __REBIRTH
void InitLevelRebirth( int nJob, LONG nLevel, BOOL bGamma = TRUE ) ;
#endif

Well if you now use /rebirth in the chat system you will are back to level 60M and you can level again. As you may noticed is that in Mover.cpp you have the ability to set the Remain stat points.

if (m_nCampusPoint == 1)
{
m_nRemainGP = 60;
goto end;
}
else if (m_nCampusPoint == 2)
{
m_nRemainGP = 100;
goto end;
}
else if (m_nCampusPoint == 3)
{
m_nRemainGP = 200;
goto end;
}
else if (m_nCampusPoint == 4)
{
m_nRemainGP = 300;
goto end;
}
else if (m_nCampusPoint >= 5)
{
m_nRemainGP = 400;
goto end;
}

For example
In my source with level cap 150 i have an max level 388 Stat Points
No with Rebirth 1 you have 388+60 = 448 Stat points and so on.

Now you need this to.

_Common\Mover.cpp
Replace your void CMover::ReState()

with this one
void CMover::ReState()
{
#ifdef __WORLDSERVER

if( ((CUser*)this)->GetLevel() >= 60 && ((CUser*)this)->GetJob() >= 16 )
{
if(m_nCampusPoint == 1)
{
m_nRemainGP = ( ( ( ( ((CUser*)this)->GetLevel() * 3 ) +60 ) -59 ) -3 ); //448 Points an max level
}
else if(m_nCampusPoint == 2)
{
m_nRemainGP = ( ( ( ( ((CUser*)this)->GetLevel() * 3 ) +100 ) -59 ) -3 ); //488 Points an max level
}
else if(m_nCampusPoint == 3)
{
m_nRemainGP = ( ( ( ( ((CUser*)this)->GetLevel() * 3 ) +200 ) -59 ) -3 ); //588 Points an max level
}
else if(m_nCampusPoint == 4)
{
m_nRemainGP = ( ( ( ( ((CUser*)this)->GetLevel() * 3 ) +300 ) -59 ) -3 ); //688 Points an max level
}
else if(m_nCampusPoint == 5)
{
m_nRemainGP = ( ( ( ( ((CUser*)this)->GetLevel() * 3 ) +400 ) -59 ) -3 ); //788 Points an max level
}
else
{
m_nRemainGP = ( ( ( ((CUser*)this)->GetLevel() * 3 ) - 59 ) - 3 );
}
}
else
{
m_nRemainGP = ( ( ((CUser*)this)->GetLevel() * 2) - 2 );
}

m_nStr = 15;
m_nSta = 15;
m_nDex = 15;
m_nInt = 15;

SetHitPoint( GetMaxHitPoint() );
SetManaPoint( GetMaxManaPoint() );
SetFatiguePoint( GetMaxFatiguePoint() );
((CUser*)this)->AddSetState( m_nStr, m_nSta, m_nDex, m_nInt, m_nRemainGP );
#if __VER >= 13 // __HONORABLE_TITLE // ´ÞÀÎ
((CUser*)this)->CheckHonorStat();
((CUser*)this)->AddHonorListAck();
g_UserMng.AddHonorTitleChange( this, m_nHonor);

#endif // __HONORABLE_TITLE // ´ÞÀÎ
#endif // __WORLDSERVER
}

This function will allow to save the stat points. Other wise when restatting you will be losing the extra stat points you where gaining when using the rebirth.

So if you want to have higher stats just change the values in Mover.cpp at m_nRemainGP.

Have fun with it.
With kind regards.
 
Last edited:
i <3 C++
Joined
Jun 4, 2005
Messages
383
Reaction score
100
credits goes to blessed flyff? or akerius?
 
Owner
Loyal Member
Joined
May 13, 2011
Messages
1,497
Reaction score
157
Sorry Both of them Only the Re-stat is part my own edit.
 
Newbie Spellweaver
Joined
Jun 27, 2011
Messages
70
Reaction score
9
This have a special icon for rebirthed players?
 
Last edited:
Owner
Loyal Member
Joined
May 13, 2011
Messages
1,497
Reaction score
157
@Kyota
You can make your own icons for it. Size would be 16x16px.

@Jayje14
There is only 1 mover.cpp in the _Common folder.
There you need to put the code in.
 
Newbie Spellweaver
Joined
Apr 28, 2011
Messages
38
Reaction score
8
I have some errors :c
\Flyff Dream\Archivos\Source\Virtuos_v17\Build\Program\_Interface\FuncTextCmd.cpp(2410) : error C2501: 'TextCmd_rebirth' : missing storage-class or type specifiers
\Flyff Dream\Archivos\Source\Virtuos_v17\Build\Program\_Interface\FuncTextCmd.cpp(2410) : error C2365: 'TextCmd_rebirth' : redefinition; previous definition was a 'function'
\Flyff Dream\Archivos\Source\Virtuos_v17\Build\Program\_Interface\FuncTextCmd.cpp(2389) : see declaration of 'TextCmd_rebirth'
\Flyff Dream\Archivos\Source\Virtuos_v17\Build\Program\_Interface\FuncTextCmd.cpp(2410) : error C2059: syntax error : 'string'
Screenshot_1 - [Source Edit] [Small] [Rebirth system] - RaGEZONE Forums

\Flyff Dream\Archivos\Source\Virtuos_v17\Build\Program\_Interface\FuncTextCmd.cpp(2436) : error C2143: syntax error : missing ';' before '{'
\Flyff Dream\Archivos\Source\Virtuos_v17\Build\Program\_Interface\FuncTextCmd.cpp(2436) : error C2447: '{' : missing function header (old-style formal list?)
Screenshot_2 - [Source Edit] [Small] [Rebirth system] - RaGEZONE Forums

\Flyff Dream\Archivos\Source\Virtuos_v17\Build\Program\_Interface\FuncTextCmd.cpp(5260) : error C2065: 'TextCmd_Teleport' : undeclared identifier
Screenshot_3 - [Source Edit] [Small] [Rebirth system] - RaGEZONE Forums

:c xd
 

Attachments

You must be registered for see attachments list
Owner
Loyal Member
Joined
May 13, 2011
Messages
1,497
Reaction score
157
Cant you reed what it says.
You did not proper add it all.
Check every file.

And why you have an screen of the Bool TextCmd_Teleport?

This is how it ments to be
#ifdef __REBIRTH
BOOL TextCmd_rebirth( CScanner& scanner )
{
#ifdef __WORLDSERVER
CUser *pUser;
pUser = (CUser*)scanner.dwValue;
if(pUser->m_nCampusPoint >= 5)
{
pUser->AddText("You have already max rebirths!");
}
else if(pUser->m_nLevel >= 149 && pUser->IsLegendHero())
{
pUser->InitLevelRebirth( pUser->m_nJob-16,60);
}
else
pUser->AddText("You do not have the right level for a Rebirth!");
#endif
return TRUE;
}
#endif

Common even Copie paste and you still get it wrong.
 
Junior Spellweaver
Joined
Dec 14, 2011
Messages
148
Reaction score
10
This is complete.
Show me the error.

wdfield.cpp
else if(m_nCampusPoint == 1)

else if(m_nCampusPoint == 2)

else if(m_nCampusPoint == 3)

else if(m_nCampusPoint == 4)

else if(m_nCampusPoint >= 5)

In that line

undeclared -> m_nCampusPoint

so how to fix ?
 
Skilled Illusionist
Joined
Nov 21, 2012
Messages
390
Reaction score
213
on which line should i added that?

It's a forward declaration, make sure it comes before the actual class.. for example:
Code:
int add;

int add(int x, int y)
{
    return x * y;
}

Just make sure the forward declaration is declared before the class it's used in, therefore it can be called throughout the other classes.

Not a bad release, but again; there's no documentation. I think these little releases should be thoroughly explained in order to be used properly by newer developers..
 
Owner
Loyal Member
Joined
May 13, 2011
Messages
1,497
Reaction score
157
Thank you for the feedback.

Maybe i can make an tutorial about it. i will see what i can do with it.
 
Owner
Loyal Member
Joined
May 13, 2011
Messages
1,497
Reaction score
157
Put the warning in here.

Cause i dont have any warnings.
 
Junior Spellweaver
Joined
Dec 14, 2011
Messages
148
Reaction score
10
C:\Sourcev15\Program\_Interface\FuncTextCmd.cpp(2411): error C2248: 'CMover::m_nCampusPoint' : cannot access private member declared in class 'CMover'
 
Owner
Loyal Member
Joined
May 13, 2011
Messages
1,497
Reaction score
157
You need to declare it as an Public one. Not an Private one.

Show me the entire Part of the CMover::m_nCampusPoint.

Cause if you have done it like above you still havn't done it right.
 
Back
Top