aslain.dev
0%
01 Hizmetler 02 Hakkımda 03 Projeler 04 Stack 05 Blog 06 İletişim
← Tüm makaleler Metin2

Metin2 Costume System: Setup and Adding New Costumes

The Metin2 costume system is a feature that has become almost essential on a modern Metin2 server, letting players change the appearance of their armor and weapons while keeping the stats intact. The logic is simple: an item equipped in a dedicated costume slot changes the character's model but grants no bonuses; the real bonuses still come from the underlying armor. In this article we'll walk through how to enable the system server-side, how to configure item_proto, and how to define a brand-new body or weapon costume from scratch.

How the costume system works

Costumes are handled through a separate item type and equipment slot on both client and server. The core building blocks are:

  • Item type: ITEM_COSTUME — costume items are marked with this type instead of regular armor (ITEM_ARMOR).
  • SubType: COSTUME_BODY (body/armor appearance) and COSTUME_WEAPON (weapon appearance). In most sources, hair (COSTUME_HAIR) and mount (COSTUME_MOUNT) subtypes live in the same enum.
  • Equipment slot: the character's equipment window has a dedicated WEAR_COSTUME / WEAR_COSTUME_WEAPON position.

When a player equips a costume, the server reads the appearance value from the costume's value field and notifies nearby players that the model has changed. Bonus calculation is independent of the costume slot, which is why you should not place bonuses in a costume's value fields.

Enabling the system in the server source

In most Metin2 sources the costume system is controlled by a compile flag. Open the relevant define in common/service.h:

// common/service.h
#define ENABLE_COSTUME_SYSTEM

After enabling the define, both game and db (and the client, if you build it) must be recompiled. If your source already ships with costume support, you can skip this step; run grep -r "COSTUME_BODY" common/ to quickly check whether the system already exists.

cd /usr/metin2/server/source
grep -rn "COSTUME_BODY" common/length.h common/item.h

item_proto: defining the costume item

A new body costume is defined almost exactly like a normal armor; the difference lies in the item type and the wear flags. Fill in your SQL row (or the text row, if you compile item_proto.txt) following this logic:

  • type = ITEM_COSTUME
  • subtype = COSTUME_BODY (use COSTUME_WEAPON for weapons)
  • antiflag: if you need a gender/class restriction, add flags like ANTI_MUSA or ANTI_FEMALE — for example, if a model was made only for female characters, mark the male classes as anti.
  • wearflag = WEARABLE_COSTUME — this ensures the item goes into the correct slot.
  • value0 = for a body, the model/shape value the character will take on (corresponding to the .gr2 set number in your client).
  • limittype / limitvalue: for a timed costume, use LIMIT_REAL_TIME with a duration in seconds.

If you add it through the database, an example query looks like this (vnum and name to your own content):

INSERT INTO player.item_proto
  (vnum, name, type, subtype, weapon, wearflag, antiflag, value0)
VALUES
  (85000, 'Costume Armor (Red)', 27, 0, 0, 16384, 0, 101);

Here type=27 corresponds to the ITEM_COSTUME constant in your source, and subtype=0 to COSTUME_BODY. Verify these numeric values against your own item.h — the enum order can differ between versions, so don't assume.

Client side: model and item linking

Even if the server recognizes the item, the costume won't appear without the visual files on the client. What you need:

  • item_proto (client): the same vnum, type and subtype values must also exist in the client pack.
  • item_list.txt: this maps the costume's icon and model path.
  • Model files: for a body costume, the character's .gr2 mesh/motion set; for a weapon costume, the corresponding weapon model, placed inside the pack.

For a body costume, the value0 value determines which character model the client loads, so this value must match exactly between client and server. If it doesn't match, the player equips the costume but the appearance doesn't change, or the wrong model loads.

Testing and common mistakes

After adding the new costume, recompile item_proto (or refresh the DB cache) and test it on your character:

/item 85000

Use the GM command to put the item in your inventory, drag it into the costume slot, and confirm the appearance changes. The most common problems are:

  • Item won't go into the costume slot: wrong wearflag. Check that the correct bit for WEARABLE_COSTUME is set.
  • It equips but the appearance doesn't change: value0 doesn't match the client, or the ENABLE_COSTUME_SYSTEM define is off.
  • It can be worn by the wrong gender: missing antiflag. Add anti flags for classes that have no model.
  • Bonuses don't come from the armor: you accidentally placed bonuses on the costume item; bonuses come from the underlying armor, and the costume should only provide appearance.

Frequently Asked Questions

Does every Metin2 source have a costume system?

Most modern sources ship with it ready, but older "vanilla" sources may need it added manually. You can check quickly by searching for the ITEM_COSTUME and COSTUME_BODY constants in common/item.h.

Can bonuses be added to a costume?

Technically you can enter bonuses in the value fields, but it's not recommended. A costume's purpose is purely appearance; keeping bonuses on the armor is correct both for balance and for player expectations. If you do want a bonus costume, treat it as a separate, deliberate design decision.

How do I make a timed (rented) costume?

Set limittype to LIMIT_REAL_TIME and write the duration in seconds into limitvalue; the costume becomes unusable after the specified time. This is a common method for item shop rental costumes.

Want to integrate the costume system into your own server smoothly? If you need help with Metin2 server source editing, item and system development, get in touch with me — let's plan a solution that fits your project.

Devamı için