Jump to content

Search the Community

Showing results for tags 'python'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Metin2 Dev
    • Announcements
  • Community
    • Member Representations
    • Off Topic
  • Miscellaneous
    • Metin2
    • Showcase
    • File Requests
    • Community Support - Questions & Answers
    • Paid Support / Searching / Recruiting
  • Metin2 Development
  • Metin2 Development
    • Basic Tutorials / Beginners
    • Guides & HowTo
    • Binaries
    • Programming & Development
    • Web Development & Scripts / Systems
    • Tools & Programs
    • Maps
    • Quests
    • 3D Models
    • 2D Graphics
    • Operating Systems
    • Miscellaneous
  • Private Servers
    • Private Servers
  • Uncategorized
    • Drafts
    • Trash
    • Archive
    • Temporary
    • Metin2 Download

Product Groups

  • Small Advertisement
  • Large Advertisement
  • Advertising

Categories

  • Third Party - Providers Directory

Categories

  • Overview
  • Pages
    • Overview
    • File Formats
    • Network
    • Extensions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Pillory


Marketplace


Game Server


Country


Nationality


Github


Gitlab


Discord


Skype


Website

  1. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Download Here ( MEGA ) As the title indicates, the system allows you to change the default keyboard keys. Click here to check the tutorial for adding new keys & functions. Click here for tab targeting key support.
  2. M2 Download Center Download Here ( Internal ) By default, the GM mark in the envelope only appears when the GM writes to us or writes back. This modification will improve this and add a new special envelope. The solution comes from KoYGeR, a user of this forum. ///SERVER 1. Open cmd.cpp and add (intuitively, among other acmd lines): ACMD(do_get_gmlist); Find this: { "\n", NULL, 0, POS_DEAD, GM_IMPLEMENTOR } And add above: { "get_gmlist", do_get_gmlist, 0, POS_DEAD, GM_PLAYER }, 2. Open cmd_gm.cpp and at the end of the file add: ACMD(do_get_gmlist) { std::auto_ptr<SQLMsg> pmsg(DBManager::instance().DirectQuery("SELECT `mName` FROM `common`.`gmlist`")); if (pmsg->Get()->uiNumRows > 0) { for (int i = 0; i < pmsg->Get()->uiNumRows; i++) { MYSQL_ROW row = mysql_fetch_row(pmsg->Get()->pSQLResult); ch->ChatPacket(CHAT_TYPE_COMMAND, "AddGameMaster %s", row[0]); } } else { ch->ChatPacket(CHAT_TYPE_INFO, "Nie znaleziono..."); } } ///CLIENT GAME 3. Open constinfo.py and add (intuitively, without much meaning where): GM_LIST = [] 4. Open game.py and find this: net.SendEnterGamePacket() And add below: net.SendChatPacket("/get_gmlist") Find this: "PlayMusic" : self.__PlayMusic, # END_OF_WEDDING And add below: "AddGameMaster" : self.AddGameMaster, At the end of the file add: def AddGameMaster(self, gmName): constInfo.GM_LIST.append(gmName) 5. Open interfacemodule.py and find this: def __MakeWhisperButton(self, name): whisperButton = uiWhisper.WhisperButton() whisperButton.SetUpVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") whisperButton.SetOverVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") whisperButton.SetDownVisual("d:/ymir work/ui/game/windows/btn_mail_up.sub") if self.IsGameMasterName(name): whisperButton.SetToolTipTextWithColor(name, 0xffffa200) else: whisperButton.SetToolTipText(name) And change to this: def __MakeWhisperButton(self, name): whisperButton = uiWhisper.WhisperButton() if name in constInfo.GM_LIST: whisperButton.SetUpVisual("d:/ymir work/ui/mail_gm_closed.tga") whisperButton.SetOverVisual("d:/ymir work/ui/mail_gm_open.tga") whisperButton.SetDownVisual("d:/ymir work/ui/mail_gm_open.tga") whisperButton.SetToolTipTextWithColor(name, 0xffffa200) else: whisperButton.SetUpVisual("d:/ymir work/ui/mail_normal_closed.tga") whisperButton.SetOverVisual("d:/ymir work/ui/mail_normal_opend.tga") whisperButton.SetDownVisual("d:/ymir work/ui/mail_normal_opend.tga") whisperButton.SetToolTipText(name) 6. Open uiwhisper.py and add (intuitively, among other imports): import constInfo Find this: def AcceptTarget(self): And at the end of the function add: if name in constInfo.GM_LIST: self.SetGameMasterLook() Find this: def OpenWithTarget(self, targetName): And at the end of the function add: if targetName in constInfo.GM_LIST: self.SetGameMasterLook() 7. Download the envelope and put in your game (etc\ymir work\ui): [Hidden Content]
  3. M2 Download Center Download Here ( Internal ) [Hidden Content]
  4. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Hello, [Hidden Content] You have a video example on that I made. You need to make the encoding match. You can use Bandi Video Converter. Result:
  5. M2 Download Center Download Here ( Internal ) Hey, I don't want to waste your time, so let's start, it's gonna be short. src\Client EterBase\Timer.cpp | Find function: CTimer::GetElapsedMillisecond() Find this inside the function above: return 16 + (m_index & 1); Make it look like this: return 3 + (m_index & 3); EterBase\Timer.cpp | Find function: CTimer::Advance() Find this inside the function above: m_dwCurrentTime += 16 + (m_index & 1); Make it look like this: m_dwCurrentTime += 3 + (m_index & 3); GameLib\GameType.cpp | Find this (top of the file): extern float g_fGameFPS = 60.0f; Make it look like this: extern float g_fGameFPS = 250.0f; EterPythonLib\PythonWindow.cpp | Find function: CAniImageBox::CAniImageBox(PyObject * ppyObject) Find this inside the function above: m_byDelay(4), Make it look like this: m_byDelay(13), GameLib\MapOutdoorWater.cpp | Find function: CMapOutdoor::RenderWater() Find this inside the function above: STATEMANAGER.SetTexture(0, m_WaterInstances[((ELTimer_GetMSec() / 70) % 30)].GetTexturePointer()->GetD3DTexture()); Make it look like this: STATEMANAGER.SetTexture(0, m_WaterInstances[((ELTimer_GetMSec() / 30) % 30)].GetTexturePointer()->GetD3DTexture()); Since we don't want E/Q/R/F/T/G keys to be messed up, UserInterface\PythonApplication.cpp | Find these variables at the top of the file: float c_fDefaultCameraRotateSpeed = 1.5f; float c_fDefaultCameraPitchSpeed = 1.5f; float c_fDefaultCameraZoomSpeed = 0.05f; Make them look like this (you can tweak them more, these values aren't strict, just seems about right to me): float c_fDefaultCameraRotateSpeed = 0.5f; float c_fDefaultCameraPitchSpeed = 0.2f; float c_fDefaultCameraZoomSpeed = 0.007f; Client\pack\root\uitaskbar.py Find: if.constInfo.IN_GAME_SHOP_ENABLE: After: self.rampageGauge1.OnMouseOverIn = ui.__mem_func__(self.__RampageGauge_OverIn) Add: self.rampageGauge1.SetDelay(13) After: self.rampageGauge2.OnMouseLeftButtonUp = ui.__mem_func__(self.__RampageGauge_Click) Add: self.rampageGauge2.SetDelay(13) Scroll a little bit down, and then.. After: self.hpGauge = self.GetChild("HPGauge") Add: self.hpGauge.SetDelay(13) After: self.mpGauge = self.GetChild("SPGauge") Add: self.mpGauge.SetDelay(13) After: self.stGauge = self.GetChild("STGauge") Add: self.stGauge.SetDelay(13) Fast armor shining fix / UserInterface\PythonApplication.cpp (thanks @Nirray) Search on top of the file: double g_specularSpd=0.007f; Replace it with: double g_specularSpd=0.0017f; Python part simpler version by @VegaS™ That's all, compile your binary, pack your root and you are done. If you have any questions, feel free to ask it, or if you find an error, typo, anything inside this tutorial, don't hesitate to tell me, and I'll fix it ASAP. Credits goes to kespımuro and me for ghetto-fixing the rotation buttons. Cheers, xHeaven
  6. Download Alternative download links → Mega Hello Metin2 Dev. I'm here to present a Statistics System. How does it work? Players have a panel on F7 which provides the information. This system only counts how many monsters, boss's or stones the player killed. Every information is saved in player.player database. It's separated in different categories. DISCLAIMER: You can easy adapt it to PvP too. In case of any problem, report here and i'll fix it.
  7. M2 Download Other Mirrors Download Here ( GitHub ) Download Here ( MEGA ) A Mini Version of the official chatting window renewal. All settings are saved in UserData/chatting/<character_name> using the cPickle module in C, a powerful algorithm for serializing and de-serializing a Python object structure, also used by Webzen.
  8. M2 Download Center Download Here ( Internal ) When a player or monster is poisoned, a poisoning effect will appear in the life bar. The idea belongs to Whistlee from the Turkish forum. However, in Whistlee version this system does not work for monsters and has no connection with the source code, so the effect is visible only to us. I don't know if I can give a specific place where the original comes from, so I won't do it, but I put here github Whistlee's, where you can find the original code. GITHUB: [Hidden Content] Special thanks for helping me with this code for Intern,VegaS™ and HITRON. ////////// CLIENT GAME ////////// SOURCE BIN
  9. Video: Code: # The script automatically translates the drop from mob_drop_item.txt and special_item_group.txt files, utilizing the information in the locale_name.txt file import chardet import codecs def detect_encoding(filename): with open(filename, 'rb') as f: result = chardet.detect(f.read()) return result['encoding'] with codecs.open('item_names.txt', 'r', encoding='cp1250') as source_file: contents = source_file.read() with codecs.open('item_names_utf8.txt', 'w', encoding='utf-8') as target_file: target_file.write(contents) with open('item_names_utf8.txt', 'r', encoding='utf-8') as f: item_names = {} for line in f: if 'VNUM' in line or 'LOCALE_NAME' in line: continue vnum, name = line.strip().split('\t') item_names[vnum] = name drop_cpp_encoding = detect_encoding('drop.txt') with open('drop.txt', 'r', encoding=drop_cpp_encoding) as f: lines = f.readlines() new_lines = [] for line in lines: if line.startswith('Group') or 'exp' in line: new_lines.append(line) else: parts = line.split('\t') if len(parts) > 2 and parts[2] in item_names: line = line.rstrip() + ' // ' + item_names[parts[2]] + '\n' new_lines.append(line) with open('drop2.txt', 'w', encoding='utf-8') as f: f.writelines(new_lines)
  10. With this guide you can render map(s) to your login screen. Some server back in 2012 used this kinda login (DaRealFreak) and I found it pretty cool, so I did this tutorial maybe people will use it again. At def LoadMap(self): there is a list called environments where I set 17 location for you. You can edit/extend it as you wish. The client choose a random location from that list. Somebody will surely comment that it's make the client opening slower. Yes it does, but as you can see in the video that's minimal. Also if you use a client with intro video logo then it doesn't matter because that's longer than it's 1-1,5 second loading time. But if you think it's not acceptable then either optimize it somehow or stay with image background [Hidden Content]You can disable the environmental background by editing INTERACTIVE_LOGIN = 1 at the top to INTERACTIVE_LOGIN = 0. Here's a basic intrologin.py with this environmental background if you want to compare: Google Drive (or Metin2 Download) Original idea by DaRealFreak in 2012. Sincerly, TMP4
  11. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) There's just a smart python module which i did for fun, for a friend, no support for implementation. Enjoy. Github repository: [Hidden Content]
  12. M2 Download Center Download Here ( Internal ) Hello everyone. It's a good day to share an old code with you. First of all you need to know: I don't help to install it. Don't even take the contact with me about it. The whole code is written by me, and reversed from official binaries. At the beginning do a backup for your files(srcs+pys) and READ CAREFULLY the readme. W/o brain.exe please close this tab, or your browser, thank you for your understanding. Preview: Download.exe Enjoy & #h4v3fun, pngr
  13. Hi guys. I have a mount inventory system which is using the belt inventory. I have a button for it, and I had to have a Belt on to use it(like official) but I wanted to use it without Belt If you want to do this follow this tutorial, I'm not good at coding, so maybe there's better solution, but I did this that way. Sorry for my English. Open char_item.cpp and search: bool CHARACTER::IsEmptyItemGrid(TItemPos Cell, BYTE bSize, int iExceptionCell) const Search this in IsEmptyItemGrid (Item disappear fix by: Pisti95) if (Cell.IsBeltInventoryPosition()) { LPITEM beltItem = GetWear(WEAR_BELT); if (NULL == beltItem) return false; if (false == CBeltInventoryHelper::IsAvailableCell(bCell - BELT_INVENTORY_SLOT_START, beltItem->GetValue(0))) return false; Comment it, make it look like this: if (Cell.IsBeltInventoryPosition()) { //LPITEM beltItem = GetWear(WEAR_BELT); //if (NULL == beltItem) // return true; //if (false == CBeltInventoryHelper::IsAvailableCell(bCell - BELT_INVENTORY_SLOT_START, beltItem->GetValue(0))) // return false; Open belt_inventory_helper.h Search for: static bool IsExistItemInBeltInventory(LPCHARACTER pc) Make it look like this: static bool IsExistItemInBeltInventory(LPCHARACTER pc) { //for (WORD i = BELT_INVENTORY_SLOT_START; i < BELT_INVENTORY_SLOT_END; ++i) //{ // LPITEM beltInventoryItem = pc->GetInventoryItem(i); // // if (NULL != beltInventoryItem) // return true; //} return true; } You can compile game. Python part to ,,turn off" disabled slots, and make it look like you have a Belt on Open uiinventory.py Search this in class BeltInventoryWindow def RefreshSlot(self): Change this: self.wndBeltInventorySlot.SetAlwaysRenderCoverButton(slotNumber, True) To this: self.wndBeltInventorySlot.SetAlwaysRenderCoverButton(slotNumber, False) Then change this: self.wndBeltInventorySlot.DisableCoverButton(slotNumber) To this: self.wndBeltInventorySlot.EnableCoverButton(slotNumber) And I dont know if its necessary, but I did these thing too Search for this in class BeltInventoryWindow def __LoadWindow(self): In this search for: for i in xrange(item.BELT_INVENTORY_SLOT_COUNT): slotNumber = item.BELT_INVENTORY_SLOT_START + i wndBeltInventorySlot.SetCoverButton(slotNumber, "d:/ymir work/ui/game/quest/slot_button_01.sub",\ "d:/ymir work/ui/game/quest/slot_button_01.sub",\ "d:/ymir work/ui/game/quest/slot_button_01.sub") "d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", False, False) And comment the last line, make it look like this: #"d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", False, False) Client source (Still don't know, if it's necessary or not) Open Userinterface/PythonPlayerModule.cpp Search for: #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM PyObject * playerIsEquippingBelt(PyObject* poSelf, PyObject* poArgs) { Make it look like this: (Change PyObject * playerIsAvailableBeltInventoryCell(PyObject* poSelf, PyObject* poArgs) too! ) #ifdef ENABLE_NEW_EQUIPMENT_SYSTEM PyObject * playerIsEquippingBelt(PyObject* poSelf, PyObject* poArgs) { const CPythonPlayer* player = CPythonPlayer::InstancePtr(); bool bEquipping = false; // const TItemData* data = player->GetItemData(TItemPos(EQUIPMENT, c_Equipment_Belt)); // // if (NULL != data) // bEquipping = 0 < data->count; return Py_BuildValue("b", bEquipping); } PyObject * playerIsAvailableBeltInventoryCell(PyObject* poSelf, PyObject* poArgs) { const CPythonPlayer* player = CPythonPlayer::InstancePtr(); // const TItemData* pData = player->GetItemData(TItemPos(EQUIPMENT, c_Equipment_Belt)); // // if (NULL == pData || 0 == pData->count) // return Py_BuildValue("b", true); // // CItemManager::Instance().SelectItemData(pData->vnum); CItemData * pItem = CItemManager::Instance().GetSelectedItemDataPointer(); long beltGrade = pItem->GetValue(0); int pos = 0; if (!PyTuple_GetInteger(poArgs, 0, &pos)) return Py_BadArgument(); //return Py_BuildValue("b", CBeltInventoryHelper::IsAvailableCell(pos - c_Belt_Inventory_Slot_Start, GetItemGrade(pItem->GetName()))); return Py_BuildValue("b", CBeltInventoryHelper::IsAvailableCell(pos - c_Belt_Inventory_Slot_Start, beltGrade)); } #endif And we're done. Have a good day!
  14. Hello Today I want to share with all of you a little thing. All times when you are trying to open your safebox, it's requesting the password, isn't it? But for what? I modified to limit these requests to one input per login. Of course if you warp or change character, you need to retype your password again. But with extra modifications you can do it to store the password until you close the client, but I don't recommend this. So, first go to the uiSafeBox.py file and paste this line into the __init__ method of the PasswordDialog class, with taking care of the tabulators: self.lastPassword = "" This variable will store your last entered password. Then replace the Accept method of the same class with this: (take a look for the syntax, modulename, and true/false!) def OnAccept(self): self.lastPassword = str(self.passwordValue.GetText()) m2net.SendChatPacket(self.sendMessage + self.lastPassword) self.CloseDialog() return True When you accept the password input dialog, the entered password will be saved, if it's correct if it isn't as well. Don't worry about it, it will be reset if you entered wrong password. The next step is that to paste these new functions into the same class. def InitSafeboxPassword(self): self.lastPassword = "" def GetSafeboxPwd(self): return self.lastPassword As you can see, here is a function which will reset the entered password . With this, the file is done. Open interfaceModule.py and serach this line: ## Safebox then paste this function below: def InitSafeboxPassword(self): self.dlgPassword.InitSafeboxPassword() Then replace the AskSafeboxPassword and AskMallPassword functions with these: def AskSafeboxPassword(self): if self.wndSafebox.IsShow(): return if self.dlgPassword.IsShow(): self.dlgPassword.CloseDialog() return self.dlgPassword.SetSendMessage("/safebox_password ") if self.dlgPassword.GetSafeboxPwd() != "": self.dlgPassword.OnAccept() return self.dlgPassword.SetTitle(localeInfo.PASSWORD_TITLE) self.dlgPassword.ShowDialog() def AskMallPassword(self): if self.wndMall.IsShow(): return if self.dlgPassword.IsShow(): self.dlgPassword.CloseDialog() return self.dlgPassword.SetSendMessage("/mall_password ") if self.dlgPassword.GetSafeboxPwd() != "": self.dlgPassword.OnAccept() return self.dlgPassword.SetTitle(localeInfo.MALL_PASSWORD_TITLE) self.dlgPassword.ShowDialog() With these functions, if the last entered password is correct, the storages will open automatically with the last entered password. The file is done. Next, open your game.py and search this function: OnSafeBoxError and extend it with this line: self.interface.InitSafeboxPassword() So, as you can see this is the answer from the server to entered wrong password and this function will reset the last entered password as well . That's all, I hope you like it, and have fun. Edit.: Fix for change password. game/src/input_db.cpp void CInputDB::SafeboxChangePasswordAnswer(LPDESC d, const char* c_pData) { //[...] d->GetCharacter()->ChatPacket(CHAT_TYPE_COMMAND, "safebox_change_passwd %d", p->flag); // to the bottom of the function } client/UserInterface/PythonNetworkStreamCommand.cpp void CPythonNetworkStream::ServerCommand(char * c_szCommand) { // [...] const char * szCmd = TokenVector[0].c_str(); if (!strcmpi(szCmd, "quit")) { // [...] } else if (!strcmpi(szCmd, "BettingMoney")) { // [...] } //Add between the "else if" cases: else if (!strcmpi(szCmd, "safebox_change_passwd")) { if (2 != TokenVector.size()) { TraceError("CPythonNetworkStream::ServerCommand(c_szCommand=%s) - Strange Parameter Count : %d", c_szCommand, TokenVector.size()); return; } const int iFlag = atoi(TokenVector[1].c_str()); PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "RecvSafeboxPasswordChangeAnswer", Py_BuildValue("(i)", iFlag)); } else if (!strcmpi(szCmd, "gift")) { // [...] } // [...] } client/root/game.py # below of CommandCloseSafebox function add: def RecvSafeboxPasswordChangeAnswer(self, flag): self.interface.RecvSafeboxPasswordChangeAnswer(flag) client/root/interfaceModule.py # Below of CommandCloseSafebox function add: def RecvSafeboxPasswordChangeAnswer(self, flag): if flag: self.dlgPassword.SetSafeboxPwd(str(self.wndSafebox.dlgChangePassword.GetNewPasswordText())) client/root/uiSafeBox.py # change the OnAccept function of the PasswordDialog class with this: def OnAccept(self): if self.lastPassword == "" and "" != str(self.passwordValue.GetText()): self.lastPassword = str(self.passwordValue.GetText()) net.SendChatPacket(self.sendMessage + self.lastPassword) self.CloseDialog() return True # add this new function to the PasswordDialog class: def SetSafeboxPwd(self, pwd): self.lastPassword=pwd # add this line into the ChangePasswordDialog.__init__ function: self.__newPassword = "" # add this line into the ChangePasswordDialog.Open function: self.__newPassword = "" # add this function to the ChangePasswordDialog class: def GetNewPasswordText(self): return self.__newPassword # add the following line into the ChangePasswordDialog.OnAccept function (between the password check and the SendChatPacket): # return True self.__newPassword = newPasswordText #m2net.SendChatPacket("/safebox_change_password %s %s" % (oldPasswordText, newPasswordText)) Edit: fix of flooding: moving the saving method of the password from the OnAccept function to a separated one and calling it when the Safebox opens, this will be enough I guess. client/root/uiSafeBox.py # add the following function to the PasswordDialog class: def SavePassword(self): if self.lastPassword == "" and "" != str(self.passwordValue.GetText()): self.lastPassword = str(self.passwordValue.GetText()) # make the changes on the function in the PasswordDialog class def OnAccept(self): net.SendChatPacket(self.sendMessage + (self.lastPassword if self.lastPassword != "" else self.passwordValue.GetText())) self.CloseDialog() return True client/root/interfaceModule.py # add the following line into the beginning of the OpenSafeboxWindow and the OpenMallWindow function self.dlgPassword.SavePassword()
  15. Hi guys, I created this topic to have a collection topic about removing unnecessary code. blocked_country_ip Limit_time More removed code:
  16. Hello community, I decided to create a mini function in python for my server that adds the information if the player can drop or not on mobs and stones. [Hidden Content]
  17. M2 Download Center Download Here ( Internal ) Download Here ( GitHub )
  18. Hello, comm! Here is a tutorial of how to display the level of character and the time in pm. root/uiwhisper.py: locale/en/locale_game.txt
  19. I want share you critical effect: UserInterface/InstanceBaseEffect.cpp open and search: else if (flag & DAMAGE_CRITICAL) { //rkEftMgr.CreateEffect(ms_adwCRCAffectEffect[EFFECT_DAMAGE_CRITICAL],v3Pos,v3Rot); //return; 숫자도 표시. } Thus replaced: else if (flag & DAMAGE_CRITICAL) { rkEftMgr.CreateEffect(ms_adwCRCAffectEffect[EFFECT_DAMAGE_CRITICAL],v3Pos,v3Rot); //return; 숫자도 표시. } root/playersettingmodule.py open and search: #chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DAMAGE_CRITICAL, "", "d:/ymir work/effect/affect/damagevalue/critical.mse") Thus replaced: chrmgr.RegisterCacheEffect(chrmgr.EFFECT_DAMAGE_CRITICAL, "", "d:/ymir work/effect/affect/damagevalue/critical.mse") Effect: [Hidden Content] [Hidden Content]
  20. Video: Code: import os import shutil source_folder = '/txt/src' target_folder = '/txt/src2' if not os.path.exists(target_folder): os.makedirs(target_folder) ifdef = '#ifdef ' ifndef = '#ifndef ' define = 'ENABLE_SWITCHBOT' def process_files(source_folder, target_folder): for entry in os.scandir(source_folder): if entry.is_file() and entry.name.endswith(('.cpp', '.h')): with open(entry.path, 'r', encoding='latin1') as file: new_file = None copy = False lines = file.readlines() line_num = 0 for line in lines: if ifdef + define in line or ifndef + define in line: copy = True if not new_file: new_file = open(os.path.join(target_folder, entry.name), 'w', encoding='latin1') for i in range(max(0, line_num - 30), line_num): new_file.write(lines[i]) if copy: new_file.write(line) if '#endif' in line: if copy: new_file.write("\n // =================== INNA FUNKCJA ================= \n \n") new_file.write("// ====== WYSZUKAJ: ") new_file.write(define) new_file.write("\n// Tutorial wygenerowany automatycznie przez Grzyb.ovh \n") new_file.write("\n \n") copy = False line_num += 1 if new_file: new_file.close() elif entry.is_dir(): new_target_folder = os.path.join(target_folder, entry.name) if not os.path.exists(new_target_folder): os.makedirs(new_target_folder) process_files(entry.path, new_target_folder) process_files(source_folder, target_folder)
  21. M2 Download Center Download Here ( Internal ) Download Here ( GitHub )
  22. M2 Download Center Download Here ( Internal ) [Hidden Content] VT: [Hidden Content]
  23. Hello community, I decided to create a patcher in C# to share here completely free. Download [hide][Hidden Content] [Hidden Content]]
  24. Download Alternative download links → M2DL Hello! I share this little modifications, made by @peaceofficial (He gave me rights to share it.) (The thinboard will be different for you.) Here is GIF, how is it looks like:
  25. M2 Download Center Download Here ( Internal ) Hi. This small release save our sent and received private messages till we change the character. If you close by mistake PM with somebody and after you'll open the converastion with that player the old messages will be loaded from dictionary. All changes are in root. Let's begin. constInfo.py Add: WHISPER_MESSAGES = {} game.py Replace these methods: def OnRecvWhisper(self, mode, name, line): if mode == chat.WHISPER_TYPE_GM: self.interface.RegisterGameMasterName(name) line.replace(" : ", ": ") if not self.interface.FindWhisperButton(name) and constInfo.WHISPER_MESSAGES.has_key(name) and not self.interface.whisperDialogDict.has_key(name): self.interface.RecvWhisper(mode, name, line, True) else: self.interface.RecvWhisper(mode, name, line, False) if not constInfo.WHISPER_MESSAGES.has_key(name): constInfo.WHISPER_MESSAGES.update({name : [(mode, line)]}) else: constInfo.WHISPER_MESSAGES[name].append((mode, line)) chat.AppendWhisper(mode, name, line) def OnRecvWhisperSystemMessage(self, mode, name, line): chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, line) self.interface.RecvWhisper(mode, name, line, False) def OnRecvWhisperError(self, mode, name, line): if localeInfo.WHISPER_ERROR.has_key(mode): chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, localeInfo.WHISPER_ERROR[mode](name)) else: chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Whisper Unknown Error(mode=%d, name=%s)" % (mode, name)) self.interface.RecvWhisper(mode, name, line, False) interfaceModule.py Replace this method: def RecvWhisper(self, mode, name, line, loadMsg): if loadMsg: for text in constInfo.WHISPER_MESSAGES[name]: chat.AppendWhisper(text[0], name, text[1]) if not self.whisperDialogDict.has_key(name): btn = self.FindWhisperButton(name) if 0 == btn: btn = self.__MakeWhisperButton(name) btn.Flash() chat.AppendChat(chat.CHAT_TYPE_NOTICE, localeInfo.RECEIVE_MESSAGE % (name)) else: btn.Flash() elif self.IsGameMasterName(name): dlg = self.whisperDialogDict[name] dlg.SetGameMasterLook() introSelect.py In def Open(self): add: WHISPER_MESSAGES = {} uiWhisper.py Add: import constInfo Replace this method: def OpenWithTarget(self, targetName="", loadMessages=False): chat.CreateWhisper(targetName) chat.SetWhisperBoxSize(targetName, self.GetWidth() - 60, self.GetHeight() - 90) self.chatLine.SetFocus() self.titleName.SetText(targetName) self.targetName = targetName self.textRenderer.SetTargetName(targetName) self.titleNameEdit.Hide() self.ignoreButton.Hide() if app.IsDevStage(): self.reportViolentWhisperButton.Show() else: self.reportViolentWhisperButton.Hide() self.acceptButton.Hide() self.gamemasterMark.Hide() self.minimizeButton.Show() if loadMessages: if constInfo.WHISPER_MESSAGES.has_key(targetName): for text in constInfo.WHISPER_MESSAGES[targetName]: chat.AppendWhisper(text[0], targetName, text[1]) in def AcceptTarget(self): at botton add: if constInfo.WHISPER_MESSAGES.has_key(name): for text in constInfo.WHISPER_MESSAGES[name]: chat.AppendWhisper(text[0], name, text[1]) And replace this method: def SendWhisper(self): text = self.chatLine.GetText() textLength = len(text) if textLength > 0: if net.IsInsultIn(text): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_INSULT_STRING) return net.SendWhisperPacket(self.targetName, text) self.chatLine.SetText("") if not constInfo.WHISPER_MESSAGES.has_key(self.targetName): constInfo.WHISPER_MESSAGES.update({self.targetName : [(1, ("{}: {}".format(player.GetName(), text)))]}) else: constInfo.WHISPER_MESSAGES[self.targetName].append([1, "{}: {}".format(player.GetName(), text)]) chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + ": " + text) That's all If you will find any bugs just give me some feedback.
×
×
  • 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.