creedy 0 Posted May 30, 2020 Share Posted May 30, 2020 Regardless of the exp value written in mob_protoI want the expin level that comes to the person who cuts the mob to be not more than 10% of the desired expinexample: exp required for 1 level: 300I want to get an exp 30 to be taken from 1 mob while at most 1 level Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted May 30, 2020 Premium Share Posted May 30, 2020 Math, hands and mysql. Link to comment Share on other sites More sharing options...
creedy 0 Posted May 30, 2020 Author Share Posted May 30, 2020 42 minutes ago, WeedHex said: Math, hands and mysql. what I said has nothing to do with mysql Link to comment Share on other sites More sharing options...
Contributor TMP4 11004 Posted May 30, 2020 Contributor Share Posted May 30, 2020 (edited) char_battle.cpp above this: to->PointChange(POINT_EXP, iExp, true); Paste this: if ((to->GetNextExp() / 10) > iExp) iExp = to->GetNextExp() / 10; Edit: Tested, working. A wild dog gives 30xp when lv2 needs 300. Edited May 30, 2020 by TMP4 Link to comment Share on other sites More sharing options...
creedy 0 Posted May 30, 2020 Author Share Posted May 30, 2020 17 minutes ago, TMP4 said: char_battle.cpp above this: to->PointChange(POINT_EXP, iExp, true); Paste this: if ((to->GetNextExp() / 10) > iExp) iExp = to->GetNextExp() / 10; if ((to->GetNextExp() / 10) > iExp) iExp = to->GetNextExp() / 10; Edit: Tested, working. A wild dog gives 30xp when lv2 needs 300. For example, when the level is 60, If the exp for the level 61 is 500.000 exp from cut mob 10.000 if 10.000/10=1000 isn't he doing it? Link to comment Share on other sites More sharing options...
Contributor TMP4 11004 Posted May 30, 2020 Contributor Share Posted May 30, 2020 (edited) I think you misunderstand it. GetNextExp() does not calculates the needed amount, but it calculates the whole exp from 60 to 61 if the player is level 60. See: DWORD CHARACTER::GetNextExp() const { if (PLAYER_EXP_TABLE_MAX < GetLevel()) return 2500000000; else return exp_table[GetLevel()]; } So if the exp is 500.000 in your exp table for lv61, then a mob can't give you more then 50.000 with my code what is 10 percent as you asked. That's what you want, isn't it? Edited May 30, 2020 by TMP4 Link to comment Share on other sites More sharing options...
creedy 0 Posted May 31, 2020 Author Share Posted May 31, 2020 (edited) 20 hours ago, TMP4 said: I think you misunderstand it. GetNextExp() does not calculates the needed amount, but it calculates the whole exp from 60 to 61 if the player is level 60. See: DWORD CHARACTER::GetNextExp() const { if (PLAYER_EXP_TABLE_MAX < GetLevel()) return 2500000000; else return exp_table[GetLevel()]; } DWORD CHARACTER::GetNextExp() const { if (PLAYER_EXP_TABLE_MAX < GetLevel()) return 2500000000; else return exp_table[GetLevel()]; } So if the exp is 500.000 in your exp table for lv61, then a mob can't give you more then 50.000 with my code what is 10 percent as you asked. That's what you want, isn't it? char_battle.cpp I arranged the way you say. : the problem did not improve : must be : Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Contributor TMP4 11004 Posted May 31, 2020 Contributor Share Posted May 31, 2020 (edited) You did not compiled it or something. It is working, i tested Or maybe you pasted after, and not above what i said. Edited May 31, 2020 by TMP4 Link to comment Share on other sites More sharing options...
creedy 0 Posted May 31, 2020 Author Share Posted May 31, 2020 7 minutes ago, TMP4 said: You did not compiled it or something. It is working, i tested Or maybe you pasted after, and not above what i said. https://paste.tc/ajHhPeQKpk char_battle.cpp full Is the place I added correct? Link to comment Share on other sites More sharing options...
Contributor TMP4 11004 Posted May 31, 2020 Contributor Share Posted May 31, 2020 (edited) EDIT: Found your error, you have this: #define ENABLE_NEWEXP_CALCULATION #ifdef ENABLE_NEWEXP_CALCULATION Please edit this ifdef's code too and it will working. (Line 2634 for you) { to->PointChange(POINT_EXP, iExp, true); from->CreateFly(FLY_EXP, to); } Modify: { if ((to->GetNextExp() / 10) > iExp) iExp = to->GetNextExp() / 10; to->PointChange(POINT_EXP, iExp, true); from->CreateFly(FLY_EXP, to); } @creedy Tag you because idk if you see i edited this. Edited May 31, 2020 by TMP4 Link to comment Share on other sites More sharing options...
creedy 0 Posted May 31, 2020 Author Share Posted May 31, 2020 (edited) 3 hours ago, TMP4 said: EDIT: Found your error, you have this: #define ENABLE_NEWEXP_CALCULATION #ifdef ENABLE_NEWEXP_CALCULATION #define ENABLE_NEWEXP_CALCULATION #ifdef ENABLE_NEWEXP_CALCULATION Please edit this ifdef's code too and it will working. (Line 2634 for you) { to->PointChange(POINT_EXP, iExp, true); from->CreateFly(FLY_EXP, to); } { to->PointChange(POINT_EXP, iExp, true); from->CreateFly(FLY_EXP, to); } Modify: { if ((to->GetNextExp() / 10) > iExp) iExp = to->GetNextExp() / 10; to->PointChange(POINT_EXP, iExp, true); from->CreateFly(FLY_EXP, to); } { if ((to->GetNextExp() / 10) > iExp) iExp = to->GetNextExp() / 10; to->PointChange(POINT_EXP, iExp, true); from->CreateFly(FLY_EXP, to); } @creedy Tag you because idk if you see i edited this. char_battle.cpp : https://paste.tc/Nwo3jSo20O I edited it as you said but it didn't happen again Edited May 31, 2020 by creedy Link to comment Share on other sites More sharing options...
Contributor TMP4 11004 Posted May 31, 2020 Contributor Share Posted May 31, 2020 Okey, since you're not using a default source i can't help more. You have to find where the character get exp in your source and edit there. I'm pass this. Link to comment Share on other sites More sharing options...
creedy 0 Posted May 31, 2020 Author Share Posted May 31, 2020 4 minutes ago, TMP4 said: Okey, since you're not using a default source i can't help more. You have to find where the character get exp in your source and edit there. I'm pass this. martsama source Link to comment Share on other sites More sharing options...
Contributor TMP4 11004 Posted May 31, 2020 Contributor Share Posted May 31, 2020 (edited) Write GetNextExp() and iExp to a chatpacket there and tell me the numbers. Edited May 31, 2020 by TMP4 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now