阅读:2031回复:2
【源码编译】无限转生修复
这个转生局限在与设定的是150为顶级的情况下,转生后等级降到121级,而且初始化卷轴对121级以上的无效果。
当然后改源码的人这句话当没说。 |
|
100% |
沙发#
发布于:2014-05-02 07:52
Mover.cpp
int CMover::SetLevel( int nSetLevel ) 函数(自子选择上面或下面) ///////////////////////////////////////////// #ifdef __IFNT_R int CMover::GetGPPoint() { ASSERT( m_nRemainGP >= 0 ); if( Equip()) { ///////////////////转生用此函数 RemoveDebufBuffs(TRUE); int NowGP = GetDex() + GetStr() + GetInt() + GetSta() - 60; m_nRemainGP += NowGP; return m_nRemainGP; } return 0; } int CMover::InitR( LONG sLevel, int AddGP ) { if( GetGPPoint() != 0 ) { // int nJob = GetJob(); //int nGP = GetGPPoint() - 328 ; //SetJobLevel(sLevel,nJob); //AddChangeJob(nJob); if( GetGPPoint() > 6701) { #ifdef __WORLDSERVER #if __VER >= 10 // __LEGEND // 9瞒 傈铰矫胶袍 Neuz, World, Trans m_nRemainGP = 6701 ; ( (CUser*)this )->AddSetGrowthLearningPoint( m_nRemainGP ); // pUser俊霸 GP函悼等巴阑 焊晨. g_dpDBClient.SendLogLevelUp( this, 1 ); // 饭骇诀 肺弊 #endif//__LEGEND // 9瞒 傈铰矫胶袍 Neuz, World, Trans #endif }else if( GetGPPoint() == 6701 ) { return 0; }else { SetLevel( sLevel ); AddGPPoint( AddGP ); } //g_dpDBClient.SendLogLevelUp( this, 10 );//记录下 return 1; } return 0; } #endif //__IFNT_R ////////////////////////////// Mover.h void InitLevel( int nJob, LONG nLevel, BOOL bGamma = TRUE ); /////////////////////////////// #ifdef __IFNT_R BOOL Equip();//检查装备函数 void RemoveDebufBuffs(BOOL SW);//删除所有状态 int GetGPPoint(); int InitR( LONG sLevel, int AddGP ); #endif //__IFNT_R ////////////////////////////////////////// MoverEquip.cpp void CMover::EquipItem( CItemElem *pItemElem, BOOL bEquip, int nPart ) 下面 ///////////////////////// BOOL CMover::Equip()//检查装备 { for( DWORD dwParts = 0; dwParts < MAX_HUMAN_PARTS; dwParts++ ) { ////////////////////////////////////////////////////////////////////////////// /* if( dwParts == PARTS_HEAD || dwParts == PARTS_HAIR || dwParts == PARTS_LWEAPON || dwParts == PARTS_RWEAPON || dwParts == PARTS_SHIELD || dwParts == PARTS_RIDE || ( dwParts >= PARTS_HEAD && dwParts <= PARTS_BULLET ) ) continue;*/ //不会检的装备 /////////////////////////////////////////// CItemElem* pArmor = m_Inventory.GetEquip( dwParts ); if( pArmor ) { // ((CUser*)this)->AddDefinedText( TID_GAME_CHECK_EQUIP, "" ); return FALSE; } } return TRUE; } ///////////////////////////// moverbuff.cpp void CMover::RemoveDebufBuffs() ////////////////////////////////////////////////// void CMover::RemoveDebufBuffs(BOOL SW)/////删除所有状态 { if( SW = TRUE ) { RemoveAllBuff(); } else { m_buffs.RemoveBuffs( RBF_DEBUF ); } } ///////////////////////////////////////////// NpcScriptHelper.cpp void CNpcScript::AddGPPoint( int nAddGPPoint ) ///////////////////////////////////////////// int CNpcScript::InitR( LONG sLevel, int AddGP) { Functions* pTable = m_pInfo->GetFunctions(); return pTable->InitR( m_pInfo , sLevel, AddGP); } ///////////////////////////////////////// 在FunctionsInfo.h中 //这个文件WorldSever中可能也有,如果有的话也要添加 typedef int (WINAPI *PFAddGPPoint)( NPCDIALOG_INFO* pInfo , int nAddGPPoint ); PFAddGPPoint AddGPPoint; //////////////////////// typedef int (WINAPI *PFInitR)( NPCDIALOG_INFO* pInfo ,LONG sLevel, int AddGP); PFInitR InitR; /////////////////////// NpcScript.h void AddGPPoint( int nAddGPPoint ); //////////////////////////////////// int InitR( LONG sLevel, int AddGP ); //////////////////////////////////// NpcScript.cpp void CNpcScript::mafl_juria_2()//这个函数修改为 ////////////////////////// void CNpcScript::mafl_juria_2() { AddKey( 9 ); //AddKey( 37 ); if(GetPlayerLvl() == 150) { //InitR(降至等级,(最高等级 - 降至等级)*每级增加的GP点 - 要增加多少GP点) if(InitR(121,-55) == 0) { Say( 506 ); } } AddKey( 10 ); } ///////////////////////// 查找 void CMover::ReState() void CMover::ReStateOne( int nKind ) void CMover::ReStateOneLow( int nKind ) 覆盖为 #endif //__CLIENT void CMover::ReState() { if( GetLevel() < 121 ) { #ifdef __WORLDSERVER m_nStr = m_nSta = m_nDex = m_nInt = 15; m_nRemainGP = 0; int nLevelFor = m_nLevel; if( m_nLevel < m_nDeathLevel ) nLevelFor = m_nDeathLevel; #if __VER >= 10 // __LEGEND // 9瞒 傈铰矫胶袍 Neuz, World, Trans for( int i = 1 ; i < nLevelFor ; i++ ) { m_nRemainGP += prj.m_aExpCharacter[ i + 1 ].dwLPPoint; if( ( IsMaster() || IsHero() ) && i > 59 ) m_nRemainGP++; if( IsHero() && i == MAX_LEVEL) m_nRemainGP+=12; } #else //__LEGEND // 9瞒 傈铰矫胶袍 Neuz, World, Trans for( int i = 1 ; i < nLevelFor ; i++ ) m_nRemainGP += prj.m_aExpCharacter[ i + 1 ].dwLPPoint; #endif //__LEGEND // 9瞒 傈铰矫胶袍 Neuz, World, Trans 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 } } #ifdef __S_ADD_RESTATE void CMover::ReStateOne( int nKind ) { if( GetLevel() < 121 ) { #ifdef __WORLDSERVER int nAdd = 0; switch( nKind ) { case 0: // Str { nAdd = m_nStr - 15; m_nStr = 15; } break; case 1: // Sta { nAdd = m_nSta - 15; m_nSta = 15; } break; case 2: // Dex { nAdd = m_nDex - 15; m_nDex = 15; } break; case 3: // Int { nAdd = m_nInt - 15; m_nInt = 15; } break; } m_nRemainGP += nAdd; 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 } } #endif // __S_ADD_RESTATE #ifdef __ADD_RESTATE_LOW void CMover::ReStateOneLow( int nKind ) { if( GetLevel() < 121 ) { #ifdef __WORLDSERVER int nAdd = 0; switch( nKind ) { case 0: // Str { if( m_nStr >= RESTATE_LOW + 15 ) { nAdd = RESTATE_LOW; m_nStr -= RESTATE_LOW; } else { nAdd = m_nStr - 15; m_nStr = 15; } } break; case 1: // Sta { if( m_nSta >= RESTATE_LOW + 15 ) { nAdd = RESTATE_LOW; m_nSta -= RESTATE_LOW; } else { nAdd = m_nSta - 15; m_nSta = 15; } } break; case 2: // Dex { if( m_nDex >= RESTATE_LOW + 15 ) { nAdd = RESTATE_LOW; m_nDex -= RESTATE_LOW; } else { nAdd = m_nDex - 15; m_nDex = 15; } } break; case 3: // Int { if( m_nInt >= RESTATE_LOW + 15 ) { nAdd = RESTATE_LOW; m_nInt -= RESTATE_LOW; } else { nAdd = m_nInt - 15; m_nInt = 15; } } break; } m_nRemainGP += nAdd; 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 } } #endif // __ADD_RESTATE_LOW |
|
|
板凳#
发布于:2014-05-02 08:47
2014/5/2
8:50 修复BUG 替换int CMover::InitR( LONG sLevel, int AddGP )这个函数 int CMover::InitR( LONG sLevel, int AddGP ) { if( GetGPPoint() != 0 ) { // int nJob = GetJob(); //int nGP = GetGPPoint() - 328 ; //SetJobLevel(sLevel,nJob); //AddChangeJob(nJob); if( GetGPPoint() > 6701) { #ifdef __WORLDSERVER #if __VER >= 10 // __LEGEND // 9瞒 傈铰矫胶袍 Neuz, World, Trans m_nStr = m_nSta = m_nDex = m_nInt = 15; m_nRemainGP = 6701 ; //( (CUser*)this )->AddSetGrowthLearningPoint( m_nRemainGP ); // pUser俊霸 GP函悼等巴阑 焊晨. g_dpDBClient.SendLogLevelUp( this, 1 ); // 饭骇诀 肺弊 SetHitPoint( GetMaxHitPoint() ); SetManaPoint( GetMaxManaPoint() ); SetFatiguePoint( GetMaxFatiguePoint() ); ((CUser*)this)->AddSetState( m_nStr, m_nSta, m_nDex, m_nInt, m_nRemainGP ); ((CUser*)this)->CheckHonorStat(); ((CUser*)this)->AddHonorListAck(); return 1; #endif//__LEGEND // 9瞒 傈铰矫胶袍 Neuz, World, Trans #endif }else if( GetGPPoint() == 6701 ) { return 0; }else { SetLevel( sLevel ); AddGPPoint( AddGP ); } //g_dpDBClient.SendLogLevelUp( this, 10 );//记录下 return 1; } return 0; } |
|