HITRON 692 Posted February 4, 2020 Share Posted February 4, 2020 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) Hey, I had some free time and i make the DS Table more readable i saw a lot of people that can't understand how the table works and i decided to share it. There is much more better ways and one is to rewrite the way that is reading the DS Table. At this one i just improved it to be readable. In the Table bellow is including Wolfman Bonus so if you don't use him remove the additional bonus. The Bonus is like official. If you are using Myth DS Stones you can just add the extra values again and same in the .cpp .h files. The extract for all the DS Stones is 100% you can change it from the (Dragon_Soul_Extract_Tables). I saw some P-Servers that they got issues with DS Stones +5 - +6 got the same Bonus, or the Bonus at +6 is all perfect expect one, in the table bellow all this kind of issues is fixed and tested. Download 18 1 5 5 Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10242 Posted February 4, 2020 Forum Moderator Share Posted February 4, 2020 (edited) 1 hour ago, HITRON said: There is much more better ways and one is to rewrite the way that is reading the DS Table. At this one i just improved it to be readable. Thanks for release, but i don't see what's the scope for change dragon_soul_table.cpp with your file. (if you didn't change anything in the structure why to change it? like: just to put ds_name instead of dragonsoulname to have shorter name?) I mean, all what you did is to remove some brackets, change variable names, declare them in one line, i don't think the term "improved to be readable" is good for 1000 lines in C++ with no documentation. If you want to be readable, you should comment all the functions with what they do and how. Tips for rewrite: //TMapApplyGroup::iterator it TMapApplyGroup::const_iterator it //CGroupTextParseTreeLoader* m_pLoader; //m_pLoader = new CGroupTextParseTreeLoader; //if (m_pLoader) //delete m_pLoader; std::shared_ptr<CGroupTextParseTreeLoader> m_pLoader; m_pLoader = std::make_shared<CGroupTextParseTreeLoader>(); bool DragonSoulTable::CheckWeightTables() { // Group WeightTables Reading. if (!m_pWeightTableNode) { sys_err ("dragon_soul_table.txt need WeightTables."); return false; } for (size_t i = 0; i < m_vecDragonSoulTypes.size(); ++i) { for (uint8_t j = 0; j < DRAGON_SOUL_GRADE_MAX; ++j) { for (uint8_t k = 0; k < DRAGON_SOUL_STEP_MAX; ++k) { for (uint8_t l = 0; l < DRAGON_SOUL_STRENGTH_MAX; ++l) { float fWeight; if (!GetWeight(m_vecDragonSoulTypes[i], j, k, l, fWeight)) { sys_err("In %s group of WeightTables, value(Grade(%s), Step(%s), Strength(%d) is invalid.", m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str(), g_astStepName[k].c_str(), l); return false; } } } } } return true; } Use smart pointers also you can make most of them constants Change the iterator with const_iterator Remove some else conditions with no sense Add return false inside of CheckWeightTables loops if the error has found why i should continue with iteration of 4 for loops and return true all times? ...not so much things left Edited February 5, 2020 by VegaS™ Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Active Member hachiwari 138 Posted February 5, 2020 Active Member Share Posted February 5, 2020 13 minutes ago, VegaS™ said: If you want to be readable, you should comment all the functions with what they do and how. I dont agree with "all the functions". Can you show confirmation of your words? article or sth? Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10242 Posted February 5, 2020 Forum Moderator Share Posted February 5, 2020 (edited) On 2/5/2020 at 2:07 AM, hachiwari said: I dont agree with "all the functions". Can you show confirmation of your words? article or sth? I just talked about the terms "improved it to be readable", in my opinion readable and improved means a lot, not this: This is the hidden content, please Sign In or Sign Up Have no sense to make comments for ymir functions which are over 15 years, i just said about the term itself, don't understand me wrong, let's skip this (maybe my terms are bad). Edited December 3, 2020 by VegaS™ 2 4 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
HITRON 692 Posted February 5, 2020 Author Share Posted February 5, 2020 (edited) @VegaS™ Is not about the C++ part, just wrong flag in the topic, is more about the .txt table to be readable, about the changes in .cpp in different story that i changed it before long time ago i just shared it like that to avoid to do again the .txt with the old names. But now that you mention about the .cpp file improves i could update this too, but doesn't really matter the code is working fine. Edited February 5, 2020 by HITRON Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10242 Posted February 5, 2020 Forum Moderator Share Posted February 5, 2020 (edited) I know it's not about the C++ part in this topic, that's why i said, if you don't change anything in the structure of file there's no reason to do that (just keep the old string names), also this category is for Programming / Scripts, then should be moved to Guides & HowTo (basically i think that's the right category for posting a .txt with clean settings for dragon_soul) About code refactoring, we can do it later, if you've any questions you can send me a PM, i would like to contribute when i've time. Edited February 5, 2020 by VegaS™ 3 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Management AZICKO 7320 Posted November 26, 2020 Management Share Posted November 26, 2020 (edited) Dead Download Link Moved Topic If someone has the archive of this topic, can you send it to us? Thank you! Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal Scamming ? Reselling ? metin2.download | metin2.dev | fr.metin2.dev | metin2dev.org | metin2.top | top-metin2.org Link to comment Share on other sites More sharing options...
Contributor MrQuin 6378 Posted January 31, 2021 Contributor Share Posted January 31, 2021 This is the hidden content, please Sign In or Sign Up @ASIKOO 8 2 1 My only accounts are here and on M2D, Don't trust anyone else from other shitty sites. Link to comment Share on other sites More sharing options...
Recommended Posts