xp is awarded in function
bool CWorldServer::GiveExp( CMonster* thismon, UINT special_lvl, UINT special_exp )You will find this at the top of
WorldProcesses.cppThere are all kinds of different versions of this function out there.
Typically there is a line of code near the top that looks something like this
- unsigned long long exp = (unsigned long long)ceil((double)(thismon->thisnpc->exp * thisplayer->damage) / (thismon->thisnpc->hp*thismon->thisnpc->level)+special_exp);
It is called from
bool CMonster::OnDie( ) in
MonsterEvents.cppPay special attention to that "special_exp" that gets added at the end. I have no idea what that is supposed to do since I don't use this formula in my own server at all
Just after that you will find this line
- exp = exp * (unsigned long long) (Config.EXP_RATE * 6);
Seems like that is what might be introducing your higher rate. It's multiplying the calculated exp by your config rate and then also by 6.
I suspect that if you remove the * 6 completely then you will get close to the 1X rate that you are looking for
in my server i use this much simpler formula
- //assign my own exp for monsters that I personally damaged
- unsigned int exp = (unsigned int)floor(thismon->thisnpc->exp * MyPercent);
- exp = exp * Config.EXP_RATE * map->mapXPRate; //calculate base exp for this client. No medals or stuff accounted for yet
Mypercent is calculated earlier as a value representing how much of the monster's total HP I did in damage. Note this can be > 100% to allow for overkill XP
It would be a little complicated to convert a server to my system since the entire function had to be rewritten.
I also have exp rate multipliers as map variables hence
map->mapXPRate. This can be adjusted via QSD, AIP or by killing/rebirthing the Map Base Crystal
my players also have personal xprate variables which can be affected by items, quests, medals and many others.