Jump to content

Gurgarath

Forum Moderator
  • Posts

    345
  • Joined

  • Last visited

  • Days Won

    6
  • Feedback

    100%

Posts posted by Gurgarath

  1. On 11/16/2023 at 5:31 AM, martysama0134 said:
    Spoiler

    I slightly refactored. You can also specify the poly vnum now. (I skipped the ReadMonsterDropItemGroup part)

    Here a patch:

    From c5da3c9abf1608347bb5bec5fae06213c75c1ae9 Mon Sep 17 00:00:00 2001
    From: Marty Sama <martysama0134@users.noreply.github.com>
    Date: Thu, 16 Nov 2023 06:19:28 +0100
    Subject: [PATCH] ENABLE_MOB_DROP_POLY
    
     s3ll_server/Srcs/Server/common/CommonDefines.h     |  1 +
     s3ll_server/Srcs/Server/game/src/char_item.cpp     | 44 ++++++++++++++++++----
     s3ll_server/Srcs/Server/game/src/item_manager.h    |  7 +++-
     .../Server/game/src/item_manager_read_tables.cpp   | 10 ++++-
     4 files changed, 50 insertions(+), 12 deletions(-)
    
    diff --git a/s3ll_server/Srcs/Server/common/CommonDefines.h b/s3ll_server/Srcs/Server/common/CommonDefines.h
    index e7bc400c..33b05884 100644
    --- a/s3ll_server/Srcs/Server/common/CommonDefines.h
    +++ b/s3ll_server/Srcs/Server/common/CommonDefines.h
    @@ -91,6 +91,7 @@ enum eCommonDefines {
     ...
     ...
     ...
    +#define ENABLE_MOB_DROP_POLY // enable drop type 'poly' for special_item_group.txt (idx drop mobvnum pct customitemvnum)
     ...
     ...
     ...
    diff --git a/s3ll_server/Srcs/Server/game/src/char_item.cpp b/s3ll_server/Srcs/Server/game/src/char_item.cpp
    index 1900b5c4..a9631838 100644
    --- a/s3ll_server/Srcs/Server/game/src/char_item.cpp
    +++ b/s3ll_server/Srcs/Server/game/src/char_item.cpp
    @@ -2023,11 +2023,16 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
     								case CSpecialItemGroup::POISON:
     									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
     									break;
     								#ifdef ENABLE_WOLFMAN_CHARACTER
     								case CSpecialItemGroup::BLEEDING:
     									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
     									break;
     								#endif
    +								#ifdef ENABLE_MOB_DROP_POLY
    +								case CSpecialItemGroup::POLY:
    +									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
    +									break;
    +								#endif
     								case CSpecialItemGroup::MOB_GROUP:
     									ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
     									break;
    @@ -2107,11 +2112,16 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
     						case CSpecialItemGroup::POISON:
     							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
     							break;
     						#ifdef ENABLE_WOLFMAN_CHARACTER
     						case CSpecialItemGroup::BLEEDING:
     							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
     							break;
     						#endif
    +						#ifdef ENABLE_MOB_DROP_POLY
    +						case CSpecialItemGroup::POLY:
    +							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
    +							break;
    +						#endif
     						case CSpecialItemGroup::MOB_GROUP:
     							ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
     							break;
    @@ -3728,11 +3738,16 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
     											case CSpecialItemGroup::POISON:
     												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
     												break;
     											#ifdef ENABLE_WOLFMAN_CHARACTER
     											case CSpecialItemGroup::BLEEDING:
     												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ³ª¿Â ³ì»ö ¿¬±â¸¦ µéÀ̸¶½ÃÀÚ µ¶ÀÌ ¿Â¸öÀ¸·Î ÆÛÁý´Ï´Ù!"));
     												break;
     											#endif
    +											#ifdef ENABLE_MOB_DROP_POLY
    +											case CSpecialItemGroup::POLY:
    +												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
    +												break;
    +											#endif
     											case CSpecialItemGroup::MOB_GROUP:
     												ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»óÀÚ¿¡¼­ ¸ó½ºÅÍ°¡ ³ªÅ¸³µ½À´Ï´Ù!"));
     												break;
    @@ -7386,14 +7401,27 @@ bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD
     					bSuccess = true;
     				}
     				break;
     			#ifdef ENABLE_WOLFMAN_CHARACTER
     			case CSpecialItemGroup::BLEEDING:
     				{
     					AttackedByBleeding(nullptr);
     					bSuccess = true;
     				}
     				break;
     			#endif
    +			#ifdef ENABLE_MOB_DROP_POLY
    +			case CSpecialItemGroup::POLY:
    +				{
    +					const auto polyVnum = iRarePct ? iRarePct : 70104;
    +					item_get = AutoGiveItem(polyVnum, 1, 0);
    +					if (item_get)
    +					{
    +						item_get->SetSocket(0, dwCount);
    +						bSuccess = true;
    +					}
    +				}
    +				break;
    +			#endif
     			case CSpecialItemGroup::MOB_GROUP:
     				{
     					const int sx = GetX() - number(300, 500);
    diff --git a/s3ll_server/Srcs/Server/game/src/item_manager.h b/s3ll_server/Srcs/Server/game/src/item_manager.h
    index 0c1e19ec..d8e604b9 100644
    --- a/s3ll_server/Srcs/Server/game/src/item_manager.h
    +++ b/s3ll_server/Srcs/Server/game/src/item_manager.h
    @@ -39,9 +39,12 @@ class CSpecialItemGroup
     			DRAIN_HP,
     			POISON,
     			MOB_GROUP,
     			#ifdef ENABLE_WOLFMAN_CHARACTER
     			BLEEDING,
     			#endif
    +			#ifdef ENABLE_MOB_DROP_POLY
    +			POLY,
    +			#endif
     		};
    
     		enum ESIGType { NORMAL, PCT, QUEST, SPECIAL };
    diff --git a/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp b/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp
    index 2a921bfb..d7c67863 100644
    --- a/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp
    +++ b/s3ll_server/Srcs/Server/game/src/item_manager_read_tables.cpp
    @@ -239,12 +239,18 @@ bool ITEM_MANAGER::ReadSpecialDropItemFile(const char * c_pszFileName)
     						{
     							dwVnum = CSpecialItemGroup::POISON;
     						}
     						#ifdef ENABLE_WOLFMAN_CHARACTER
     						else if (name == "bleeding")
     						{
     							dwVnum = CSpecialItemGroup::BLEEDING;
     						}
     						#endif
    +						#ifdef ENABLE_MOB_DROP_POLY
    +						else if (name == "poly")
    +						{
    +							dwVnum = CSpecialItemGroup::POLY;
    +						}
    +						#endif
     						else if (name == "group")
     						{
     							dwVnum = CSpecialItemGroup::MOB_GROUP;

     

     

    Result:

    QNsV1vH.png

    LlmKLs2.png

    1a6lKuP.png

     

    Good patch, thank you! The only reason I didn't do it this way is that I don't think people use the other polymorph marbles so I kept it simple. I personally do, but not like this, so I simply created a small helper function that I call to determine the adequate vnum. However, AutoGiveItem is better!

    uint32_t CHARACTER::GetAdequatePolymorphMarbleVnum(uint32_t dwMobVnum)
  2. Hello, thank you for your release but it is not a good or complete solution. Let me explain:

    • It is better to not do "price * 1" as "price * 1" is simply equal to "price".
      • pack2.items[i].price = item.price;
    • In that case, both cases of the if are equal, you can then simply remove the following check and replace it with the code above.
      • if (bOtherEmpire)
            pack2.items[i].price = item.price * 3;
        else
            pack2.items[i].price = item.price;
    • Also, in shop.cpp you must remove the following piece of code for the change to be complete:
      • if (it->second) // if other empire, price is triple
            dwPrice *= 3;
        

     

    • Metin2 Dev 1
    • Love 1
  3. 13 hours ago, Intel said:

    That fix really perplexes me. In a server I am working, there was this "cannot find tree" problem when warping and instantly moving and I know, for sure, there are no maps with wrong coordinates or wrong accumulation data. In my server, instead, I never had this issue (we even have a mount way faster than the elephant skin), until we worked on the sync position stuff and I fixed it like this:

    .png

    (notice the commit message as well lol)

    Mine or Trial's? I didn't try Trial's, but about mine it's just related to a common game issue in which sometimes mounts without folders (or with wrong data) will not register your motion when walking and will only calculate it later on or on when idling (you can check that using /state while you move for example and notice that your coordinates don't move). It might actually be the cause of what you fixed in your screenshot, at least the symptoms looks similar!

  4. Hello folks,

    This is not 100% official (because how could we know?) but on the official, you can obtain Polymorph Marbles of certain monsters when opening specific chests.

    If we do it by giving a Polymorph Marble, the marble won't polymorph you at all as it won't contain a mob vnum to polymorph you into. So here is a way to do it.

    This is the hidden content, please

    Have a nice day! 😄

     

    • Metin2 Dev 118
    • Eyes 1
    • Lmao 1
    • Good 23
    • Love 2
    • Love 42
  5. Quote

    In char_item.cpp I want to change the values of refine scrolls, etc. For example, Dragon scroll ingame says +10% success rate, but I don't see any trace of this in the source file. I guess the blacksmith handbook could be similar. Now I can't really get along with these items called CHUKBOK etc.

    Because they don't, they have hardcoded values. You can see a list of values that represents the percentage from +0 to +9. You must get rid of that to give a +10% increase from the usual refine value

  6. Thank you for share!

    BYTE dir = (int) lua_tonumber(L, 4);

    I legit sighed. This is exactly what I said on the Discord two days ago, some types and some castings doesn't make a single sense at all. They will assign a BYTE for directions and other important stuff (causing this kind of issue or simply hard future-proof code) while casually assigning a DWORD and other way too big types for a single constant, let's say guild levels or the amount guild members

    • kekw 2
    • Cry 1
    • Good 1
  7. 33 minutes ago, Filachilla said:

     

    FXAA is giving me font problems, the text is then not easy to read.. Using SMAA and idk but I never got your problems.. 


    @blaxisMaybe for the same reason no one wants to post a dx9 fix.. The second thing may be that not everyone is interested in this.

    Font problems are most likely due to external aka injected FXAA, which works with the depth buffer and if you use the default font handling, you will understand why it is giving font issues, the thing has to be built from the ground up. You might use MSAA instead of SMAA and the issues I quoted (except depth buffer) are probably linked to my own implementation, but I ended up fixing these issues.

    DX9 has already been published on this very website in 2015 with just an issue or two with minimap and ground textures. It's just that most people slept on it for a good 7 years before it started to reappear here and there. The main issue is that it requires many changes and it's usually better to either publish it all (with no support) or install it for people (which prompts it to be sold)

    • Good 1
  8. I used to work on that a year or two ago (preview in spoiler) when I focused on overall look. Honestly it is good to keep it as is, but MSAA has two issues. First thing, it messes with depth buffer, which makes any external shaders working on top of it to fail. Second thing, it outlines small flaws that used to be invisible or hardly noticeable when it was aliased, namely the lines on the ground that separates chunks and the taskbar / tooltip background, which appears with a gap. This creates a bit of additional work if you want to fix it (and you would most likely want). I think the most performance friendly and overall result would be to use SMAA with or without FXAA.

     

    Spoiler

    unknown.png?ex=65301395&is=651d9e95&hm=a

     

     

    • Good 2
  9. 1 hour ago, SCOOB said:

    For me it's working fine without folder in mob proto.. No lag at all (see gifs above) and no other syncing problems. I even tested with /state, everything is updating as it should.

     

    But I tried with your way too.

    If I put in folder, the lag is back.. and oh boy it's noticeable. I made sure that the "npc_folder_name" is both in server and client.

     

    And even if it was a difference of (x+5,y+7) between clients, while mounting---when you attack the syncing happens again and it fixes that, just like in the bug with autoattack desync.

    (this one: https://youtu.be/ddKPxvnR-NI?si=Tb4YRc4gUACBn4-M )

    This is really, really weird as "my way" is basically the intended way and the way the game has been running on for years. I myself solved all the sync and lag problems with a properly populated and correct server data, while I had these issues when it wasn't properly populated (empty, inccorect or wrong accumulation data).

    If having nothing works for you, I guess you are better off this way as this is also less stuff to think about!

  10. 11 hours ago, Draveniou1 said:

    Sorry i can't test for lycan

    for me working 100% without bug or problems 

    please check up thanks brothers

    my server not have lycan i not have test with lycan

    Understand that it has nothing to do with the Lycan. Check my post and Trial's to see that this is unrelated with Lycan. Syreldar clearly summed up what I said in my post in 3 lines.

    4 hours ago, WeedHex said:

    It just return a default value, no "undefined behavior".

    The default value on some mounts create this issue with the TP check, and I don't feel comfortable with the server having default values when some monsters have specific accumulation values. It makes every server check mismatching with the client (you see a monster on (X, Y) coordinate while for the server it is at (X-10, Y+20) for example). This is what I meant by "undefined behavior". The game is intended to be populated with data matching the client.

    12 hours ago, DemOnJR said:

    I am glad it helped 😄

     

    • Good 1
  11. Hello,

    I am not convinced by any of these fixes. Removing folders and mob_proto data will cause undefined behavior when it comes to server checks and PVE scenario. Calling "UpdateSectree" at every of your movement tick when riding a mount is the best way of making your server use way more resources than it should, for instance, use a ChatPacket to see how often Move() is called, now imagine that for UpdateSectree.

    I personally got rid of every of my issues like this (and I think it is a good read):

    And on the one hand, Trial's post is also really interesting and it is a good idea to add his solution as well.

     

  12. Hello,

    Not really, there are many guides on the forum, there is also a wiki but this is mostly for advanced users. There are beginner tutorials here, of course, but that is something that was kinda left out in the grand scheme of things as this forum is intended for more advanced users and we most likely all learned by fiddling stuff.

    You can always write guides yourself, we will appreciate that, even more if the thing is simple but not written out but you can of course always ask on support if you don't find something and the community will help you out.

    https://metin2.dev/forum/110-basic-tutorials-beginners/

     

  13. 21 hours ago, Hornet said:

    i have same problem, but for dump_proto when i try to compile it!

    error C2146: syntax error : missing ';' before identifier 'T'
    _src\client\gamelib\../eterBase/Utils.h(223): error C2146: syntax error : missing ';' before identifier 'LinearInterpolation'
    _src\client\gamelib\../eterBase/Utils.h(223): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    _src\client\gamelib\../eterBase/Utils.h(223): error C2143: syntax error : missing ',' before '&'
    _src\client\gamelib\../eterBase/Utils.h(226): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    _src\client\gamelib\../eterBase/Utils.h(229): error C2146: syntax error : missing ';' before identifier 'T'
    src\client\gamelib\../eterBase/Utils.h(229): error C2146: syntax error : missing ';' before identifier 'HermiteInterpolation'
    _src\client\gamelib\../eterBase/Utils.h(229): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    _src\client\gamelib\../eterBase/Utils.h(229): error C2143: syntax error : missing ',' before '&'
    _src\client\gamelib\../eterBase/Utils.h(234): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

     

     

    Utils.h

    #include "../UserInterface/Locale_inc.h"
    #ifdef ENABLE_MAP_OBJECT_OPTIMIZATION
    template<typename T>
    constexpr T LinearInterpolation(const T& tMin, const T& tMax, float fRatio)
    {
        return T((1.0f - fRatio) * tMin + fRatio * tMax);
    }

    template<typename T>
    constexpr T HermiteInterpolation(const T& tMin, const T& tMax, float fRatio)
    {
        fRatio = MINMAX(0.0f, fRatio, 1.0f);
        fRatio = fRatio * fRatio * (3.0f - 2.0f * fRatio);
        return LinearInterpolation(tMin, tMax, fRatio);
    }
    #endif

    You quoted the solution to tell me the problem. Update your sources, simple as, use C++14/17>

  14. Hey, please keep it civil, first and only warning. It doesn't matter if you have this bug or not, I don't have it, people have it, it must be because of things that has been changed in some sources and not on others, or things you added that tempered with it unintentionally, but it's no big deal.

    If you have this bug, use this fix and report for any issue, if you don't, then just leave a like because he shared something good.

    Thank you for your release, it will surely help many people.

    • Metin2 Dev 1
    • Confused 1
    • Good 1
    • Love 1
  15. 24 minutes ago, TMP4 said:

    and it's called free market.

    If we go into this, it is "abuse of a dominant position", it is when someone in a situation of monopoly, or of close monopoly in a field abuses of it to favor its other brand. For example, as Mali said, Google has been fined, Amazon too as Asikoo said, but Microsoft too, for example with "Media Player"; that is why we don't have it shipped completely anymore and that is also why they created a special Microsoft version for the European Market. On a side funny note (I am kinda joking though), it creates the same issue as in communism, except this time, it's the corporation that controls a branch of the market instead of the state 😸

    About private servers, I do not know who owns who, but an independent, uncheatable topsite is what we need. That's for the greater good of everyone (and that's called free market)

    • Metin2 Dev 1
×
×
  • 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.