[Request] 1.13.4 GetPVPRankProgress() menu

User Tag List

Results 1 to 3 of 3
  1. #1
    flawblure's Avatar Member
    Reputation
    1
    Join Date
    Mar 2017
    Posts
    8
    Thanks G/R
    3/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Request] 1.13.4 GetPVPRankProgress()

    I'm very interested in finding out more about this function and how it gets its values and if I can determine a more accurate rounding error.

    What I believed is that there is a .01% error which ended up as 5 RP, and this could round up to 6, and since you calculate RP gains with two values you could get a maximum error of 12. However occasionally someone gets far less than the expected value. This week someone that was supposed to get 12997 actually got 12956. Even with the maximum error thatd only be 12968 so I'm wondering whats going on here.

    My guess is that since GetPVPRankProgress() returns a value based on the image of your progress % on the character screen there are certain %s that have a higher rounding error than others.

    What I'm most interested in is the code being run by GetPVPRankProgress and just what it's returning so I figured this was the right place. I wish I had more to post about this.

    [Request] 1.13.4 GetPVPRankProgress()
  2. #2
    ejt's Avatar Contributor
    Reputation
    209
    Join Date
    Mar 2008
    Posts
    166
    Thanks G/R
    3/111
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Code:
    signed __int64 __fastcall Script_GetPVPRankProgress(__int64 L)
    {
      __int64 active_player; // rax
    
      sub_170C10(L);
      if ( active_player )
        lua_pushnumber(
          L,
          (float)((float)*(unsigned __int8 *)(*(_QWORD *)(active_player + 0xB190) + 0x3A15i64) * 0.0039215689));
      else
        lua_pushnumber(L, 0.0);
      return 1i64;
    }
    Obviously active_player + 0xB190 is a pointer to the active player's descriptors.

    psudo-code would be something like

    Code:
    int Script_GetPVPRankProgress(lua_State* L)
    {
      CGActivePlayer* player = GetActivePlayer(L);
      if (player)
        lua_pushnumber(L, player->Descriptors.PVPRankProgress * 0.0039215689);
      else
        lua_pushnumber(L, 0.0);
      return 1;
    }

  3. #3
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1511
    Join Date
    May 2008
    Posts
    2,432
    Thanks G/R
    81/333
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Just FYI, 0.0039215689 is the constant value to convert one byte integers (0x00 to 0xFF) to a float (0.0 to 1.0). It's the same as doing X/255.0f (although less accurate...)

Similar Threads

  1. a quick question/request
    By Avianar47 in forum World of Warcraft General
    Replies: 2
    Last Post: 12-27-2006, 03:54 AM
  2. Joana Mancow Leveling Video Request Thread
    By Matt in forum World of Warcraft General
    Replies: 31
    Last Post: 11-19-2006, 02:54 PM
  3. A few requests :)
    By rabownsyou in forum World of Warcraft General
    Replies: 0
    Last Post: 06-16-2006, 11:57 PM
  4. [Request] Fishing Bot Guide
    By Cush in forum World of Warcraft General
    Replies: 7
    Last Post: 06-01-2006, 08:26 AM
  5. [Program Request] 1.9.0 hack
    By lopolop in forum World of Warcraft General
    Replies: 1
    Last Post: 05-17-2006, 09:41 PM
All times are GMT -5. The time now is 12:04 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search