User Tag List

Results 1 to 3 of 3

Thread: Player Base mana and base HP value incorrect.

  1. #1
    Moderator <span style='color: #FF1493'><span class='glow_000000'>Vitrex</span></span>'s Avatar

    Join Date
    Sep 2013
    Location
    Vilnius , Lithuania
    Posts
    1,049
    XP
    1,000,667
    Level
    174
    Thanks
    283
    Thanked 137 Times in 97 Posts

    Player Base mana and base HP value incorrect.

    Hello, today i met a problem, i wan't to make player base mana and base hp for level 80+ starting from 100.000 but that doesn't seems to work.
    i did the following changes :

    Changed type of columns basehp & basemana in player_classlevelstats to INT and added values i wanna have.

    Code:
    INSERT INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES (1, 110, 921680, 0);
    INSERT INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES (2, 110, 880180, 1795000);
    INSERT INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES (3, 110, 929620, 2065300);
    INSERT INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES (4, 110, 965880, 0);
    INSERT INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES (5, 110, 833060, 1562000);
    INSERT INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES (6, 110, 833060, 0);
    INSERT INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES (7, 110, 823380, 1795400);
    INSERT INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES (8, 110, 883860, 1309700);
    INSERT INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES (9, 110, 873680, 1560600);
    INSERT INTO `player_classlevelstats` (`class`, `level`, `basehp`, `basemana`) VALUES (11, 110, 942120, 1418500);
    Next i changed in objectmngr.cpp following lines :

    Code:
      // Loading levels data (class only dependent)
        TC_LOG_INFO("server.loading", "Loading Player Create Level HP/Mana Data...");
        {
            uint32 oldMSTime = getMSTime();
    
    
            //                                                0      1      2       3
            QueryResult result  = WorldDatabase.Query("SELECT class, level, basehp, basemana FROM player_classlevelstats");
    
    
            if (!result)
            {
                TC_LOG_ERROR("server.loading", ">> Loaded 0 level health/mana definitions. DB table `player_classlevelstats` is empty.");
                exit(1);
            }
    
    
            uint32 count = 0;
    
    
            do
            {
                Field* fields = result->Fetch();
    
    
                uint32 current_class = fields[0].GetUInt8();
                if (current_class >= MAX_CLASSES)
                {
                    TC_LOG_ERROR("sql.sql", "Wrong class %u in `player_classlevelstats` table, ignoring.", current_class);
                    continue;
                }
    
    
                uint8 current_level = fields[1].GetUInt8();      // Can't be > than STRONG_MAX_LEVEL (hardcoded level maximum) due to var type
                if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
                {
                    TC_LOG_INFO("misc", "Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.", current_level);
                    ++count;                                    // make result loading percent "expected" correct in case disabled detail mode for example.
                    continue;
                }
    
    
                PlayerClassInfo* info = _playerClassInfo[current_class];
                if (!info)
                {
                    info = new PlayerClassInfo();
                    info->levelInfo = new PlayerClassLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)];
                    _playerClassInfo[current_class] = info;
                }
    
    
                PlayerClassLevelInfo& levelInfo = info->levelInfo[current_level-1];
    
    
                levelInfo.basehealth = fields[2].GetUInt32();
                levelInfo.basemana   = fields[3].GetUInt32();
    
    
                ++count;
            }
    from GetUInt8

    but still my values in game displays and works only up to 100.000. is there anything else i have to edit? or i did something wrong?
    When i hit level where i should have more than 100k of the hp or mana value goes incorrect in game.
    Last edited by Vitrex; 07-12-2016 at 11:11 PM.
    Achievements:
    Shopper Got a Sticky! 1 year registered Member Level XL Level C Referrer
    Awards:
    Raffle Winner Donator Member of Staff Pot Head
    I won't create anything for you, i can only guide you to right direction.
    Don't forget to read rules before posting.
    Forum Rules
    Need and assistance with your issue? use this section to ask for assistance !
    -----
    My Portfolio
    Wanna learn PHP ? check out my One-Page project


  2. #2
    Moderator / Eluna Dev <span style='color: #FF0000'><span class='glow_8B0000'>Rochet2</span></span>'s Avatar
    Join Date
    Apr 2013
    Location
    Finland
    Posts
    1,859
    XP
    13,487
    Level
    35
    Thanks
    95
    Thanked 591 Times in 418 Posts
    you should check if levelinfo.basemana and the health are uint32. if they are not you should change them.
    Also you should look around the core for where they are used and fix the code if they are used for example like
    uint8 a = levelinfo.basemana
    Awards:
    Support LOL Scripter Facepalm! Raffle Winner
    rochet2.github.io - Home of great codes

  3. #3
    Original Poster
    Moderator <span style='color: #FF1493'><span class='glow_000000'>Vitrex</span></span>'s Avatar

    Join Date
    Sep 2013
    Location
    Vilnius , Lithuania
    Posts
    1,049
    XP
    1,000,667
    Level
    174
    Thanks
    283
    Thanked 137 Times in 97 Posts
    maybe you have an idea where else it can be? i checked player.cpp, statsystem.cpp couldn't find anything.

    I found in player.h

    Code:
    struct PlayerClassLevelInfo
    {
        PlayerClassLevelInfo() : basehealth(0), basemana(0) { }
        uint16 basehealth;
        uint16 basemana;
    };
    unfortunately that not the problem solve, still same result.

    EDIT 2

    solved, seems like last piece of code i found was the problem solver, just had to recompile whole core, not only "Game" :)
    Last edited by Vitrex; 07-13-2016 at 11:43 AM.
    Achievements:
    Shopper Got a Sticky! 1 year registered Member Level XL Level C Referrer
    Awards:
    Raffle Winner Donator Member of Staff Pot Head
    I won't create anything for you, i can only guide you to right direction.
    Don't forget to read rules before posting.
    Forum Rules
    Need and assistance with your issue? use this section to ask for assistance !
    -----
    My Portfolio
    Wanna learn PHP ? check out my One-Page project


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •