Jump to content

Amun

Contributor
  • Posts

    199
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    100%

Everything posted by Amun

  1. The images aren't working. If you want some help, explain the problem properly, don't just say "I have a problem". Is it showing the wrong stones? Is the text fucked up? Is it not showing items? Is it showing extra items? Like, what's the problem? What I understood from your first message is that it shows a casting speed stone which shouldn't be there. Correct me if I'm wrong. Anyhow, if you want to get rid of the stones drop, just remove them from constants, like TMP said.
  2. I really can not say anything for sure. My advice is to add logs in both the quest and the client. It won't solve anything, but at least it would give you an idea about why it's crashing. What about the client? Do you get any errors in there?
  3. Does this only happen when you are a GM or for all players? You said you'll add images, I don't see any of them. That syserr is coming from questmanager void CQuestManager::Input(unsigned int pc, const char* msg) and it means that the quest isn't running(for that player, from what I see). Maybe something's cleaning it up?
  4. Hello, good people! I was writing something to validate the server data(like blend.txt, cube, etc) and stumbled upon this lovely comment: So then I asked myself "Why not?" Anyhow, here's the code(everything is in blend_item.cpp): // after the last #include, add #include <random> // Optional: You can add this after the last import if you want. // I've replaced the "Token" thing because Visual Studio was playing tricks with the tabs and it was too annoying. #define str_match(s1,s2) _stricmp(s1,s2)==0 // or, if you want, you can just completely replace the Token stuff, like I did. Up to you, it's just optional stuff.. // Anyhow, now edit this struct: struct BLEND_ITEM_INFO { DWORD item_vnum; int apply_type; int apply_value[MAX_BLEND_ITEM_VALUE]; int apply_duration[MAX_BLEND_ITEM_VALUE]; // add these int apply_prob[MAX_BLEND_ITEM_VALUE]; int duration_prob[MAX_BLEND_ITEM_VALUE]; int apply_prob_sum;// we'll just do the sum straight away int duration_prob_sum;// since we have to check if it has probability or not }; // search for static int FN_random_index() // add these before(or after.. whatever) // You don't really have to add this, you can just use number(min, max) if you want to int Randomi(int minx, int maxx) { std::random_device rd; // obtain a random number from hardware std::mt19937 gen(rd()); // seed the generator std::uniform_int_distribution<> distr(minx, maxx); // define the range return distr(gen); } int RandomFromProbs(int probs[], int probsSum) { int rand = Randomi(1, probsSum); int accumulated = 0; for (int i = 0; i < MAX_BLEND_ITEM_VALUE; i++) { // this is just a fallback in case someone puts 0 for all of them // or maybe we should call FN_random_index from here instead? // up to you.. if (i == MAX_BLEND_ITEM_VALUE - 1) return i; // if the probability is 0, then it's disabled, skip it if (!probs[i]) continue; accumulated += probs[i]; if (rand <= accumulated) return i; } } // search for else Token("end") // Add this before // if you didn't add that define, change these to Token // here: else Token("apply_prob") // and the second one: else Token("duration_prob") else if (0 == strcmp(key, "apply_prob")) { for (int i = 0; i < MAX_BLEND_ITEM_VALUE; ++i) { v = strtok(NULL, delim); if (!v) { fclose(fp); return false; } blend_item_info->apply_prob_sum += std::stoi(v); str_to_number(blend_item_info->apply_prob[i], v); } } else if (0 == strcmp(key, "duration_prob")) { for (int i = 0; i < MAX_BLEND_ITEM_VALUE; ++i) { v = strtok(NULL, delim); if (!v) { fclose(fp); return false; } blend_item_info->duration_prob_sum += std::stoi(v); str_to_number(blend_item_info->duration_prob[i], v); } } // Search for bool Blend_Item_set_value(LPITEM item) // Inside look for: if (item->GetVnum() == 51002) // energy crystal { apply_type = blend_info->apply_type; apply_value = blend_info->apply_value[FN_ECS_random_index()]; apply_duration = blend_info->apply_duration[FN_ECS_random_index()]; } else { apply_type = blend_info->apply_type; apply_value = blend_info->apply_value[FN_random_index()]; apply_duration = blend_info->apply_duration[FN_random_index()]; } // Comment them or just replace them with this: apply_type = blend_info->apply_type; if (blend_info->apply_prob_sum) { apply_value = blend_info->apply_value[RandomFromProbs(blend_info->apply_prob, blend_info->apply_prob_sum)]; } else { if (item->GetVnum() == 51002) // energy crystal apply_value = blend_info->apply_value[FN_ECS_random_index()]; else apply_value = blend_info->apply_value[FN_random_index()]; } if (blend_info->duration_prob_sum) { apply_duration = blend_info->apply_value[RandomFromProbs(blend_info->duration_prob, blend_info->duration_prob_sum)]; } else { if (item->GetVnum() == 51002) // energy crystal apply_duration = blend_info->apply_duration[FN_ECS_random_index()]; else apply_duration = blend_info->apply_duration[FN_random_index()]; } That's it, you're good to go. I should mention that I didn't try it on the live server, just in the validation app, but everything should work just fine. Example usage: # this is just to prove that you don't have to add the probability stuff in all of them # you can just add where you want to #Blue Dew section item_vnum 50825 apply_type ATT_BONUS apply_value 30 50 70 90 120 apply_duration 60 120 180 300 600 end #white dew section item_vnum 50826 apply_type DEF_BONUS apply_value 40 70 100 150 200 # you can also add values like 0 1000 20 500 0 # it will just ignore the 0 and do the math for the other ones apply_prob 0 1000 200 150 90 # if you have something like this it will ignore the 0 # and just give the one with a "valid" probability(the fifth, in this case - apply_value 200) # apply_prob 0 0 0 0 1 apply_duration 60 120 180 300 600 duration_prob 1 2 3 4 5 end #energy crystal section item_vnum 51002 apply_type ENERGY apply_value 1 3 5 7 10 apply_duration 7200 7200 7200 7200 7200 # and you don't have to add both probabilities(for duration and apply), you can just use one.. or none! apply_prob 10 50 10 20 10 end Have fun and let me know if you have any problems with it! Cheers!
  5. Download Metin2 Download First of all, sorry if it's the wrong section, but I didn't know where else to write this. Right. For whoever's looking for a copy-paste tutorial, keep looking, because this isn't the one. Also, if you're not sure if you should update it or not, you probably shouldn't. What's up with the files? They contain the data from the latest proto posted by P3ng3r(V22.0.8) + some of my thoughts from when I updated my own protos. I've also thrown in some last minute stuff(like the tables), just to make your life a little easier. What do you have to do? Server: Update ProtoReader.cpp/ProtoReader.h(if you add the masks) Create/Update the tables in tables.h Create/Update the enums from item_length.h and length.h Update ClientManagerBoot if your client is either using or mirroring the text files to MySQL Again, if you're reading the proto from MySQL, you'll have to update item_proto and mob_proto tables Client: Update the enums from ItemData.h(+ItemData.cpp if you'll create functions for the masks) If you know you're going to use the new types and applys in the client, update PythonItemModule.cpp as well DumpProto: Update dump_proto.cpp, ItemCSVReader.cpp/h with the new values If you're going to use all the apply values, change BYTE to WORD in SItemApply and update all the functions/packets connected to it accordingly, otherwise it'll overflow and fuck up your whole server. Is this everything you need? I would say yes. Do I give a shit if you fuck up? No. Links: Mob Data: [Hidden Content] Proto Data: [Hidden Content] Virus Total: Proto Data [Hidden Content] Mob Data: [Hidden Content] I'd like to thank @ xP3NG3Rx for all the work he puts into unpacking and reversing functions from the official servers. We wouldn't be here without you, mate. Thank You! Good luck! Edit 15.09.2022: Sorry to bump this, but someone asked about it in Q&A, so here's the source for dump_proto with the data already updated. VS 2022, I have not tried with other versions. I should've clean it up, but whatever.. who tf has time for that.. [Hidden Content] Have a great day, - Amun
  6. What he means by 2022 is that the client's source can be compiled with Visual Studio 2022. The Client is from 2013/2014. Updating the client to the latest official files require changing the proto structures as well, for both item and mob_proto, since they're not compatible. You'll have to add the new types, subtypes, applys, maskType, maskSubtype, as well as the columns for 67Material and elemental shit.
  7. If you've created a new folder, don't forget to also add it in `Index`. In regards to unpack/repack, yes, but only the first time. If you already have the folder unpacked, there's no point to unpack it again, just add your files, repack it and move them to `pack`. One workaround to avoid waiting half an hour when working in big directories is to just add them straight to the root folder. What do I mean by this? Let's say, for example, that you want to add some new stuff in the `PC` archive. Instead of unpacking the entire folder(which is huge) and repacking it again, just create a `ymir work` folder in root and add your files. After you've tested and everything works properly, you can move them to the proper directory(PC). I don't mind helping people(I quite enjoy it, actually), but I get fucking pissed when I want to read something about some files(like, for example, if any new bugs came out) and have to go through 1000 messages of people having off topic discussions. We have a `Questions & Answers` section for a reason. I hope you understand what I mean.
  8. MySQL credentials aren't good, chief. If you know them, just update your core/db configs. If you don't know them, then reset your db's user and password.
  9. That sub is used in the mouseModule and it is NOT missing so Filachilla was probably right, you fucked up the packs. Now, regarding what you said earlier, no, I shouldn't have followed any fucking discussion. This topic is about what TMP posted and any questions/discussions about custom implementations/modifications of the currently posted files are off topic and should be discussed in `Discussions` or [Hidden Content] Also, as a matter of fact, yes, I did read a bit about what you said about the inventory - you said you've only changed the client part without compiling the source, which doesn't make any sense since the capacity of the inventory is actually set from the source.
  10. You should've probably looked if you have that file before asking a question here and waiting for an hour for someone to answer. I've tested the client and didn't have any problems. Not in regards to the files, at least.
  11. No. I think most people use offline shop by great, however, I believe that's the one with the crazy bug that duplicates items, so you'll have to fix that since I don't know if there's any public fix. Regarding a dev selling one, I don't know, sorry.
  12. I don't know if you still need this, but I gave someone an answer here, so I won't write it again. Good luck
  13. Your 'apply' object is null. Do you have it in questlib?
  14. It's saying 'apply' is null. Do you have it in questlib?
  15. Are we supposed to just guess what system you used? Give us a link or something to see the code, dude..
  16. I recommend you give up on whatever you're trying to do with metin2 and start learning some basic programming. I don't say that to bash on you, but giving you some advice. The error states clearly that the function `CompressEncryptedMemory` does not take 5 arguments. Why? Well, if you would've taken the time to look in EterBase/lzo.cpp, you would've seen that the function actually takes only 4 arguments. bool CLZO::CompressEncryptedMemory(CLZObject & rObj, const void * pIn, UINT uiInLen, DWORD * pdwKey) { rObj.BeginCompress(pIn, uiInLen); if (rObj.Compress()) { if (rObj.Encrypt(pdwKey)) return true; return false; } return false; } The same with `Decompress` function - it doesn't take 4, but 3 arguments. Good luck
  17. First, thank you for the contribution, I'm sure it's in good faith! Now, let's clarify some things before anyone starts doing what you said. 1. The ";;" things doesn't change anything. You can basically put ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;" and it's the same shit, it'll just be ignored. 2. Yes, SAMLL could cause problems. Though, if it would've been used in the proto, you wouldn't be able to start the server because of it(Correct me if it is used now, since I didn't bother checking it). 3. Changing ANTI_MUSA to ANTI_WARRIOR and ANTI_MUDANG to ANTI_SHAMAN is going to force you to edit the whole proto. Is this a big task? No. Will you have to do it everytime you change the proto with, let's say, the proto P3ng3r gives us all the time in the unpacked official files? Yes. Should you change it? Up to you. I don't like extra work. 4. & 5. Changing that header/packet doesn't change anything. 6. see 1. 7. That's the same exact shit. Just because you have "release" mode available in the source, it doesn't mean you should use it. Notes: Debug: used for debugging. Release: The version is stable and released for INTERNAL use. Distribute: The version is stable and can be distributed to the rest of the world. It's confusing, I know. Apple came up with this for their software and the rest of the world had to follow(why? I don't know and I don't give a shit). 8. Again, that doesn't change anything. It just adds more shit to keep track of when changing the proto with different files. Don't take this the wrong way, I really appreciate when people contribute to the community, but maybe next time tell the others(who maybe don't know better), whether what they're changing is going to help them in any way or if it's just optional stuff that doesn't make no difference(or actually give them more stuff to keep track of in the future). If you want to post that source, post it, no one's stopping you. I might actually help someone, if that's your intent. Thank you and have a great day!
  18. I don't have the "system"(just wanted to mention this from the beginning) so don't ask for code(nor examples, for that matter). I'm probably too late here, but why don't you just attach it to the character window? OR Get the position of the character window when you click the button and update the position of the bonus window before it shows up. Good luck
  19. Apologies for the late reply, I didn't have a lot of time for metin2. Now, in regards to the bug, I remembered about a conversation I had with @MrQuin in Dec 2020 and he said he had a similar problem when running the server in release mode on windows. I've just compiled the server with this and seems like it's fixed now. In common/tables.h search for: typedef struct SPlayerSkill And replace it with: typedef struct SPlayerSkill { BYTE bMasterType; BYTE bLevel; #ifdef _WIN32 DWORD tNextRead; #else time_t tNextRead; #endif } TPlayerSkill; I'll upload the source with the update when I have a bit of free time. Thank you for letting us know! For everyone else: Please don't hesitate to write a comment or shoot me a message if you find any other bugs! Thank You! Here's a picture of the server running in release: [Hidden Content] Problem update: 17/01/2023 Just found out(by mistake) it happens because `_USE_32BIT_TIME_T` preprocessor definition is only added in debug build. To fix it once and for all(no need to edit the tables anymore), do the following: Select all projects(game, db, gamelib, etc), right click -> properties -> C/C++ -> Preprocessor (note: make sure the configuration is set for `Release`) Extend preprocessor definitions with `_USE_32BIT_TIME_T`
  20. I'm compiling right now. I'll take a look once it's done. Does it happen when both the client and the server are running in release? Or when only one of them is running in release while the other is in debug?
  21. That's not the only thing you have to do, mate. I assumed you have at least a basic understanding of VS. It'll take me a few hours to write it step by step and I will not do that. However, here's the basics of what you should do, just to get you started: Create projects for each lib as well(libgame, liblua, libpoly, libsql, libthecore) and link them to the extern. You should probably create a folder for Common as well(a folder, not a project!). Add the links for the extern to game as well(in case you didn't), then right click on the project->settings->linker->input and add all the libs to "Additional dependencies" Here's mine for the debug setup, to save you some time: mysqlclient.lib;ws2_32.lib;DevIL-1.7.8d.lib;DevILU-1.7.8d.lib;DevILUT-1.7.8d.lib;cryptlib.lib;libpoly_d.lib;libgame_d.lib;libthecore_d.lib;liblua_d.lib;%(AdditionalDependencies) Don't forget to add the links to where these libraries are in VS++ Directories-> External Include Directories and Library directories OR in Linker->General->Additional Library Directories !!!! These are just the things I remembered you have to do, but there's probably way more. I would've started with DB if I were you,. Game takes a while to compile and you'll rip you hair out if it fails 100 times. One other alternative would be to download some server files that are already set up and replace the files with yours. You can take a look at what I posted a few days ago if you want: Maybe I'll create a full tutorial on the forum at some point, but I'm too busy this week, so that's not going to happen very soon.
  22. Update: I just found out the problem is actually from root.
  23. Ok, so I'm past that. I've moved the initialization of modules in a separate function which is called before the python interpreter gets initialized(like the docs said). Now in UserInterface, Main(), the workflow looks like this: if (LocaleService_LoadGlobal(hInstance)) SetDefaultCodePage(LocaleService_GetCodePage()); InitializeModules(); Py_Initialize(); CPythonApplication* app = new CPythonApplication; app->Initialize(hInstance); Before the python app class is instantiated, we load the modules, then initialize the interpreter. Also, in PythonLauncher.cpp, I'm doing this(for now): CPythonLauncher::CPythonLauncher() { if (!Py_IsInitialized()) { Py_Initialize(); } } I should probably remove the initialization from here and just throw an error if it fails to initialize in UserInterface, but it's okay for now.. I have bigger fish to catch. Now, next problem(which is probably the last one in the source regarding this subject): In `UserInterface.cpp->RunMainScript()` we're calling pyLauncher.RunFile("system.py") Which calls `CPythonLauncher::RunMemoryTextFile` Which calls `CPythonLauncher::RunLine` with the file data as a string. The problem is ```PyObject* v = PyRun_String((char*)c_szSrc, Py_file_input, m_poDic, m_poDic);``` always returns NULL instead of running the code. Yes, the code gets there, I've already checked. My thoughts are, it might be because of what's going on in RunMemoryTextFile, specifically in: stConvFileData += "exec(compile('''"; // ConvertPythonTextFormat { for (UINT i = 0; i < uFileSize; ++i) { if (c_pcFileData[i] != 13)// carriage return { stConvFileData += c_pcFileData[i]; } } } stConvFileData += "''', "; stConvFileData += "'"; stConvFileData += c_szFileName; stConvFileData += "', "; stConvFileData += "'exec'))"; stConvFileData += '\0'; The `compile()` function already takes method = 'exec', why do we need to call exec again?(see the first line in the code block before this) Here's the docs: [Hidden Content] If I keep it as `exec(compile(''' ` it always returns null when it's executed in RunLine and it throws a shitload of traceback errors. If I remove the `exec` and just `compile` it with the exec method passed in the function, it doesn't return null anymore, but the code doesn't run, it just returns and jumps straight to exit(0)(in user interface), so I assume the code doesn't get executed. I'll compile and post the errors in a few minutes. Any ideas? Here's the follow up: With `exec(compile(`: So, the code gets executed but can't import anything? Here's system.py:
  24. I'm not sure, but it might be in cmd_general.cpp, somewhere in one of the ride functions. Edit: Or in horse_rider.cpp bool CHorseRider::StartRiding()
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.