Jump to content

VegaS™

Forum Moderator
  • Posts

    656
  • Joined

  • Last visited

  • Days Won

    187
  • Feedback

    100%

Everything posted by VegaS™

  1. ../Srcs/Client/UserInterface/PythonPlayerInput.cpp Replace the whole function void CPythonPlayer::__SetAutoAttackTargetActorID(DWORD dwVID) with: [Hidden Content]
  2. You've to use pre_qc.py or make some changes on your qc core for enable defines in quests. Updated, check my previous reply again.
  3. You could do it with a map. [Hidden Content] Also you could use my C++ library (there exists python too) for coloring a string, much easier. [Hidden Content] #include "cff.h" std::string text = CFF::format("Metin2", "green"); std::string text = CFF::format(std::to_string(8000), "banana"); std::string text = CFF::format(std::to_string(412.55), "red"); std::string text = CFF::format("Pending", "#113355"); std::string text = CFF::format("Item name:", "springgreen", CFF::FLAG_NEW_TAB) + CFF::format(pItemData->GetName(), "chocolate"); std::vector<string> text = CFF::multi_format({"a", "b", "c"}, "red"); // text[0], text[1], text[2]
  4. Not tested, i'm not at home. What's new: You can use comment sections in locale_list, helps you to identify much faster the quests. Two methods of reading, if you enable QC_READ_FILE_FROM_LIST, all of the quests from locale_list will be compiled, if you enable QC_READ_ALL, all of the quests file from specific directory (folders/sub-folders) will be compiled. How-To-Use: python make.py [Hidden Content]
  5. I thought would be nice to do it in C++ too, at the moment i'm at job and i can't commit the full source to git repository, i'll update it tonight.
  6. (2.5) Questions & Answers specific rules Don't modify your thread (or reply to it) to mark it solved, and not explain the solution to the issue. For these who wants this, there're two simple methods: 1. Disable for all maps. [Hidden Content] 2. Disable for a specific map. # Search in CANNOT_SEE_INFO_MAP_DICT for: "metin2_map_devilsCatacomb" : False, # Add after: "metin2_your_map_name" : False,
  7. I don't see the reason why you would do that, but it's fine, here's the python version if someone wants it. [Hidden Content]
  8. As i thought, that's what he needed: [Hidden Content]
  9. The while is with a scope, he wanted to make for each player an specific position, not random position. @jeddawee You could atleast to post the FWarpToPosition from party.cpp, i see that you use the struct without the first argument as lMapIndex like dungeon.cpp, if you use another struct and not the one from dungeon.cpp, just send me a pm and let's don't make a spam topic. [Hidden Content]
  10. The function NumberToSecondaryCoinString which i posted is recent in their root, format string exists since Python 2.6, 11 years ago. Who stop them to use it? Nobody, they do a lot of things in a hard-way, they don't use many builtin functions which doing the same thing even in 2019, they prefer to do it manually in a hard way , they like old ways. Btw, i don't see the reason why we talk about this since we talked about 'refactoring', which means advantages include improved code readability and reduced complexity, doesn't matter what they had before. I think it's enough for today, let's don't talk about this anymore here, i'll update the gist link when i've time with these functions modified, thanks for support.
  11. You're right, then let's refactor this shit. Ymir method: def NumberToMoneyString(n) : if n <= 0 : return "0 %s" % (MONETARY_UNIT0) return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), MONETARY_UNIT0) def NumberToSecondaryCoinString(n, coinType) : if n <= 0: n = 0 coinTypeString = "" if coinType == shop.SHOP_COIN_TYPE_SECONDARY_COIN: coinTypeString = MONETARY_UNIT_JUN elif coinType == shop.SHOP_COIN_TYPE_BATTLE_POINT: coinTypeString = BATTLE_POINT elif app.ENABLE_10TH_EVENT and coinType == shop.SHOP_COIN_TYPE_10TH_EVENT: coinTypeString = TENTH_COIN else: return "Not Valied" return "%s %s" % ('.'.join([ i-3<0 and str(n)[:i] or str(n)[i-3:i] for i in range(len(str(n))%3, len(str(n))+1, 3) if i ]), coinTypeString) My method: [Hidden Content] And yes, Ymir killed the python for no-reason.
  12. I didn't rewrote the functions, is the same code, maybe removed unused lines or put them inline. Let's take an example, this: def GetAlignmentTitleName(alignment): if alignment >= 12000: return TITLE_NAME_LIST[0] elif alignment >= 8000: return TITLE_NAME_LIST[1] elif alignment >= 4000: return TITLE_NAME_LIST[2] elif alignment >= 1000: return TITLE_NAME_LIST[3] elif alignment >= 0: return TITLE_NAME_LIST[4] elif alignment > -4000: return TITLE_NAME_LIST[5] elif alignment > -8000: return TITLE_NAME_LIST[6] elif alignment > -12000: return TITLE_NAME_LIST[7] return TITLE_NAME_LIST[8] We could do it as (just example, ignore the comparation): (without making a dictionary) def GetAlignmentTitleName(currentAlignment): for alignmentIndex, alignmentValue in enumerate((12000, 8000, 4000, 1000, 0, -4000, -8000, -12000)): if currentAlignment >= alignmentValue: return TITLE_NAME_LIST[alignmentIndex] return TITLE_NAME_LIST[-1] Do you think people will understand it so well what's the index if they don't know what the function does? That's why i didn't touch these functions, they've edited (like added alignment grades) and don't know how to extend it. Btw, if you want to discuss this, we can go in off-topic category, already is enough.
  13. I could rewrite all of the functions and structure but i don't do it because the scope was to clean it not to change all structure, i did this long time ago.. if you saw the date. Btw, It's funny how you talk about shorter and efficient functions in python while... The code everytime can be improved, i don't like maybe a lot of scripts from metin2, but that doesn't means i've to rewrite them, there's isn't so much performance for a python script, if we don't talk about loops, searching, sort etc, it's fine how is it right now.
  14. Delete all of the code which you added and follow the new tutorial: Srcs/Server/common/service.h #define ENABLE_REFINE_NOTICE_SUCCESS Srcs/Server/game/src/char_item.cpp [Hidden Content]
  15. I think i'm tired or there's something wrong with what're you searching? At least a developer has access to a part of source, what you want is an collaborator, different term. There was guys smarter and they still suffered, just have careful, even if he's an collaborator, he still can fuck the server, was a friendly advice, just take it right, that's all.
  16. One advice: Some of the big servers did the same mistake like you, making a topic in forum for search a 'dev' and a lot of 'devs' tried to apply for position, the funny fact is that they didn't received any test for showing their experience in programming, the 'interview' was based on words, sending files and bullshits praise of self. If you want to find a capable guy to be one of your developer, then you need to have another good guy to give him a test in a specific language of what you need. The interview should be based on general knowledge of programming, not to do a small shit system where he can do copy-paste of existing functions from public systems. If he can't do an specific algorithm (to see his logic/mindset) in a live interview, then he's not your man. If you don't take my advice then you'll have the same destiny as Aeldra/SG and more..(recently), they added some retard 'devs' and they fucked up their server, then they was thrown out and remained with all of their resources. Be careful, metin2 scene is full of bullshit in 2019, now everybody is a developer, there exists so many public/leaked resources which they can take the idea/structure/code and add/change something and put it to sell and voila, let's do a topic in coding category and a website and make money from nothing. There're very few people right now which are good but you'll not see them to work for you, because if they're smart enough and have solid experience, they can do a lot of money alone, i don't think you can pay for how much they deserve and also most of the time, they're not available.
  17. No, you can't change the font size for TextBar (/n) in python, just for BigTextBar (/b). Client\src\eterPythonLib\PythonGraphicModule.cpp [Hidden Content] #root/uiTip.py #class TipBoard(ui.Bar): # Search for: self.width = 370 # Replace with: self.width = 740 # Search for: STEP_HEIGHT = 17 # Replace with: STEP_HEIGHT = 34 # Search for: self.SetSize(370, 20) # Replace with: self.SetSize(self.width, 40) # Search for: self.textBar = TextBar(370, 300) # Replace with: self.textBar = TextBar(self.width, 600) # Search for: self.textBar.SetClipRect(0, y, wndMgr.GetScreenWidth(), y+18) # Replace with: self.textBar.SetClipRect(0, y, wndMgr.GetScreenWidth(), y+self.STEP_HEIGHT+2)
  18. Good idea, thanks for release. But here's one thing, C++ doesn't work like this, you did two loops and in the second loop you're trying to continue with the next iteration in the loop of iterator i, but this will not work, you continue the dmiss iterator, not i. Basically what you did is: for (int i = 0; i < 5; ++i) { for (int j = 0; j < 3; ++j) if (j == 2) continue; std::cout << i << std::endl; } // 0 1 2 3 4 You need something like: [Hidden Content] But in your case just for check two values, you don't need nested loops, using a simple condition for state OFF and FADE_OUT it's enough, also you should create StopAllSound2D function and use auto for all references/pointers. void CSoundManager::StopAllSound2D() { for (uint8_t i = 0; i < CSoundManager2D::INSTANCE_MAX_COUNT; ++i) { const auto pSoundInstance = ms_SoundManager2D.GetInstance(i); if (pSoundInstance) pSoundInstance->Stop(); } } void CSoundManager::MuteSound(const bool bFadeIn) { m_isMuted = !m_isMuted; if (m_isMuted) { StopAllSound2D(); StopAllSound3D(); } if (bFadeIn) { for (uint8_t i = 0; i < CSoundManagerStream::MUSIC_INSTANCE_MAX_NUM; ++i) { const auto rMusicInstance = m_MusicInstances[i]; if (rMusicInstance.MusicState == MUSIC_STATE_OFF || rMusicInstance.MusicState == MUSIC_STATE_FADE_OUT) continue; const auto pSoundInstance = ms_SoundManagerStream.GetInstance(i); if (pSoundInstance) m_isMuted ? pSoundInstance->Pause() : pSoundInstance->Resume(); } } char buf[15]; _snprintf(buf, sizeof(buf), "Mute %s.", m_isMuted ? "Enabled" : "Disabled"); IAbstractChat::GetSingleton().AppendChat(1, buf); }
  19. Thanks girl, i forgot about it, fixed. (i didn't had that problem before, so, i can't test it) Btw, isn't the last version, when i'll have some time again, i'll refactor it. EDIT: He've vnum_range in item_names.txt too, the default version, haven't this. I'll update the repository for these who've it too, asap. (even if nobody have it like ??)
  20. UPDATE (i don't have so much time at the moment to do a proper documentation, i'll do asap) Here's a diff: [Hidden Content] Read the files with csv library Added output file for logs Fixed index position of duplicate items Support for vnum range more... You can drag your files into resource folder and run the .bat + uploaded on git: [hide][Hidden Content]]
  21. OFF: This thing is available in polish servers since 2012, their idea was: "Let's say that we're in Devil's Catacomb and i want my client to be optimized, i enabled this option and all bosses/mobs become a dog, now everything is perfect, no lag anymore, WTF, we did metin2 great again, we're genius." ON: Instead of this non-logic thing, you can enable/disable effects from mobs with game option, that's all what you need. Inside of Area.cpp -> RenderEffect you could do a simple check for ignore specific type of effects for being rendered, also this change will be in real time, you don't need to close/open client. I don't think is so hard, inside of loop function related about rendering effects you could do a check if your client is minimized to stop rendering them. You could add this before __UpdateEffectList(), inside of void CArea::RenderEffect(). (i didn't test it) [hide] // Stop rendering effects while window is minimized. const HWND hWnd = CPythonApplication::Instance().GetWindowHandle(); const bool isMinimized = static_cast<bool>(IsIconic(hWnd)); if (isMinimized) return; [/hide]
  22. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Github repository: [Hidden Content]
×
×
  • 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.