- int CObjUSER::GetCur_MaxHP ()
- {
- return this->m_Battle.m_nMaxHP + m_EndurancePack.GetStateValue( ING_INC_MAX_HP ) + m_AruaAddHp;
- };
Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators
PurpleYouko wrote:damage is calculated in battle.cpp
stats are calculated in PlayerStats.cpp
You can do what you like with damage calculations since they are handled 100% in the server
Most Stats, however, are not! We have to figure out how to make them match the values that the client calculates for itself.
Mismatches between server and client are one of the main causes for annoying bugs
PurpleYouko wrote:Only way to do that is to make a huge list of effects that changing stuff has on your client.
In short though, don't bother unless you find differences between client and server values.
It has been done already. People spent huge amounts of time making sure the values were the same on both sides. Since we don't have access to the calculations in the client, we had to get the nearest fit that we could find by tweaking the formulae in the server.
I personally spent almost a full week making graphs of pretty much everything then applied the correct formulae to my KTRose source.
If you are concerned then use the stats window in the client to get client values then compare them to server values using the /mystat command
/mystat mspd = movespeed and so on. there are dozens of variations that I added and also a /mystat2 command (which I don't see the point of at all when /mystat is already infinitely expandable). no idea who added that one or why.
PurpleYouko wrote:the only way to figure it out is to watch the values in the client stats window then figure out a formula that reproduces those same results.
As i said, that has already been done for most stuff. Some aren't perfect though.
We can't change the client so we have to do our best to emulate it in the server.
PurpleYouko wrote:OK first of all that is not irose source. It's actually evo source.
You are right that it could help to understand the correct formula to use in the server though
- int CObjUSER::GetCur_MaxHP ()
- {
- return this->m_Battle.m_nMaxHP + m_EndurancePack.GetStateValue( ING_INC_MAX_HP ) + m_AruaAddHp;
- };
That particular function returns a player's maximum HP.
this refers to the current player who has been cast as class CObjUSER
m_Battle.nMaxHP is (I assume) the base value for maximum HP for that player. The actual calculations are somewhere else. You are going to have to search for where this is initially calculated
m_EndurancPack.GetStateValue(ING_INC_MAX_HP) appears to be a function that returns a modifier based on your current endurance buff state. ING_INC_MAX_HP is a constant that is defined somewhere else. Again you are going to need to find out what the constant is and what the function call actually does.
m_AruaAddHp would seem to be a variable that is defined elsewhere. It is probably a class variable. Go find where it is defined.
It's not the easiest thing in the world to figure out what is going on in that code base. Each function seems to call a bunch of other functions in massive nests. You have to go down each of those branches to find the root values before you can work out what each function will return.
It's doable but it will be very convoluted.
Return to Support - OsRose Emulator
Users browsing this forum: Majestic-12 [Bot] and 1 guest