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

  • Feature Plan

Categories

  • Release Notes

Categories

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

Calendars

  • Community Calendar

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. Hello Metin2 Dev. As the title says, i'm here to present a way to block pvp option on certain maps, this is good for PvP Projects. #Search this function: def __OnClickPvPModeFreeButton(self): #Replace with: def __OnClickPvPModeFreeButton(self): if self.__CheckPvPProtectedLevelPlayer(): return self.__RefreshPVPButtonList() import background if background.GetCurrentMapName() == "metin2_map_c1": chat.AppendChat(chat.CHAT_TYPE_INFO, "You can't do this here. ") elif constInfo.PVPMODE_ENABLE: net.SendChatPacket("/pkmode 2", chat.CHAT_TYPE_TALKING) else: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_PVPMODE_NOT_SUPPORT) Wish you a good use on this. With best regards, Doose.
  2. Hey guys , I am new to the community been lurking around trying to learn here and there . My knowledge isn't huge its very basic but I thought I could give back with the little I know , probably most of you know how to do this , but I have been looking around for a way to do it on the forum I couldn't find it till I came across this Thread from @ Mali . P.S : if you have a better way of doing the if statement please let me know I am not that familiar with the files as I said . Okay let me start . 1 ) Head to your serverinfo.py file in root , Check your STATE_DICT . ex : STATE_DICT = { 0 : "OFFLINE", 1 : "ONLINE", 2 : "BUSY", 3 : "FULL" } ** In my example I only want to have it green when the server is Online and any other status I want to be red , you can tweak it to your own liking . 2) Then you go to intrologin.py and look for : self.channelList.InsertItem(channelID, " %s %s" % (channelName, channelState)) 3) Replace it with : if channelState=="ONLINE": self.channelList.InsertItem(channelID, " %s |cffADFF2F%s" % (channelName, channelState)) else: self.channelList.InsertItem(channelID, " %s |cffCd0000%s" % (channelName, channelState)) ***One thing to note : You need to match your desired Status from your own serverinfo.py and replace "ONLINE" with it . Preview : As I mentioned before if you have a better dynamic way please let me know I am here to learn
  3. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) It's giving random informations about game at loading window. Group "Normal" has global informations. If you don't add any special map index, you will see global informations.
  4. Download Center Github or Internal Link With this 'system' you will be able to open the PM Window just by clicking on the Player Name on any Chat Category not only on Global (normal, group, guild...) I use martysama so if you use anything else you need to edit it for your sources. Because i did not found an full tutorial here it is, is not perfect i know. Preview: [Hidden Content] Bellow is just an example, follow the tutorial on github or download it from dev. Pack Search inside interfacemodule.py and edit it like bellow: def MakeHyperlinkTooltip(self, hyperlink): tokens = hyperlink.split(":") if tokens and len(tokens): type = tokens[0] if "item" == type: self.hyperlinkItemTooltip.SetHyperlinkItem(tokens) # Add this under like here elif "msg" == type and str(tokens[1]) != player.GetMainCharacterName(): self.OpenWhisperDialog(str(tokens[1])) Server Srcs Search inside input_main.cpp and make the changes like bellow: // With Chat Color #ifdef ENABLE_CHAT_COLOR_SYSTEM static const char* colorbuf[] = {"|cFFffa200|H|h[Staff]|h|r", "|cFFff0000|H|h[Shinsoo]|h|r", "|cFFffc700|H|h[Chunjo]|h|r", "|cFF000bff|H|h[Jinno]|h|r"}; int len = snprintf(chatbuf, sizeof(chatbuf), "%s |Hmsg:%s|h%s|h|r : %s", (ch->IsGM()?colorbuf[0]:colorbuf[MINMAX(0, ch->GetEmpire(), 3)]), ch->GetName(), ch->GetName(), buf); #endif // Without Chat Color just change it like this int len = snprintf(chatbuf, sizeof(chatbuf), "|Hmsg:%s|h%s|h|r : %s", ch->GetName(), ch->GetName(), buf); Source @ Sanchez Client Srcs Search inside PythonNetworkStreamPhaseGame.cpp bool CPythonNetworkStream::RecvChatPacket() { .. // Search this like case CHAT_TYPE_WHISPER: { .. } .. } And add this inside the case, like this:
  5. M2 Download Center Download Here ( Internal ) Hi friend. In uitooltip.py, Updated AFFECT_DICT like this: ex: at APPLY_MAX_HP ,3000 ,is the maximum value, change to all bonuses with your maximum value next, modify this function like this: def __GetAffectString(self, affectType, affectValue, smax = 0): if 0 == affectType: return None if 0 == affectValue: return None try: if self.AFFECT_DICT[affectType][1] == affectValue and smax != 0: return self.AFFECT_DICT[affectType][0](affectValue) + " |cFFFF0000|hMax" else: return self.AFFECT_DICT[affectType][0](affectValue) except TypeError: return "UNKNOWN_VALUE[%s] %s" % (affectType, affectValue) except KeyError: return "UNKNOWN_TYPE[%s] %s" % (affectType, affectValue) Search for: def __AppendAttributeInformation change this line: affectString = self.__GetAffectString(type, value) with this affectString = self.__GetAffectString(type, value, 1)
  6. I made this script because I was too lazy to do it from the source... The title says it all. Steps are in readme.
  7. Download GitHub (Click Here) / Mega (Click Here) To implement this feature, you need the Mythical Grade expansion implemented on your server! Google is your friend. Exchange of Dragon Stone Bonuses "Change Attribute" To change the bonuses of a mythical dragon stone unlike the different cases, you will have to select another option from the alchemist, that is "Mythical Dragon Stone: Bonus Change". You will need the stone that you intend to modify and the variable number of Dragon Flames depending on the clarity of the stone you intend to modify. According to the Wiki's, this is the table of variables for each clarity. SIDE NOTE I'm not sure where they got these numbers so I just hard coded them in a header file. They have also added a new group in the "dragon_soul_table.txt" parser file but for what I understood, it's just another probability table. I didn't find it necessary to follow their logic because the "ApplyNumSettings" group already has probabilities of 0 to 3 for adding additional bonuses. Video Preview If you find any problems, please let me know! Have fun!
  8. Hello, Today I will present you two new features for affect. Real time affects: Long time ago a client of mine wanted some of his affects to be real time. As you may know the affects in metin2 are consumed only if you are online (except premium, but that is another story). The easier way to achieve this was to create a new variable inside the affect called bIsRealTime, set it to 1 and store the duration as unix time instead of seconds. You can use this new functionality by adding True at the end of the AddAffect function call and everything will work automaticaly. Update affect: In a version some time ago the official servers added this new functionality to only update an affect. This is used for the Summer Event Roulette minigame to update the collected souls count in real time in client. I didn't create a easy way to use this because it depends on what you update for the affect. Here is an example of how I used it on this event to update lApplyValue: CAffect * pAffect = pkChar->FindAffect(AFFECT_LATE_SUMMER_EVENT_BUFF); if(pAffect) { pAffect->lApplyValue += 1; pAffect->bIsUpdate = true; // Update the client SendAffectAddPacket(pkChar->GetDesc(), pAffect); } Download link: [Hidden Content]
  9. Hi Maybe not many of you need this, but since I made it, it may help someone. It's a simple script made in python, which checks both files (item_names.txt and item_proto.txt) for missing VNUM differences in one of the files. For example: I used it because I rebuilt both files, deleted items I will never use and restructured some data. In the end, I realized that I have quite a few missing lines from the item_proto.txt file but have them present in item_names.txt. So I made this script, which checked every VNUM present in item_names.txt but missing from item_proto.txt. This made it much easier for me to solve this problem. Atention: For the GUI one, you will need to install PyQt5 via PIP There is a version of just code, so u gonna modify in the code the file names, then run it via terminal And there is a GUI version, when u run it into a terminal, it will open a GUI and u can chose the files from anywhere, check vnums and also lines
  10. M2 Download Center Download Here ( Internal ) good day I want to copy this system metin2 Hispano i work the quest and python lack the effects, c/u what does it his way quest duelo begin state start begin when kill with npc.is_pc() begin pc.setqf("estado", pc.getqf("estado")+1) if pc.getqf("estado") == 1 then pc.setqf("asesinatos", pc.getqf("asesinatos")+1) chat("He tio, pero si has hecho un *FristKill*") cmdchat("Fris") elseif pc.getqf("estado") == 2 then pc.setqf("asesinatos", pc.getqf("asesinatos")+2) chat("He tio, pero si has hecho un *DoubleKill*") cmdchat("Double") elseif pc.getqf("estado") == 3 then pc.setqf("asesinatos", pc.getqf("asesinatos")+4) chat("He tio, pero si has hecho un *TripleKill*") cmdchat("Triple") elseif pc.getqf("estado") == 4 then pc.setqf("asesinatos", pc.getqf("asesinatos")+7) chat("He tio, pero si has hecho un *MultiKill*") cmdchat("Multi") elseif pc.getqf("estado") == 5 then pc.setqf("asesinatos", pc.getqf("asesinatos")+15) chat("He tio, pero si has hecho un *UltraKill*") cmdchat("Ultra") pc.setqf("estado", 0) chat("Se han reseteado tus kills con exito.") end end end end game.py # sistema de rachas jfirewall "Fris" : self.__Rachas, "Double" : self.__double, "Triple" : self.__triple, "Multi" : self.__multi, "Ultra" : self.__ultra, # sistema de rachas end ultimately def __Rachas(self): net.SendChatPacket("(racha)") def __double(self): net.SendChatPacket("(racha2)") def __triple(self): net.SendChatPacket("(racha3)") def __multi(self): net.SendChatPacket("(racha4)") def __ultra(self): net.SendChatPacket("(racha5)") playersettingmodule.py chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+12, "", EmoticonStr+"name.mse") net.RegisterEmoticonString("(racha)") chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+13, "", EmoticonStr+"name.mse") net.RegisterEmoticonString("(racha2)") chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+14, "", EmoticonStr+"name.mse") net.RegisterEmoticonString("(racha3)") chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+15, "", EmoticonStr+"name.mse") net.RegisterEmoticonString("(racha4)") chrmgr.RegisterEffect(chrmgr.EFFECT_EMOTICON+16, "", EmoticonStr+"name.mse") net.RegisterEmoticonString("(racha5)") paste the efect in: d:/ymir work/effect/etc/emoticon/ credtis: python and quest jfirewall thank Tico correct quest pd: c/u designs its effects
  11. Hi, I will share with you the solution of a general problem that occurs in infrastructures such as MartySama that use an account recording system over REGISTRY. When you save your account, the data is saved in the Windows Registry, as shown in the example below. Everything is great, the system is exactly what we wanted. Account information is no longer saved in files in the client. However, there is a problem. Players have this problem. If you save your character information using Turkish characters, the client does not open and gives an error. It states that you have a problem with characters used on a system that supports ASCII encoding. Check This ; LoginWindow.__LoadScript.BindObject - <type 'exceptions.UnicodeEncodeError'>:'ascii' codec can't encode character u'\xe7' in position 8: ordinal not in range(128) To resolve this, follow the steps below. Root/Intrologin.py find in "def SAB_Click_Save(self, slot):" if len(id) == 0: self.PopupNotifyMessage(localeInfo.LOGIN_INPUT_ID, self.SetIDEditLineFocus) return Add this just above the code if any(ord(char) > 127 for char in id + pwd): self.PopupNotifyMessage(localeInfo.TURKISH_WORDS) return It will be enough to add the following message anywhere in locale_game.txt TURKISH_WORDS Please do not use Turkish characters when registering your account! It's done! A few things I want to point out. 1. I am not a perfect developer, I have Python knowledge and this is how I found a solution. It's short and it works. 2. If you have a better solution suggestion, please specify. Instead of making fun of me, I ask you to respect the way I try to be useful to the community. 3. I had another account on Metin2.dev but I forgot the information so I created a new account. Moderators please understand me ^^ Kind Regards.
  12. M2 Download Center Download Here ( Internal ) little detail not mob only players. Download VT
  13. Hello everyone. Here is a little snippet for the chat history. I made this to turn back the "All" state if you turn off every each button.
  14. Hi devs ! I was getting bored during my vacation, so i had to keep myself occupied... At the request of @ Gurgarath :3, I created a small Python script that allows you to clean up unused lines from your locale_game.txt and locale_interface.txt. It is coded with Python 3.11, compatibility with earlier versions is not guaranteed. It also uses the chardet module, which is specified in the requirements.txt. For any additional information (such as the How To), please refer to the README.md. This script currently does not support imports like import LocaleInfo as li. It also does not support dynamically constructing variable names. It only detects raw constants like localeInfo.MY_CONSTANT. Downloads : Download Find this tool on my Github or M2DL Exemple of output : Takuma.
  15. Reversed From 23.1.4.0 It saves camera's close/far mode option [Hidden Content] [Hidden Content]
  16. M2 Download Center Download Here ( Internal ) Download Here ( GitHub )
  17. With these modifications, you will enable colors in notice board, like this: Image: Tutorial: Open uitip.py and add this to the start of the file: import re Now find class TipBoard(ui.Bar):, and replace it with this: class TipBoard(ui.Bar): SCROLL_WAIT_TIME = 3.0 TIP_DURATION = 5.0 STEP_HEIGHT = 17 def __init__(self): ui.Bar.__init__(self) self.AddFlag("not_pick") self.tipList = [] self.curPos = 0 self.dstPos = 0 self.nextScrollTime = 0 self.width = 370 self.SetPosition(0, 70) self.SetSize(370, 20) self.SetColor(grp.GenerateColor(0.0, 0.0, 0.0, 0.5)) self.SetWindowHorizontalAlignCenter() self.__CreateTextBar() def __del__(self): ui.Bar.__del__(self) def __CreateTextBar(self): x, y = self.GetGlobalPosition() self.textBar = TextBar(370, 300) self.textBar.SetParent(self) self.textBar.SetPosition(3, 5) self.textBar.SetClipRect(0, y, wndMgr.GetScreenWidth(), y+18) self.textBar.Show() def __CleanOldTip(self): leaveList = [] for tip in self.tipList: madeTime = tip[0] if app.GetTime() - madeTime > self.TIP_DURATION: pass else: leaveList.append(tip) self.tipList = leaveList if not leaveList: self.textBar.ClearBar() self.Hide() return self.__RefreshBoard() def __RefreshBoard(self): self.textBar.ClearBar() index = 0 for tip in self.tipList: text = tip[1] rgb = tip[2] if rgb != (0,0,0): self.textBar.SetTextColor(rgb[0],rgb[1],rgb[2]) self.textBar.TextOut(0, index*self.STEP_HEIGHT, text) self.textBar.SetTextColor(255,255,255) index += 1 def SetTip(self, text): if not app.IsVisibleNotice(): return rgb = (0,0,0) mat = re.search("\|cFF([a-zA-Z0-9]+)\|h", text) if mat and mat.group(1): hexd = mat.group(1) rgb = tuple(int(hexd[i:i+2], 16) for i in (0, 2, 4)) curTime = app.GetTime() self.tipList.append((curTime, text, rgb)) self.__RefreshBoard() self.nextScrollTime = app.GetTime() + 1.0 if not self.IsShow(): self.curPos = -self.STEP_HEIGHT self.dstPos = -self.STEP_HEIGHT self.textBar.SetPosition(3, 5 - self.curPos) self.Show() def OnUpdate(self): if not self.tipList: self.Hide() return if app.GetTime() > self.nextScrollTime: self.nextScrollTime = app.GetTime() + self.SCROLL_WAIT_TIME self.dstPos = self.curPos + self.STEP_HEIGHT if self.dstPos > self.curPos: self.curPos += 1 self.textBar.SetPosition(3, 5 - self.curPos) if self.curPos > len(self.tipList)*self.STEP_HEIGHT: self.curPos = -self.STEP_HEIGHT self.dstPos = -self.STEP_HEIGHT self.__CleanOldTip() Example of use: --- in quests: notice_all("|cFF29BFBF|hColored text Example#1") notice("|cFFFF0000|hColored text Example #2") --- ingame: "n |cFF29BFBF|h Hello World" That's all
  18. M2 Download Center Download Here ( Internal ) Download Here ( GitHub ) Informations about system : When you will open a chest with drop , will appear this window. In this window you can preview drop of chest and you can make a setting how many chests you want open. [Hidden Content]
  19. Download Metin2 Download It compares 2 diffrent locale_game (One is the language you want to convert and the other is the original) You can also use as locale_interface [Hidden Content] [Hidden Content]
  20. M2 Download Center Download Here ( Internal ) Introduction Hey, since I'm often asked if I can make an example for this or that in Python, I just post some of these examples in this thread from time to time. Usually they just end up in my trash (that's why the collection is small for now) but maybe it will help some of you to learn something. You are also welcome to post examples here and I will add them to the startpost. You have a wish for a certain example? Then write it in here. PS: These examples are designed very simple, so that they can be understood. Examples ui.ComoBox() ui.ScrollBar() with text ui.AniImageBox() as loading bar ui.ListBox() ui.ToggleButton() ui.RadioButtonGroup() ui.DragButton() ui.Bar(), ui.Box(), ui.Line() ui.Gauge(), ui.SliderBar() ui.TextLine(), ui.EditLine() Pagination Tabs DropDown Tree Category Navigation ListBox Search TextLineScrollable Class Collapsible window
  21. Hello friends and enemies, ladies and gentlemans, I was playing with my introEmpire.py and as always I got an obstacle in my way, the "select empire phase" was not working properly. BEFORE(ymir): - Client was receiving a random number(1,3) if you didn't had an empire selected. - Packet that sends "simple information" to the client was called after changing the phase to "select phase". AFTER: - Client is receiving correctly the empire ID. - Client is initializing the "select empire" phase if you have no characters on your account (if pid columns in table player.player_index are set on 0) NOTE: - Other bugs not tested yet but everything seems to be OK for now ... - Need to do something about the remaining row in player.player_index table after deleting all the characters on the account.(too lazy, too sleepy now 6:33 AM ...) Here is the FIX(minimalist tutorial): root/introSelect.py (disabling the reselectempire phase) game/src/input_db.cpp
  22. Disable loading BGM music/sounds when the player has the Volume set on 0.0 I speak about this ones when you open the client, login, select character, loading. 0706 17:55:00831 :: BGM/login_window.mp3 > 304 kb 0706 17:55:08657 :: BGM/characterselect.mp3 > 472 kb 0706 17:55:19083 :: BGM/enter_the_east.mp3 > 3.14 mb But you can add the maps with specific songs to the list... 0706 18:26:21453 :: BGM/desert.mp3 > 3.61 mb 0706 18:36:17583 :: BGM/follow_war_god.mp3 > 4.63 mb 0706 18:38:00674 :: BGM/save_me.mp3 > 2.90 mb ... and more Inside the Client Srcs file: SoundManager.cpp (MilesLib) Search for the function and make the changes like bellow: void CSoundManager::PlayMusic(DWORD dwIndex, const char * c_szFileName, float fVolume, float fVolumeSpeed) { # add this if (GetMusicVolume() == 0.0) return; # add this if (dwIndex >= CSoundManagerStream::MUSIC_INSTANCE_MAX_NUM) return; ... } The only one bug problem is that when an player changes an song with the volume 0 it will not load (ty @ Karbust) this can be fixed from python (root/uisystemoption.py) When the player is choosing any song set the volume to 5/10% then load the mp3 file. def __OnChangeMusic(self, fileName): # you can try snd.SetMusicVolume(0.1 * net.GetFieldMusicVolume()) systemSetting.SetMusicVolume(0.1) Sorry if it did not help you, and however to see the files loading without any use... It bothers me. If you have an better way post it bellow and i will update the topic.
  23. M2 Download Center Download Here ( Internal ) [Hidden Content] [Hidden Content] [Hidden Content]
  24. Hello community, I recently created two scripts to promote my project and decided to share with the community. The scripts are written in python and are easy to understand. Screenhot Guide [Hidden Content] Download [Hidden Content]
  25. Hello everyone, Since I've decided to remove all the Korean texts from my source, I wrote a really simple python program that allow to check if the syntax of the locale_string.txt is correct. As you know, just one misplaced comma can essentially screw up your locale_string. How it works is really easy to understand, however I'm attaching a screenshot to remove any doubts. I hope this can be useful to someone. Screenshot import re import tkinter as tk from tkinter import filedialog def check_format(string): pattern = r'^"[^"]+";$' return re.match(pattern, string) def check_file(): file_path = filedialog.askopenfilename(filetypes=[('Text files', '*.txt')]) if file_path: count_respect_format = 0 count_do_not_respect_format = 0 invalid_strings = [] with open(file_path, 'r') as file: content = file.read() pairs = content.split('\n\n') for pair in pairs: string1, string2 = pair.strip().split('\n') if check_format(string1.strip()) and check_format(string2.strip()): count_respect_format += 1 else: count_do_not_respect_format += 1 invalid_strings.append((string1.strip(), string2.strip())) result_text.delete('1.0', 'end') result_text.insert('end', f"Number of pairs that respect the format: {count_respect_format}\n" f"Number of pairs that do not respect the format: {count_do_not_respect_format}\n\n") if count_do_not_respect_format > 0: result_text.insert('end', "Invalid strings:\n\n") for invalid_string in invalid_strings: result_text.insert('end', f"{invalid_string[0]}\n{invalid_string[1]}\n\n") else: result_text.delete('1.0', 'end') result_text.insert('end', "No file selected.") # Window gui window = tk.Tk() window.title("Locale String Format Checker - Exodus v.1.0.0") window.geometry("500x300") window.resizable(False, False) # button select_button = tk.Button(window, text="Select File", command=check_file) select_button.pack() # Widget used for whow text result_text = tk.Text(window) result_text.pack() ## window.mainloop()
×
×
  • 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.