BMS Server Files or help in creating the random damage ?

Results 1 to 5 of 5
  1. #1
    Registered xlapeiro is offline
    MemberRank
    Feb 2012 Join Date
    9Posts

    BMS Server Files or help in creating the random damage ?


    RaGEZONE Recommends

    RaGEZONE Recommends

    Where can i look for to see how to implement the damage calculated in c++ for v83? I was looking for a reference, so i knew where to look for and know how to implement it


  2. #2
    Moderator Eric is online now
    ModeratorRank
    Jan 2010 Join Date
    DEV CityLocation
    2,958Posts

    Re: BMS Server Files or help in creating the random damage ?

    CalcDamage::PDamage, CalcDamage::MDamage. Both client-end and server-end.

  3. #3
    Registered xlapeiro is offline
    MemberRank
    Feb 2012 Join Date
    9Posts

    Re: BMS Server Files or help in creating the random damage ?

    Quote Originally Posted by Eric View Post
    CalcDamage::PDamage, CalcDamage::MDamage. Both client-end and server-end.
    but idk how to look for them in the v83 idb, or at least i cant find them :(

  4. #4
    Moderator Eric is online now
    ModeratorRank
    Jan 2010 Join Date
    DEV CityLocation
    2,958Posts

    Re: BMS Server Files or help in creating the random damage ?

    Quote Originally Posted by xlapeiro View Post
    but idk how to look for them in the v83 idb, or at least i cant find them :(
    I wouldn't suggest trying to base it off your v83 IDB because you probably wouldn't really understand it. For starters, you'd have to find and name all of CalcDamage::PDamage yourself (which, isn't even the hard part). Then, you'll need to know everything the pseudocode is doing, but without any references to valid structures. An IDB contains no local type debug info and v95's PDB introduced Stat Rates not in v83, making the structs have two different offsets (not to mention different calculations for post-bb).

    Instead, you should reference BMS as much as you can; v83's damage calculations will be nearly identical, except for a few things. The major difference will be more with CalcDamage::MDamage because Evan's are in the v83 client, and that means that Magic Attacks now include Critical Attack formulas. As for Critical Attack and RNG sync, they both use the old get_rand formula used in BMS (not the one introduced in v92+ clients).

    If you're still interested in finding the two functions in IDA however, CalcDamage::MDamage (00791617) can be found by XREFing CUserLocal::TryDoingMagicAttack. As for CalcDamage::PDamage (0078DF87), it can be found by XREFing CUserLocal::TryDoingMeleeAttack, CUserLocal::TryDoingShootAttack, CUserLocal::TryDoingBodyAttack, or CUserLocal::DoActiveSkill_MesoExplosion. As for finding the CUserLocal::TryDoingXXXAttack functions, you can use an AoB to find them. The easiest AoB would be for the PUSH XXXX instruction, where XXXX is the StringPool ID of "The skill cannot be used with the equipped item." string that you'd see in-game. Nonetheless, I've included both the addresses for you if you're interested in looking into the client's CalcDamage functions. One other thing: in the beginning of both of the CalcDamage's, you'll see a do-while loop that repeats 7 times and calls a function, that is CRand32::Random. Feel free to name that as well if you don't have it named already.

    One last thing: Good luck. These are very lengthy functions that have to be nothing short of 100% correct in all aspects. If a single byte or value is wrong somewhere, it makes the server-end damage mismatch the client-end.

  5. #5
    Registered xlapeiro is offline
    MemberRank
    Feb 2012 Join Date
    9Posts

    Re: BMS Server Files or help in creating the random damage ?

    Quote Originally Posted by Eric View Post
    I wouldn't suggest trying to base it off your v83 IDB because you probably wouldn't really understand it. For starters, you'd have to find and name all of CalcDamage::PDamage yourself (which, isn't even the hard part). Then, you'll need to know everything the pseudocode is doing, but without any references to valid structures. An IDB contains no local type debug info and v95's PDB introduced Stat Rates not in v83, making the structs have two different offsets (not to mention different calculations for post-bb).

    Instead, you should reference BMS as much as you can; v83's damage calculations will be nearly identical, except for a few things. The major difference will be more with CalcDamage::MDamage because Evan's are in the v83 client, and that means that Magic Attacks now include Critical Attack formulas. As for Critical Attack and RNG sync, they both use the old get_rand formula used in BMS (not the one introduced in v92+ clients).

    If you're still interested in finding the two functions in IDA however, CalcDamage::MDamage (00791617) can be found by XREFing CUserLocal::TryDoingMagicAttack. As for CalcDamage::PDamage (0078DF87), it can be found by XREFing CUserLocal::TryDoingMeleeAttack, CUserLocal::TryDoingShootAttack, CUserLocal::TryDoingBodyAttack, or CUserLocal::DoActiveSkill_MesoExplosion. As for finding the CUserLocal::TryDoingXXXAttack functions, you can use an AoB to find them. The easiest AoB would be for the PUSH XXXX instruction, where XXXX is the StringPool ID of "The skill cannot be used with the equipped item." string that you'd see in-game. Nonetheless, I've included both the addresses for you if you're interested in looking into the client's CalcDamage functions. One other thing: in the beginning of both of the CalcDamage's, you'll see a do-while loop that repeats 7 times and calls a function, that is CRand32::Random. Feel free to name that as well if you don't have it named already.

    One last thing: Good luck. These are very lengthy functions that have to be nothing short of 100% correct in all aspects. If a single byte or value is wrong somewhere, it makes the server-end damage mismatch the client-end.
    yeah i've tried looking for the BMS leak so i could compare and see where i needed to go, thanks for all the insight!




Advertisement