Jump to content

Search the Community

Showing results for tags 'c++'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community
    • M2Dev
    • Offtopic
    • Games Talk
    • Music / Videos / Art
    • Member Representations
    • Services & Sales
  • Metin2
    • General
    • Questions and Answers
    • Frequently Asked Questions
    • Private Servers
    • Videos
  • Suggest a Tutorial / Release
    • Suggest a Tutorial / Release
    • Temporary forum
  • Releases
    • General
    • Guides & HowTo
    • Tools
    • Programming & Scripts / Systems
    • Maps
    • Quests
    • Binaries & Clients / ServerFiles
    • 3D Models
    • 2D Graphics
    • Operating Systems

Categories

There are no results to display.

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Nationality


Skype


Discord


Website


Steam ID


Mapping


3D


2D


C++


LUA


Python


PHP


SQL


HTML


CSS


JavaScript


Empire

Found 432 results

  1. Hi there devs, Its been a while since my last release and probably this will not change, but I had this guide in my head for like a year now. In my last ~2 years while I was working in the AE team various devs came and go, and this kind of guideline would have been a huge help and could prevent lots of errors. I have been in the dev scene for more than 10 years now and (as some of you may already noticed) one of my main interest has always been making more and more user friendly and complex UI objects/interfaces and along the road gathered tons of experience. You won't end up with another shiny system that you can use in your server this time by reading this article, but instead maybe I can prevent you from making windows that stays in the memory forever, opens infinite times, prevents other window's destruction, and many more. Who knows, maybe you will leave with some brand new never ever seen tricks that you can use in your future UIs. But first of all lets talk about some good2know stuff. UI layers Layers are root "windows", their purpose to hold all kind of interface windows while managing the z order of the windows (z order = depth level of the windows, which one is "above" the other). By default there are 5 layers (from bottom to top): "GAME": this is only used for the game window (game.py), and when you click on it the game will translate the click position to the map "UI_BOTTOM": this is used for shop titles "UI": this is the default layer, we would like to put most of our windows into this layer, like inventory, character window, messenger, pms, etc, so they can overlap each other "TOP_MOST": every window, that should always be in front of the player, so other windows would not overlap them from the lower layers, so for example the taskbar is placed in this layer "CURTAIN": this is for the curtain window, which is actually a black as a pit window, that is used to smooth the change from different introXX windows (like between login and charselect) This is the outest layer and goes before the other 4. So when the render happens, the 1st layer and its childs will be rendered first, then the 2nd layer, then the 3rd, etc, so by this we will get our comfy usual client layout. In the other hand, when we click, everything goes in reverse order, first the client will try to "pick" from the curtain layer's child windows (also in reverse order), then the top_most layer, etc. Ofc there is no layers beyond the game layer, so usually the "pick" will succeed there, and we will end up clicking on the map. UI windows Now lets talk a little bit about the parts of an UI window. It has a python object part and a c++ object part. When you create a basic Window (from the ui.py) basically 2 things happen: a python Window object is created first, then through the wndMgr.Register call a c++ CWindow object is created. These 2 objects are linked, in python the handle for the CWindow is saved in the self.hWnd variable, while in the CWindow the python object handle would be stored in the m_poHandler. What are these handles for? If you want to call a method on a window from python, you have to specify which window you want to perform that action on. Remember, the python part is just a "frontend" for the UI, the actual magic happens in the cpp part. Without python, its possible to create windows, but without the cpp part there is no windows at all. On the cpp part, we need the python object handle to perform callbacks, like notifying the python class when we press a key, or pressing our left mouse button. By default the newly created window will take a seat in one of the layers (if provided through the register method, otherwise it goes to the UI layer). In a healthy client we only put useful windows directly into a layer. For example you want to put your brand new won exchange window into the UI layer, but you don't want to put all parts of a window into the UI layer (for example putting the base window into the root layer then putting the buttons on it to the root layer too, then somehow using global coordinates to make it work). Instead, you want to "group" your objects, using the SetParent function. You may say that "yeah yeah who doesn't know this?", but do you know what actually happens in the background? The current window will be removed from its current parent's child list (which is almost never null, cus when you create it its in the UI layer, so the parent is the UI layer) and will be put into the end of the new parent window's child list. Why is it important, that it will be put into the end? Because it will determine the Z order of the childs of the window. For example if I create 2 ImageBox with the same size of image on the same position and then I set ImageBox1's parent before ImageBox2's parent, then I will only see ImageBox2, because that will be rendered after ImageBox1, because its position in the childList is lower than ImageBox2's. For normal window elements (like buttons) its very important, because after you set the parent of a window, you can't alter the z order (or rather the position in the childList) unless you use the SetParent again. No, you can't use SetTop, because its only for windows with "float" flags on it, which you only want to use on the base of your window (the root window that you put your stuff on it and use it as parent for most of the time). Window picking "Picking" is performed when we move the cursor. This is an important method, because this will determine the result of various events, for example the OnMouseOverIn, OnMouseOverOut, OnMouseRightButtonDown, etc. To fully understand it, you must keep in mind that every window is a square. Do you have a perfect circle image for a button? No you don't, its a square. Do you have the most abstract future window board design with full star wars going on the background? No, you DON'T. ITS A SQUARE. By default, a window is picked if: the mouse is over the window AND the window is visible (Shown) AND the window doesn't have "not_pick" flag set AND the window is "inside its parent's square" on the current mouse position, which means if the parent's position is 0,0 and it has a size of 10x10 and the window's position is 11, 0, the window is outside of its parent's square. This is really important to understand, lots of UI has fully bugged part because of ignoring this fact. I think every one of you already experienced it on some bad illumina design implementation, when you click on a picture, and your character will start to run around like a madman, because the game says that A-a-aaaaa! There is NO WINDOW ON THAT POSITION It is useful to use the not_pick flag whenever you can, for example on pure design elements, like lines and flowers and ofc the spaceships on the background. Lets say you have a size of 10x10 image that has a tooltip, and you have a window on it that has a size of 5x5. When the mouse is over the image, the tooltip will be shown, but if its over the 5x5 window, the tooltip won't appear, unless you set it to the 5x5 window too. But if you use the not_pick flag on the 5x5 window, the 5x5 window won't be picked and the tooltip would be shown even if the mouse is over the 5x5 window. Window deletion, reference counting, garbage collector, proxying The window deletion procedure starts on the python side, first the destructor of the python object will be called, then it will call the wndMgr.Destroy that deletes the c++ object. By default, we have to store our python object, or this time our python window, to make sour it doesn't vanish. Usually we do this via the interface module, like "self.wndRandomThing = myModule.RandomWindow()". But what is this? What is in the background? Python objects has reference count. Let me present it with the following example: a = ui.Window() # a new python object is created, and its reference count is 1 b = a # no new python object is created, but now b is refering to the same object as 'a', so that object has a refence count of 2 del b # b is no longer exists, so its no longer referencing to the newly created window object, so its reference count will be 1 del a # the newly created window object's reference count now 0, so it will be deleted, calling the __del__ method To be more accurate, del-ing something doesn't mean that it will be deleted immediately. If the reference count hits 0 the garbage collector (btw there is garbage collector in python if you didn't know) will delete it, and that moment the __del__ will be called. It sounds very handy isn't it? Yeeeeah its easyyyy the coder don't have to manage object deletion its sooo simple.... Yeah... But lets do the following: class stuff(object): def __del__(self): print "del" def doStuff(self): self.something = self.__del__ # here we could just simply do self.something = self too, doesnt matter a = stuff() a.doStuff() # and now you just cut your leg del a #you are expecting the "del" print, but that will never happen You may say " oh please who tf does something stupid like this? It SO OBVIOUS that its wrong whaaaaaaat????" But in reality, I could count on only one of my hand how many devs don't make this mistake. Even my codes from the past decade are bad according to this aspect, since I only realized this problem about a year ago, when I was working on the AE wiki. Even the yimir codes contain tons of this kind of errors, however there was definitely a smart man, who implemented the __mem_func__. Okay, I see that you still don't understand how is this possible to make this kind of mistake, so let me show you a real example: class myBoard(ui.Board): def __init__(self): super(myBoard, self).__init__() self.makeItRain() def __del__(self): super(myBoard, self).__del__() print "I want to break free. I want to breeaaaaaak freeeeeeeeeeee" def doNothing(self): pass def makeItRain(self): self.btn = ui.Button() self.btn.SetParent(self) self.btn.SetEvent(self.doNothing) #boom a = myBoard() del a # but where is the print? Thats not that obvious now right? What happens here? We create a myBoard object, which in the __init__ calls to the makeItRain func, which stores an ui.Button object, and sets the button to call for the myBoard class's doNothing function with the self object pointer in the OnLeftMouseButtonDown function, which means that the reference count will never be zero, because the btn referenced in the myBoard but myBoard is referenced in the btn but the btn is referenced in the.... so you know, its a spiral of death, that our best friend garbage collector can't resolve. Okay, but how to do it correctly? Lets talk about proxying. In python, proxies are weak references, which means that they don't increase reference count of an object, which is exactly what we need. #let me show this time the console output too class stuff(object): def __del__(self): print "del" >>> from weakref import proxy >>> a = stuff() #newly created object >>> b = proxy(a) #create weak reference to the new object (note that the weak reference object is also an object that stores the weak reference) >>> b #what is b? <weakproxy at 02DB0F60 to stuff at 02DBFB50> # b is a weakproxy object that refers to a which is a "stuff object" >>> del b # what if we delete b? # no "del" message, the stuff object is not deleted, because its reference count is still 1, because its stored in a >>> b = proxy(a) # lets recreate b >>> del a # now we delete the only one reference of the stuff object del # and here we go, we got the del message from __del__ >>> b # okay but whats up with b? <weakproxy at 02DB0F60 to NoneType at 7C2DFB7C> # because b is a weakproxy object, it won't be deleted out of nowhere, but it refers to a NoneType right now, because the stuff object is deleted (also note here that NoneType is also a python object :D) >>> if b: #what if I want to use b? ... print "a" ... Traceback (most recent call last): File "<stdin>", line 1, in <module> ReferenceError: weakly-referenced object no longer exists # in normal cases no need to trycatch this exception, because if we do everything right, we will never run into a deleted weakly-referenced object But how do we proxy something like self.doNothing? Actually, what is self.doNothing? self.doNothing has 3 parts: The first part is not that obvious, it has a base class pointer, which is points to myBoard. It has a class object pointer, that is basically "self". It refers to the current instance of myBoard. It has a function object pointer, called doNothing, which is located inside the myBoard class. And now we can understand ymir's ui.__mem_func__ class, which is exactly meant to be used for proxying class member functions: # allow me to reverse the order of the definitions inside the __mem_func__ so it will be more understandable class __mem_func__: def __init__(self, mfunc): #this happens when we write ui.__mem_func__(self.doSomething) if mfunc.im_func.func_code.co_argcount>1: # if the doSomething takes more than one argument (which is not the case right now, because it only needs the class obj pointer (which is the 'self' in the 'self.doSomething')) self.call=__mem_func__.__arg_call__(mfunc.im_class, mfunc.im_self, mfunc.im_func) #lets unfold the python object to the mentioned 3 parts else: self.call=__mem_func__.__noarg_call__(mfunc.im_class, mfunc.im_self, mfunc.im_func) #this will be called for the 'self.doSomething' def __call__(self, *arg): # this line runs whenever we call apply(storedfunc, args) or storedfunc() return self.call(*arg) class __noarg_call__: # this class is used whever the python object we want to proxy only takes one argument def __init__(self, cls, obj, func): self.cls=cls # this one I don't really get, we won't need the class object later also its not proxied, so its probably here to prevent delete the base class in rare cases self.obj=proxy(obj) # here we proxy the object pointer which is what really matters self.func=proxy(func) # and then we proxy the class func pointer def __call__(self, *arg): return self.func(self.obj) # here we just simply call the class function with the object pointer class __arg_call__: def __init__(self, cls, obj, func): self.cls=cls self.obj=proxy(obj) self.func=proxy(func) def __call__(self, *arg): return self.func(self.obj, *arg) # here we just simply call the class function with the object pointer and additional arguments Pros, cons, when to, when not to, why? Now you may ask that "Okay okay that sounds good, but why? What can this cause, how big the impact could be, is it worth to even bother with it?" First of all, you must understand that this is kinda equal to a memory leak. I would actually call these non-deleted windows as "leaking windows". Every time you warp, new and new instances will be generated from those objects, and ofc, one instance of a window means like about +50/100 instances, depending on the window complexity, how much childs it has. Usually these windows are at least remain in a Hide state, and hidden windows don't affect update and render time, but they will remain in the root layer, and may stack up depending on how much time the player warp. Still, the number of leaking root windows / warp is around 50-100, which is really not much for a linked list (the type of the childList). However, the memory consumption is much greater. One year ago AE had 10k leaking windows growth / warp. One base class (CWindow)'s size is 140 bytes, which means the memory growth is at least 1,3MB/warp and it does not contain the size of the python objects size for those windows, the linked_list headers and other necessary stuffs. After some hour of playing this can easily reach 100+MB of leaking memory. On worse cases the old windows are not even hidden, and on rewarp players may see multiple instances of the mentioned windows, like double inventory, double messenger window, etc. In this cases those windows can affect the render and update times too. Pros: your code will now work correctly regarding to this topic you may gain some performance boost you may find stuff in your client that even you don't know about you may find enough kebab for a whole week you can save kittens by removing leaking windows and proxying objects you can build my respect towards you and your code and you can even calculate the actual number using the following formula: totalRespect = proxysUsed * 2 + ui.__mem_func__sUsed - proxysMisused * 3.511769 - ui.__mem_func__sMisused * pi - 666 * ui.__mem_func__sNotUsed Cons: depending on how bad the situation is and how skilled you are, the time needed to find and fix everything could be vary, from few hours to several days if you are satisfied with your client as it is right now there is not that huge benefit regarding how much time it could take to fix all the windows Detecting leaking windows DON'T BLOCK THE BACKEND!! At first glance python code looks like you are invincible, you can do whatever you want, you are not responsible for the performance because python has a bottomless bucket full of update/render time and if the game freeze sometimes its definitely not your fault, the game is just BAD. Lets talk about OnUpdate and OnRender, whats the difference, when they are called, what to and what not to put in there. So as their name implies, they are called from the binary every time it performs an Update or Render action. In Update, the binary performs non-rendering actions, like updating the positions of walking characters, updating window positions, and every kind of calculation that is necessary for a render action, to make every kind of data up to date, reducing the cpu operations required for render as much as possible while keeping track of the time. In Render, the binary performs non-updating actions, calling only directx device rendering methods that builds up a picture of the current world, including the UI, using the current, up to date positions. If you try to count the number of stars in our galaxy to accurately simulate your star wars going on in the background of your inventory window, no matter where you do it, (render or update) you will start hurting the game. For example if you have an ui with tons of elements, generating all the elements under one tick can cause HUGE client lag. In my AE wiki, I only load one or two entity for the current page under an update tick, so it will still load quickly, but won't block the game. Notice that doing something like this is an UPDATE operation. Lets be nice and don't interrupt our rendering whit this kind of stuff. You should only use calls to render functions inside the OnRender, for example like in the ui.ListBox class, where we actually ask the binary to render a bar into our screen. Around 20% of time spent in an Update tick was consumed by the UI update (calling to a python object through the api is kinda slow by default) in the AE client one year ago. Removing the rendering and updating of the gui for testing purposes actually gave a huge boost to the client, so who knows, maybe one day someone will make a great client that runs smooth on low end pcs too. Answer the api calls if expected! Some calls from the binary like OnPressEscapeKey expects a return value. Of course if no return value is provided the binary won't crash, but can lead to weird problems and malfunctions. For example, the OnPressEscapeKey expects non-false (non-null) if the call was successful on the window, so it will stop the iteration from calling to lower level windows. So if you expect from the game to close only one window per esc push, you have to return True (or at least not False or nothing). There was a crash problem related to this in one of my friend's client recently. In his ui.EditLine class the OnPressEscapeKey looked something like this: def OnPressEscapeKey(self): if self.eventEscape(): return True return False In the original version it just return True unrelated to the eventEscape's return value. This looks fine at first glance, but if for some reason the self.eventEscape doesn't return anything and if (like the garbage collector decides to run or its disabled) the layer's or the parent's child lists changes in the binary because one or more windows are destroyed under the OnPressEscapeKey procedure and the iteration trough the child list is not interrupted, the binary will start to call invalid addresses thinking that they are existing windows, calling OnPressEscapeKey on them, resulting hardly backtraceable crashes. Closing words I can't highlight out enough times how much I like and enjoy creating new kind of UI stuff, (like animating windows that you may saw on my profile recently (click for the gif)) and because of this if you want to discuss a theory about new UI stuffs or mechanics of already existing UI stuffs feel free to do it in the comment section instead of writing me a pm to help others. Also this time (unlike for my other topics) I would like to keep this guideline up to date and maybe adding new paragraphs if I find out another common mistake/misunderstanding. DEATH TO ALL LEAKING WINDOW!!!!!4444four
  2. If you change yang limit to long long you will have this problem when u try to read a book https://gyazo.com/dc64a30c0713f887de669cce2bc0db8e char_skill.cpp search: PointChange(POINT_EXP, -need_exp); replace: PointChange(POINT_EXP, -static_cast<long long>(need_exp));
  3. Hello togehter, today i want to share a small, but in my opinion, usefull security upgrade for your player password-hashes. The current default hash, which is used by the most of you (some exeptions might be out there) is the MD5 Hash. This hash might be not the best choice for hashing passwords in this modern days. This is why i thought about something to change there. And my solution for this is Argon2. This Method had won the Password Hashing Competition and this is why i had choosen this over bcrypt or scrypt. This tutorial isn't a 100% beginner firendly guide! Just follow my instructions if you got a little bit of c++ knowledge and know how to work with the source! Create the libargon2 Change the hash inner the game-core source (DEFAULT PASSWORD() MYSQL FUNC TUTORIAL) For now you just need to edit the account.account table and set the size for the password to 128 (Why 128? Db.h EArgon2::HASH_LENGTH = 64. 64 * 2 = 128) And you need to replace your hashes with the argon2 once. For this follow the link to the generation: https://argon2.online Example config for the tutorial setup: Have fun
  4. M: https://i.gyazo.com/d84d73b41414acb3e4570fb9ae7fd049.mp4 F: https://i.gyazo.com/b3ae946b25c4b0f81c6d4dcd1a4b9e29.mp4 GitHub repository: [hide] https://github.com/Vegas007/Metin2-Extended-Alignment-System [/hide] 02.03.2019 - Polymorph bug fixed.
  5. Hello together, today i want to share something with you for christmas. But before we start let me tell you, this system isn't in is final form! I will update this thread (if metin2dev will still exist in the new year) to complete this system. Anyways let's get startet. What kind of System is it? You can use inbuilt animations on objects (map objects) and weapons (currently not working, just if the weapon is a ground item instance! I'm working on it). Here is a preview: https://puu.sh/ERRYB/6db6f3d686.mp4 First you can see a placed object on the map with inbuilt animation (sorry it is really far away :O) Later you can see a weapon (thanks to @Tatsumaru) which has an inbuilt animation. But this is currently just working as ground instance and not in the player hands itself. How to implement it What is missing for now? Currently the deforming for weapons holden by the player won't work. But as i said in the first few lines, i will add it later. But for now i want to give this parts to you for christmas! (Sorry i'm currently out of time to finish it before 2019 ends... Maybe someone of you want to complet it in his on way). The attachments Animated Object: https://mega.nz/#!aJZARAxA!HxxLZLnJs00bmcFTYwL0y0kiIVwsu5Kgph7JQrwtc6M <- Thanks to KillMoves who did this sometime ago!!! (Animated Weapon: https://mega.nz/#!agFgHCYD!X1H-UzB8ByKIAtu_cZT3FWbFrHZSZ5wTQefupICMOWc <- Thanks to Tatsumaru!!! Have fun with it, your B4RC0D3
  6. https://gyazo.com/de48a3486639cc361d5e6a87accc4eff https://mega.nz/file/0I0jXIwT#wqUADWsRgXopBls8vEOq8GLgm4T2cm_GFE9IFho2Ukk https://www.virustotal.com/gui/file/614415eb09f37185eb08b7892e7e3e66f8aa37a8a02f220728dd54875618a985/detection
  7. 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
  8. I am selling a few of my systems here. More will be added from time to time. HWID Bansystem: Captcha System: Item Preview System: PayPal Cash-In Script: mob.get_level() Function with Quest: spawn_mob_in_map() Function with Quest: Refine Choose System Pickup System: Donate via E-Mail: Guildwar Limit System: Exp to long long: GM Restriction System: Better Trade Logs: Payment via PayPal, BTC (-10%) or Amazon Giftcards If you are interested, you can contact me here in the forum.
  9. Hello everybody. I was not planned to offer this for sale neither to release it, but couple of persons were asking for it and since it seems to be stable for a month now it is on a live server, so here it is. As you all know there are some visual problems with the sashes on tall mounts or with the motion of die, with this they are gone forever. Some examples: I am offering the sash scaling+positioning together with character/mob/npc/pet aka world-scaling for 50€ If you need the scaling expanded onto effects too, that is +20€. Implementation + 10€. Discord: dotpngr#3873 Be specific with your message you are sending to me, and at least if you don't speak english well let me know at the beginning, usually I don't reply to the "i need system i pay" kind of messages. Also, my laptop is online 24/7, even when I am not in front of it I am online, this doesn't mean that I am available too.
  10. Hello. Demo: Mega.nz
  11. Hi, This is a item witch can change dragon soul attributes, I made it with subtype but you can easily do it by vnum. Here you have the case for subtype: (If in DragonSoul.h function PutAttributes is on private move it on public.) https://pastebin.com/0cNA0Xtj
  12. Description : The mount will follow you. The bonuses is set from item_proto. https://i.gyazo.com/9dac9deaada344672a153f37575d0b13.mp4 https://i.gyazo.com/05713068360a55cbbe25db6761925030.mp4 https://i.gyazo.com/de7397f26a0b7aeeb66e1b4ce4af5b0d.mp4 Code is based on default pet code from Ymir, i don't offer support for extra features, details, anyway easy for use. (Sorry for tutorial, not so perfect.) Download (Reupload): https://mega.nz/#!1FBggSLK!PD4TNZjBZ1oDwyQ5EjhvqWeyy2zGwDKaH9iUVbjVogw
  13. Hi, folks! With this guide you will be able to combine textlines with images, like rubinum does. Usage is simple: emojiTextLine.SetText("|Eemoji/key_ctrl|e + |Eemoji/key_x|e + |Eemoji/key_rclick|e - Direct sell") The files are located in the icon pack, so basically the code will load from icon/{GIVEN_PATH}.tga - in the sample the path for the X is: icon/emoji/key_x.tga Here are the images from rubinum client:  Howto: Have fun Sorry for arab players , for sure they have also developers, so let's go guys, finish it If you have problem, maybe I made a mistake in the guide of missed out something, just leave a comment below. PS.: Sometimes the code tag of the board puts an extra invisible character mostly the end of the lines, if your IDE cries for syntax error, but it seems correct, check that part of the file with notepad++, it will show a ?(question mark) where the problem is.
  14. Hello. Here is function for level 20 when create guild. Guild.cpp Search Search "VALUES('%s', %u, 1000, 1, 0, 0, '\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0')", Change with "VALUES('%s', %u, 1000, 20, 0, 0, '\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0')", Search m_data.level = 0; Change with m_data.level = 20; Thanks to @Vanilla for ladder point fix Guild_war.cpp if (test_server || quest::CQuestManager::instance().GetEventFlag("guild_war_test") != 0) return GetLadderPoint() > 0;
  15. Hello M2Dev, Battle Pass (9.06.2019) Description: (Click) Lucky Box - My version inspired from official servers 19.1 Update. (9.06.2019) Description: (Click) CONTACT: ● DISCORD: ZeNu#9145 ● SKYPE: devil.devil997 ● Private Message
  16. https://github.com/blackdragonx61/Metin2-Shop-Average-Price
  17. First u need the IsLowGM function. //char.cpp add under BOOL CHARACTER::IsGM() const this BOOL CHARACTER::IsLowGM() const { return m_pointsInstant.gm_level > GM_PLAYER && m_pointsInstant.gm_level > GM_HIGH_WIZARD && m_pointsInstant.gm_level < GM_IMPLEMENTOR; } //char.h add under BOOL IsGM() const; this BOOL IsLowGM() const; now let's restrict some actions for GM //char.cpp void CHARACTER::PartyInvite(LPCHARACTER pchInvitee) add under else if (pchInvitee->IsBlockMode(BLOCK_PARTY_INVITE)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<ÆÄƼ> %s ´ÔÀÌ ÆÄƼ °ÅºÎ »óÅÂÀÔ´Ï´Ù."), pchInvitee->GetName()); return; } this else if (IsLowGM() == true && pchInvitee->IsLowGM() == false) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Party> You cannot send a party invitation to a player!")); return; } else if (IsLowGM() == false && pchInvitee->IsLowGM() == true) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Party> You cannot send a party invitation to a GameMaster!")); return; } void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE bItemCount) add if (IsLowGM()) { ChatPacket(CHAT_TYPE_INFO, "You can't open shop! You are GM!"); return; } //end char.cpp //exchange.cpp bool CHARACTER::ExchangeStart(LPCHARACTER victim) add if (!IsLowGM() && victim->IsLowGM()) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot trade items with a Game Master.")); return false; } if (IsLowGM() && !victim->IsLowGM()) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Game Masters cannot trade items with players.")); return false; } //end exchange.cpp //shop_manager.cpp void CShopManager::Buy(LPCHARACTER ch, BYTE pos) add if (ch->IsLowGM() && pkShop->IsPCShop()) { ch->ChatPacket(CHAT_TYPE_INFO, "GameMasters cannot buy items from players' shops."); return; } //end shop_manager.cpp and for offlineshop //offlineshop_manager.cpp void COfflineShopManager::Buy(LPCHARACTER ch, BYTE pos) add if (ch->IsLowGM()) { ch->ChatPacket(CHAT_TYPE_INFO, "GameMasters cannot buy items from players' shops."); return; } //end offlineshop_manager.cpp GL
  18. Open Service.h //add: #define ENABLE_GAMEMASTER_RESTRICTION open exchange.cpp // Search: if (victim->IsBlockMode(BLOCK_EXCHANGE)) // add: #ifdef ENABLE_GAMEMASTER_RESTRICTION if (!IsGM()) { if (victim->GetGMLevel() != GM_PLAYER) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't trade a Game Master")); return false; } } if (IsGM()) { char szQuery[QUERY_MAX_LEN]; snprintf(szQuery, sizeof(szQuery), "SELECT * FROM gamemaster_restriction"); SQLMsg * pMsg = DBManager::instance().DirectQuery(szQuery); SQLResult * pRes = pMsg->Get(); if (pRes->uiNumRows) { MYSQL_ROW row; while ((row = mysql_fetch_row(pRes->pSQLResult))) { DWORD datos = 0; str_to_number(datos, row[0]); if (GetPlayerID()==datos) { ChatPacket(CHAT_TYPE_INFO, "You don't have permission to do this"); return false; } } } } #endif open char_item.cpp //search: bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount) //add: #ifdef ENABLE_GAMEMASTER_RESTRICTION if (IsGM()) { char szQuery[QUERY_MAX_LEN]; snprintf(szQuery, sizeof(szQuery), "SELECT * FROM gamemaster_restriction"); SQLMsg * pMsg = DBManager::instance().DirectQuery(szQuery); SQLResult * pRes = pMsg->Get(); if (pRes->uiNumRows) { MYSQL_ROW row; while ((row = mysql_fetch_row(pRes->pSQLResult))) { DWORD datos = 0; str_to_number(datos, row[0]); if (GetPlayerID()==datos) { ChatPacket(CHAT_TYPE_INFO, "You don't have permission to do this"); return false; } } } } #endif open cmd_general.cpp //Search: ACMD(do_click_safebox) // add: #ifdef ENABLE_GAMEMASTER_RESTRICTION if (ch->IsGM()) { char szQuery[QUERY_MAX_LEN]; snprintf(szQuery, sizeof(szQuery), "SELECT * FROM gamemaster_restriction"); SQLMsg * pMsg = DBManager::instance().DirectQuery(szQuery); SQLResult * pRes = pMsg->Get(); if (pRes->uiNumRows) { MYSQL_ROW row; while ((row = mysql_fetch_row(pRes->pSQLResult))) { DWORD datos = 0; str_to_number(datos, row[0]); if (ch->GetPlayerID()==datos) { ch->ChatPacket(CHAT_TYPE_INFO, "You don't have permission to do this"); return; } } } } #endif add player sql. SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for gamemaster_restriction -- ---------------------------- DROP TABLE IF EXISTS `gamemaster_restriction`; CREATE TABLE `gamemaster_restriction` ( `gamemaster` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '', PRIMARY KEY (`gamemaster`) USING BTREE ) ENGINE = MyISAM CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1; Someone is selling this for money and our friend Itachi made it free. Say ty to@Itachi Hellow again, thanks to @Vanilla for code improve Open Service.h //add: #define ENABLE_GAMEMASTER_RESTRICTION open exchange.cpp // Search: if (victim->IsBlockMode(BLOCK_EXCHANGE)) // add: #ifdef ENABLE_GAMEMASTER_RESTRICTION if (!IsGM()) { if (!test_server && victim->GetGMLevel() != GM_PLAYER) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't trade with a Game Master")); return false; } } if (!test_server && IsGM()) { std::unique_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT * FROM gamemaster_restriction")); SQLResult * pRes = pMsg->Get(); if (pRes->uiNumRows) { MYSQL_ROW row; while ((row = mysql_fetch_row(pRes->pSQLResult))) { DWORD datos = 0; str_to_number(datos, row[0]); if (GetPlayerID()==datos) { ChatPacket(CHAT_TYPE_INFO, "You don't have permission to do this"); return false; } } } } #endif open char_item.cpp //search: bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount) //add: #ifdef ENABLE_GAMEMASTER_RESTRICTION if (!test_server && IsGM()) { std::unique_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT * FROM gamemaster_restriction")); SQLResult * pRes = pMsg->Get(); if (pRes->uiNumRows) { MYSQL_ROW row; while ((row = mysql_fetch_row(pRes->pSQLResult))) { DWORD datos = 0; str_to_number(datos, row[0]); if (GetPlayerID()==datos) { ChatPacket(CHAT_TYPE_INFO, "You don't have permission to do this"); return false; } } } } #endif open cmd_general.cpp //Search: ACMD(do_click_safebox) // add: #ifdef ENABLE_GAMEMASTER_RESTRICTION if (!test_server && ch->IsGM()) { std::unique_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT * FROM gamemaster_restriction")); SQLResult * pRes = pMsg->Get(); if (pRes->uiNumRows) { MYSQL_ROW row; while ((row = mysql_fetch_row(pRes->pSQLResult))) { DWORD datos = 0; str_to_number(datos, row[0]); if (ch->GetPlayerID()==datos) { ch->ChatPacket(CHAT_TYPE_INFO, "You don't have permission to do this"); return; } } } } #endif add player sql. SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for gamemaster_restriction -- ---------------------------- DROP TABLE IF EXISTS `gamemaster_restriction`; CREATE TABLE `gamemaster_restriction` ( `gamemaster` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', PRIMARY KEY (`gamemaster`) USING BTREE ) ENGINE = MyISAM CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1; [/CODE]
  19. Hi everyone. The time has come, and sorry for this late. What is this? Check the base version on this video: Necessary functions: It doesn't hurt to know: Need a bit of knowledge of programming, especially for implementing the python parts. You need to see the whole python core of metin2 how it works to understand what, why and how. Regarding to 1. and 2. this release is not for beginners. It has been tested on test and a live server too, small problems what appeared has been fixed. MouseWheel is not included, but public on the internet. Special thank to @masodikbela for testing and @Tatsumaru for the gui elements(wider tab buttons). Download PS.: If I missed something out from the guide feel free to let me know.
  20. https://gyazo.com/d58a16ea48b8d5532190276bbb807b2f https://gyazo.com/9ba901b49cd5c757a7c18f63e691aeca https://mega.nz/file/oI8RnSaB#IZTOgVCuQyCjU_SoIyUqiK7EHnw-R9HLxMuhaf5NVo4 VT: https://www.virustotal.com/gui/file/6367dc5bc7065a5784da5054e8ecc281615032343eaa4a36d99ac13eec280349/detection This is the link for the main topic:
  21. When hovering over a skill, it's recharge duration in tooltip is always the same because it ignores player's casting speed. In PythonSkill.cpp search for : DWORD CPythonSkill::SSkillData::GetSkillCoolTime(float fSkillPoint) Replace with: DWORD CPythonSkill::SSkillData::GetSkillCoolTime(float fSkillPoint) { if (strCoolTimeFormula.empty()) return 0; CPoly poly; poly.SetStr(strCoolTimeFormula.c_str()); /* Apply casting speed when calculating the formula */ int iCastingSpeed = CPythonPlayer::Instance().GetStatus(POINT_CASTING_SPEED); int iSkillCoolTime = ProcessFormula(&poly, fSkillPoint); int i = 100 - iCastingSpeed; if (i > 0) i = 100 + i; else if (i < 0) i = 10000 / (100 - i); else i = 100; return DWORD(iSkillCoolTime * i / 100); }
  22. As you well know, when you have many entities or players your fps decrease too much. I found a solution for this. PRO: Increasing fps with 30+ VERSUS: The names of entites and players doesn't have anymore shadow. Left boosted client, right client not boosted. Advice: You can use it on define and when you finished the building can comment and make a new release like Metin2NameClientFPSBoost and a normal Release client (That's my option if you want to use this) I know for high developers this is sh*t but maybe some peoples doesn't know about this. Search pTextInstance->SetOutline(false); Replace pTextInstance->SetOutline(true); Search prGuildNameInstance->SetOutline(false); Replace prGuildNameInstance->SetOutline(false); Search pTextTail->pTextInstance->SetOutline(false); Replace pTextTail->pTextInstance->SetOutline(true); Search pTextTail->pTextInstance->SetOutline(false); Replace pTextTail->pTextInstance->SetOutline(true); Search prTitleNameInstance->SetOutline(true); Replace prTitleNameInstance->SetOutline(false); Search prTitle->SetOutline(false); Replace prTitle->SetOutline(true); Search prUserTitle->SetOutline(true); Replace prUserTitle->SetOutline(false);
  23. Hi,devs~ I have a error· I changed the database, player table name field is gb2312, epk also USES locale_newcibn, but, I created the character, the name USES simplified Chinese, he reported an error! This is syserr of DB: SYSERR: Jul 4 00:24:48 :: DirectQuery: AsyncSQL::DirectQuery : mysql_query error: Column 'name' cannot be null query: INSERT INTO player (id, account_id, name, level, st, ht, dx, iq, job, voice, dir, x, y, z, hp, mp, random_hp, random_sp, stat_point, stamina, part_base, part_main, part_hair, part_sash, gold, playtime, skill_level, quickslot) VALUES(0, 1, '�ҵ�', 1, 6, 4, 3, 3, 0, 0, 0, 459514, 953855, 0, 760, 260, 0, 0, 0, 800, 0, 0, 0, 0, 0, 0, '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ SYSERR: Jul 4 00:24:48 :: __QUERY_PLAYER_CREATE: QUERY_ERROR: UPDATE player_index SET pid3=0 WHERE id=1 SYSERR: Jul 4 00:24:52 :: DirectQuery: AsyncSQL::DirectQuery : mysql_query error: Column 'name' cannot be null Thank you for your answer! Best wishes to you
  24. Hello Guys! I was so frustated with my syserr floods (%s ĆÄŔĎŔĚ ľř˝Ŕ´Ď´Ů.CItemData::__SetIconImage) when an item has no icon. With this correction the client will only notice you once per item that has no image, and set a default icon for them, so you can drop it to the ground from your inventory, instead of giving attention to make them a new icon, or copy/paste an existing image. Download: blank.tga Again, is not a big deal and my English is bad as always Have a nice day guys!
  25. Cheque system full ~ like official The tutorial was remade and uploaded to github Monetary unit: Won - Not compatible with long long gold - Max won 999 (like official) - Added support for OfflineShop(great) Download: https://github.com/WLsj24/Cheque-System Best regards.
×
×
  • 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.