HP bug in core 2016 files

Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    (293692665344 >> 8) Darn is offline
    MemberRank
    Mar 2009 Join Date
    GermanyLocation
    429Posts

    Re: HP bug in core 2016 files

    [QUOTE = ItsTaP; 8886157]
    guys i don't want the thread to start a war i am just wondering if anyone got a fix for this, nothing more or less.Screenshot by Lightshot
    [/QUOTE]

    seems like incorrect data gets passed to the client.
    following packets need to be changed
    S2C_UPDATEPROPERTY = 69,
    S2C_PROPERTY = 66,
    S2C_CREATEPLAYER = 50,
    The HP value has changed to DWORD from WORD.
    The client expects the HP value to be 4 bytes but the server writes only 2 bytes, the result is a incorrect displayed number.

    // The following is Lua code, so don't try to use it as is inside a dll.
    Spoiler:

    Code:
    function CPlayerFix_StatHP(Owner, Type, PacketFormat, PType, Hth, CurHP, MaxHP, Resist)
     if Owner ~= nil then
      Owner : Write(Type, "bwddw", PType, Hth, CurHP, MaxHP, Resist);
     end
    end
    
    function CPlayerFix_StatCurHP(Owner, Type, PacketFormat, PType, CurHP, MaxHP)
     if Owner ~= nil then
      Owner:Write(Type, "bdd", PType, CurHP, MaxHP);
     end
    end
    
    function CPlayerFix_StatWisdom(Owner, Type, PacketFormat, PType, points, curWisdom, maxWisdom, curse)
     if Owner ~= nil then
      Owner:Write(Type, "bwwwwww", PType, points, curWisdom, maxWisdom, Owner:GetMinMagic(), Owner : GetMaxMagic(), curse);
     end
    end
    
    function CPlayerFix_StatAgility(Owner, Type, PacketFormat, PType, points, otp, evasion, minAttack, maxAttack)
     if Owner ~= nil then
      Owner:Write(Type, "bwwwwww", PType, points, otp, evasion, evasion, minAttack, maxAttack);
     end
    end
    
    Mem = Memory();
    Mem:Set("0x4BAC34", "dbbwIbwwwwwddwwbbddddb", 23);   --CPlayer::SaveAllProperty() packet format
    Mem:Set("0x4babe0", "bsbwwwwwwddwwwwwbIwwwwwwbbbbbd", 31);  --CPlayer::_Create() packet format
    Mem:Set("0x4bac64", "bwwww", 6);       --str packet format
    Mem:Set("0x4bac5c", "bwwwwww", 8);       --Int packet format
    Mem:Set("0x4B92E0", "ddddb", 6);       --S2C_ATTACK packet format
    Mem:RegisterHook("0x458AA7", "CPlayerFix_StatHP");
    Mem:RegisterHook("0x459CA8", "CPlayerFix_StatHP");
    Mem:RegisterHook("0x45B587", "CPlayerFix_StatHP");
    Mem:RegisterHook("0x45903B", "CPlayerFix_StatCurHP");
    Mem:RegisterHook("0x45A61C", "CPlayerFix_StatCurHP");
    Mem:RegisterHook("0x45BF2B", "CPlayerFix_StatCurHP");
    Mem:RegisterHook("0x459556", "CPlayerFix_StatCurHP");
    Mem:RegisterHook("0x458e05", "CPlayerFix_StatWisdom");
    Mem:RegisterHook("0x45a301", "CPlayerFix_StatWisdom");
    Mem:RegisterHook("0x45bbf8", "CPlayerFix_StatWisdom");
    Mem:RegisterHook("0x458f6e", "CPlayerFix_StatAgility");
    Mem:RegisterHook("0x45a56f", "CPlayerFix_StatAgility");
    Mem:RegisterHook("0x45be72", "CPlayerFix_StatAgility");

    if this is not the reason for the incorrect displayed value there might gets something mixed up along the way.
    to which I can't say anything at the moment,
    since I did not write whatever code you use.
    in that case further investigation would be required.

    --update, you might wanna check thease first.
    Code:
    "bdd" Mem:RegisterHook("0x45903B", "CPlayerFix_StatCurHP"); Mem:RegisterHook("0x45A61C", "CPlayerFix_StatCurHP"); Mem:RegisterHook("0x45BF2B", "CPlayerFix_StatCurHP"); Mem:RegisterHook("0x459556", "CPlayerFix_StatCurHP");
    Last edited by Darn; 02-07-18 at 09:33 PM.

  2. #17
    Fusion Kal Reloaded V2 ItsTaP is offline
    MemberRank
    Feb 2013 Join Date
    UkraineLocation
    402Posts

    Re: HP bug in core 2016 files

    Thank you so much Darn <3
    I used Core.dll from R3vo's Web instead the one of TranX and the problem disappeared by itself :D

    Kind Regards,
    ItsTaP



Page 2 of 2 FirstFirst 12

Advertisement