Uncompleted example of levelup

Results 1 to 2 of 2
  1. #1
    Mako is insane. ThePhailure772 is offline
    MemberRank
    Sep 2007 Join Date
    1,115Posts

    Uncompleted example of levelup

    So, implement this on your own.
    Code:
            static int EXPTable[] =  {
             0,200,1000,2800,6000,11000,18200,28000,40800,57000,77000,101200,130000,
                163800,203000,248000,299200,357000,421800,494000,574000,671020,777500,
                893880,1020600,1158****1306820,1467200,1639680,1824700,2022700,2253340,
                2499****2760460,3037900,3331900,3642940,3971500,4318060,4683****5067****
                5537780,6031700,6549420,7091500,7658500,8335620,9042500,9779780,10548****
                11348****12284460,13257900,14269140,15318900,16407900,17662300,18961900,
                20307500,21699900,23139900,26116700,29191900,3237****35643900,39023900,
                45993500,53175900,60574300,68191900,76031900,88130300,100571900,113361500,
                126503900,140003900,158487****177459900,196928700,216899900,237379900,263623900,
                290519900,318075900,346299900,375199900,410700700,447031900,484203****522223900,
                561103900
            };
    Now, what we want to do is this:
    Code:
    void DoLevel (std::string name, uint32_t levels)
    {
        if (levels < 1)
            return;
    
        uint32_t level = MMatchServer::GetInstance()->GetObjectA (name.c_str())->m_pCharInfo->m_nLevel;
        uint32_t totalExp = (EXPTable[level + levels] << 1) / 100;
        ExecuteQuery ("UPDATE Character SET Level=%i, XP=%i WHERE Name='%s'", level + levels, totalExp, name.c_str());
    }
    kk there.


  2. #2
    Account Upgraded | Title Enabled! Guy is offline
    MemberRank
    Apr 2009 Join Date
    919Posts

    Re: Uncompleted example of levelup

    uint32_t totalExp = (EXPTable[level + levels] << 1) / 100;

    oh lol, you and your silly optimizations



Advertisement