Jump to content

[Fix] WEAR_SHIELD and WEAR_UNIQUE swap


Recommended Posts

  • Active+ Member

Hi, this is one of the oldest and easiest bug to fix in Metin2. It is already fixed in the official files, but for older sources here is the solution.
The problem is that WEAR_SHIELD and WEAR_UNIQUE are swapped. Shields use WEAR_UNIQUE and unique items use WEAR_SHIELD.
 

To fix it:

1.
In ProtoReader.cpp (db source), search for:

int get_Item_WearFlag_Value(string inputString)

Inside this function look for the array arWearrFlag[]. It will look like this:

string arWearrFlag[] = {"WEAR_BODY", "WEAR_HEAD", "WEAR_FOOTS", "WEAR_WRIST", "WEAR_WEAPON", "WEAR_NECK", "WEAR_EAR", "WEAR_SHIELD", "WEAR_UNIQUE", "WEAR_ARROW", "WEAR_HAIR", "WEAR_ABILITY"};

Swap "WEAR_SHIELD" and "WEAR_UNIQUE" like this:

string arWearrFlag[] = {"WEAR_BODY", "WEAR_HEAD", "WEAR_FOOTS", "WEAR_WRIST", "WEAR_WEAPON", "WEAR_NECK", "WEAR_EAR", "WEAR_UNIQUE", "WEAR_SHIELD", "WEAR_ARROW", "WEAR_HAIR", "WEAR_ABILITY"};

2.
In ItemCSVReader.cpp (dump_proto source), search again for:

int get_Item_WearFlag_Value(string inputString)

Inside this function look for the array arWearrFlag[]. It will look like this:

string arWearrFlag[] = {"WEAR_BODY", "WEAR_HEAD", "WEAR_FOOTS", "WEAR_WRIST", "WEAR_WEAPON", "WEAR_NECK", "WEAR_EAR", "WEAR_SHIELD", "WEAR_UNIQUE", "WEAR_ARROW", "WEAR_HAIR", "WEAR_ABILITY"};

Swap "WEAR_SHIELD" and "WEAR_UNIQUE" like this:

string arWearrFlag[] = {"WEAR_BODY", "WEAR_HEAD", "WEAR_FOOTS", "WEAR_WRIST", "WEAR_WEAPON", "WEAR_NECK", "WEAR_EAR", "WEAR_UNIQUE", "WEAR_SHIELD", "WEAR_ARROW", "WEAR_HAIR", "WEAR_ABILITY"};

3.
Finally and THE MOST IMPORTANT, in your ITEM_PROTO you must swap every occurrence of WEAR_SHIELD with WEAR_UNIQUE and WEAR_UNIQUE with WEAR_SHIELD.
After these changes, shields and unique items will use the correct wear flags.

Edited by Eremit2
Link to comment
https://metin2.dev/topic/33979-fix-wear_shield-and-wear_unique-swap/
Share on other sites

So if I use the classic MYSQL protos I need to swap wearflags:

128: "WEAR_SHIELD",
256: "WEAR_UNIQUE",

And also in my convert_test.py which is convert the db protos to client side txt ones.
(If anyone needs it please let me know!)

Thanks for the fix, I will implement to my server tomorrow!

  • muscle 1

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.