Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

BMS Server Files or help in creating the random damage ?

Newbie Spellweaver
Joined
Feb 13, 2012
Messages
11
Reaction score
0
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
 
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
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.
 
Upvote 0
Newbie Spellweaver
Joined
Feb 13, 2012
Messages
11
Reaction score
0
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!
 
Upvote 0
Back
Top