Jump to content

VegaS™

Forum Moderator
  • Posts

    656
  • Joined

  • Last visited

  • Days Won

    187
  • Feedback

    100%

Everything posted by VegaS™

  1. Nice idea, but I'd use crypt.triple_des, for save data, like: # write open(fileName, 'wb').write((crypt.triple_des(unhex(your_hex_str))).encrypt(cPickle.dumps({'userID': userID, 'userPassword': userPassword}), ' ')) # read self.loginDataDict = cPickle.loads((crypt.triple_des(unhex(your_hex_str))).decrypt(open(fileName, "rb").read(), ' '))
  2. self.questionDialog.SetText(localeInfo.MESSENGER_DO_YOU_DELETE % self.selectedItem.GetName())
  3. I rewritted the localeInfo.py many years ago and erased all the code which isn't used like korean characters < bad encoding and more checks. (from 900+ lines to 400)
  4. In many games the alignment or grades are by specific sex.
  5. @avertuss Your compiler doesn't support this feature (list initialization (since C++11)). [Hidden Content] Replace: const std::vector<const std::string> vecTitleName{c_szTitleNameF, c_szTitleNameM}; With: std::vector<const std::string> vecTitleName; vecTitleName.push_back(c_szTitleNameF); vecTitleName.push_back(c_szTitleNameM); Or: const char * c_szTitles[] = {c_szTitleNameF, c_szTitleNameM}; const std::vector<const std::string> vecTitleName(c_szTitles, c_szTitles + sizeof(c_szTitles) / sizeof(c_szTitles[0]));
  6. This fix is very bad, you can use RE library and fix it with 3-4 lines. [Hidden Content] m = re.search('\|c([a-zA-Z0-9]+)\|h', '|cFF29bfbf|hMetin2 is dead.') # TODO: Replace |h|r with: str() # TODO: Replace |c + m.groups()[0] + |h with: str() Is just an example, good luck.
  7. You can do something like that. root/localeInfo.py Add at end of line: import requests def GetLanguage(locale_region_default = 'en'): language = locale_region_default try: request = requests.get('[Hidden Content]', params=None) if request.status_code is 200: for locale_region, country_code_tuple in LOCALE_REGION_DICT.iteritems(): if request.json().get('countryCode').lower() in country_code_tuple: language = locale_region return language except requests.exceptions.ConnectionError: return language # Initialized just one time LANGUAGE = GetLanguage() How to use it: import localeInfo print localeInfo.LANGUAGE
  8. The code which you tried is called Python Inner Functions, and for use it you have to declare it inside of another function and call it. Delete it and put this: root/game.py #Search for: self.SetSize(wndMgr.GetScreenWidth(), wndMgr.GetScreenHeight()) # Add after: ### START OF REGISTER ENVIRONMENT BASED ON SERVER TIME self.environmentInfoDict = { 4: 'd:/ymir work/environment/metin2_map_n_flame_dragon_01.msenv', 8: 'd:/ymir work/environment/mtthunder.msenv', 12: 'd:/ymir work/environment/bayblacksand.msenv', 16: 'd:/ymir work/environment/capedragonhead.msenv', 20: 'd:/ymir work/environment/snowm02.msenv', 22: 'd:/ymir work/environment/trent02.msenv' } environmentHour = (app.GetGlobalTimeStamp() / 60) / 60 % 24 if environmentHour in self.environmentInfoDict: environmentFileName = self.environmentInfoDict.get(environmentHour, constInfo.ENVIRONMENT_NIGHT) if app.IsExistFile(environmentFileName): background.RegisterEnvironmentData(0, environmentFileName) background.SetEnvironmentData(0) else: dbg.TraceError('Cannot find environment file (name: {:s})'.format(environmentFileName)) ### END OF REGISTER ENVIRONMENT BASED ON SERVER TIME
  9. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) M: [Hidden Content] F: [Hidden Content] GitHub repository: [Hidden Content] 02.03.2019 - Polymorph bug fixed.
  10. Wikipedia has a API included, you can play with it. http://wiki.metin2.co.uk/api.php MediaWiki docs: https://www.mediawiki.org/wiki/API:Properties#revisions_.2F_rv Some examples: https://stackoverflow.com/questions/7185288/how-to-get-wikipedia-content-using-wikipedias-api
  11. M2 Download Center Download Here ( Internal ) Someone wondered if I could do this script for him, i don't know the reason (maybe 4 find and extract some things), enjoy. Full repository: [Hidden Content]
  12. share/locale/germany/quest/quest_functions Src/game/src/questlua_pc.cpp How-To-Use:
  13. Haven't tested. give_item_by_name(item_vnum, item_count, name) ______________________________________________________________________________ share/locale/germany/quest/quest_functions Src/game/src/questlua_oxevent.cpp Src/game/src/OXEvent.h Src/game/src/OXEvent.cpp
  14. root/game.py # Search for: self.interface = interfaceModule.Interface() # Replace with: self.interface = interfaceModule.Interface(self) root/interfaceModule.py # Search for: def __init__(self): systemSetting.SetInterfaceHandler(self) # Replace with: def __init__(self, wndGame): self.wndGame = wndGame systemSetting.SetInterfaceHandler(self) root/uiInventory.py wndGame = self.interface.wndGame if wndGame: wndGame.StartAttack() # Function from game.py
  15. For this you need extra-shit work without sense in python to split strings, you can use a new CHAT_TYPE as i said in my first post. If you want for quest, then you have to do a new function like: (This is local function, just for you as player, if you want to send it for all players, let me know and i will post it) notice_mission('Kill all the monsters without dying.") notice_sub_mission("Kill all the monsters") Just in source: Src/game/game/src/questlua_global.cpp Src/game/common/length.h Src/Client/UserInterface/Packet.h Src/Client/UserInterface/PythonNetworkStreamPhaseGame.cpp @avertuss BTW, please stop to quote all of messages, looks very bad, you can use @tagname instead this. @Masakra This isn't a request topic for official functions, you can do it in this section Questions and Answers.
  16. You can do this extension very easy. root/game.py # Search for: self.interface = interfaceModule.Interface() # Replace with: self.interface = interfaceModule.Interface(self) root/interfaceModule.py # Search for: def __init__(self): systemSetting.SetInterfaceHandler(self) # Replace with: def __init__(self, wndGame): self.wndGame = wndGame systemSetting.SetInterfaceHandler(self) root/uiInventory.py # PrintButton self.printButton = self.GetChild2("PrintButton") if self.printButton: self.printButton.SetEvent(ui.__mem_func__(self.ClickPrintButton)) def ClickPrintButton(self): wndGame = self.interface.wndGame if wndGame: wndGame.BINARY_SetBigMessage('click_print_button') # Function from game.py
  17. You can do it in a simple way. root/interfaceModule.py root/game.py root/uiTip.py Now all what you need is to call them from server > client how you want. PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetMissionMessage", Py_BuildValue("(s)", "#MissionMessage")); PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetSubMissionMessage", Py_BuildValue("(s)", "#SubMissionMessage")); PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_CleanMissionMessage", Py_BuildValue("()")); You can do a new CHAT_TYPE_UNKNOWN_NAME or like a command, depends of how you want to use it. game/src/unknown_file.cpp UserInterface/PythonNetworkStreamCommand.cpp
  18. M2 Download Center Download Here ( Internal ) root/uiRefine.py [Hidden Content] root/constInfo.py Another idea: (you don't have to use this, is just a example, can add in tooltip where you can drop items which you need, you can add a listbox+scrollbar and send drops from server and cache it in dictionary.) [Hidden Content]
  19. You can try it like this. BOOL CActorInstance::TestActorCollision(CActorInstance & rVictim) { [........................] const std::string c_rstrAtlasMapNames[] = { "metin2_map_a1", "metin2_map_a3", "metin2_map_b1", "metin2_map_b3", "metin2_map_c1", "metin2_map_c3", "season2/metin2_map_skipia_dungeon_01", "season2/metin2_map_skipia_dungeon_02", "metin2_map_duel" }; const std::string & c_rstrMapName = CPythonBackground::Instance().GetWarpMapName(); for (size_t i = 0; i < _countof(c_rstrAtlasMapNames); ++i) { if (!c_rstrMapName.compare(c_rstrAtlasMapNames[i])) { if (rVictim.IsPC()) // IsNPC(), IsEnemy(), IsStone(), IsWarp(), IsGoto(), IsBuilding(), IsDoor(), IsObject() return false; } } }
  20. Srcs\Server\game\src\shop.cpp //Search for: ch->Save(); //Add after: #ifdef ENABLE_SHOP_AUTO_CLOSE if (IsPCShop()) { BYTE bShopItemCount = 0; for (DWORD i = 0; i < m_itemVector.size() && i < SHOP_HOST_ITEM_MAX_NUM; ++i) { if (m_itemVector[i].pkItem) ++bShopItemCount; } if (bShopItemCount == 0) // Last item { m_pkPC->CloseMyShop(); m_pkPC->ChatPacket(CHAT_TYPE_NOTICE, "Your store was closed automatically, reason: sold out."); } } #endif Srcs\Server\common\service.h #define ENABLE_SHOP_AUTO_CLOSE
  21. If I'm not mistaken, that's how it should work. LUA -- gameforge.channel_reminder = {} -- gameforge.channel_reminder._010_syschat = "You're connected to channel %d." quest channel_reminder begin state start begin when login begin local channelID = pc.get_channel_id() syschat(string.format(gameforge.channel_reminder._010_syschat, (channelID == 99 and 0 or channelID))) end end end Source // "CHANNEL_REMINDER_SYSCHAT"; // "You're connected to channel %d."; ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("CHANNEL_REMINDER_SYSCHAT"), g_bChannel == 99 ? 0 : g_bChannel);
  22. For quest already exist a option. say(string.format("[ITEM value;%d]", 189)) -- c_item_name(vnum) say(string.format("[MOB value;%d]", 20091)) -- c_mob_name(vnum) EVENT_TYPE_ITEM_NAME EVENT_TYPE_MONSTER_NAME
  23. [Hidden Content] I would like to do something like that and can be used very easy for multiple languages too. 'locale/xx/names.list' localeInfo.py [Hidden Content] any_file.py self.textLine.SetText(localeInfo.GetRandomName()) Output: Download 1000 random names: [Hidden Content]
  24. That's the single method which is correctly. quest test_quest begin state start begin when 20091.chat.string.format("DBG: name(%s), level(%d).", pc.get_name(), pc.get_level()) begin say_title("I'm a potato!") end end end New quest core: /src/share/locale/germany/quest < qc [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.