游戏乐悠悠网游开发网

 找回密码
 立即注册
查看: 1576|回复: 2
打印 上一主题 下一主题

无限转生修复

[复制链接]
  • TA的每日心情
    开心
    2011-11-24 11:37
  • 签到天数: 1 天

    [LV.1]初来乍到

    鲜花(3) 鸡蛋(0)
    跳转到指定楼层
    楼主
    发表于 2015-9-22 09:24:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    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
  • TA的每日心情
    开心
    2011-11-24 11:37
  • 签到天数: 1 天

    [LV.1]初来乍到

    鲜花(3) 鸡蛋(0)
    沙发
     楼主| 发表于 2015-9-22 09:25:06 | 只看该作者
    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;
    }
  • TA的每日心情

    2024-11-5 09:48
  • 签到天数: 253 天

    [LV.8]以坛为家I

    鲜花(0) 鸡蛋(0)
    板凳
    发表于 2018-12-22 23:50:16 | 只看该作者
           
    顶一个,支持
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    小黑屋|手机版|Archiver|Online Game Xingbarking Dev Team  

    GMT+8, 2024-12-22 00:17 , Processed in 0.166648 second(s), 35 queries .

    Powered by Discuz! X3.2 Licensed

    © 2001-2013 Comsenz Inc.

    快速回复 返回顶部 返回列表