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

Metin2 Mob Proto Editing: Add a New Monster

Sooner or later, when you run a private server you will want to add your own creatures, and at the heart of that job sits the metin2 mob proto file. The mob proto is the "ID card" of every monster, NPC and boss on the server: a large table that holds level, health, damage, race, resistances and dropped items in one place. In this guide we will explain the fields in plain language, then build our own monster on a free VNUM and register it correctly on both the server and the client.

What is the mob proto and where does it live?

In official and older 40k-based serverfiles, monster data is stored in one of two ways. The classic method uses a human-readable mob_proto.txt file; modern setups keep the same data in the MySQL player.mob_proto table, and the dump_proto tool generates the encrypted mob_proto file that the client can read from it. Whatever system you are on, the logic is identical: each row is one monster, and each column is one of its properties.

Remember there are two sides. The server reads the proto to run combat math (health, damage, resistances, AI). The client needs its own copy to know the monster's name, model and folder. If both sides do not recognise the same VNUM, the monster will either be invisible or the client will crash.

The most important fields

A proto row has dozens of columns, but a handful define a monster's character:

  • VNUM — The unique identifier. The whole system talks through this number; it must never collide.
  • NAME / LOCALE_NAME — The name the player sees. For localisation, mob_names.txt is also used.
  • RANKPAWN, S_PAWN, KNIGHT, S_KNIGHT, BOSS, KING. Decides whether it is an ordinary mob or a boss.
  • TYPEMONSTER, NPC, STONE (metin stone), WARP, DOOR, and so on. For a creature, use MONSTER.
  • BATTLE_TYPE — Attack style such as MELEE, RANGE or MAGIC.
  • LEVEL, MAX_HP, ST/DX/HT/IQ, DAMAGE_MIN/MAX, DEF — The core combat stats.
  • AI_FLAG — Behaviour flags such as AGGRESSIVE, COWARD (flees) and NOMOVE (stays put).
  • RACE_FLAG — Race such as ANIMAL, UNDEAD, DEVIL or ORC. Some items and skills deal bonus damage based on it.
  • IMMUNE_FLAG — Immunities like STUN, SLOW and POISON.
  • RESIST_* / ENCHANT_* — Resistance to weapon types and magic, plus effects added to its attacks (poison, stun, critical).
  • EXP, GOLD_MIN/MAX, DROP_ITEM — Rewards and the link to its drop group.
  • FOLDER — The name of the model folder on the client. Get this wrong and the client cannot find the model.

Pick a free VNUM for your new monster

The first rule is avoiding collisions. Overwriting an existing VNUM breaks every regen and quest tied to that monster. The range from 20000 upward is usually free for custom content. Confirm the number is truly empty in the current table:

-- On a MySQL-based setup
SELECT vnum, locale_name FROM player.mob_proto WHERE vnum = 20801;

If the result is empty, that number is yours. If you work with the text file, search mob_proto.txt for the same VNUM to make sure it is not taken.

Build the row

A practical approach is to copy the row of an existing monster similar to yours and tweak it, so you do not fill every column from scratch. For example, let us base an upgraded "Shadow Wolf" on an ordinary wolf. In the text file the row is TAB-separated and must match the order of the header line exactly:

# VNUM  NAME          RANK    TYPE     BATTLE_TYPE  LEVEL  ...  MAX_HP  ...  EXP    GOLD_MIN  GOLD_MAX  ...
20801   Shadow_Wolf   KNIGHT  MONSTER  MELEE        42     ...  18500   ...  9200   500       1400      ...

Because the column count and order vary by serverfiles version, always derive the real row from another monster in the same file; never invent columns. On the MySQL side you do the same with an INSERT:

INSERT INTO player.mob_proto (vnum, name, locale_name, rank, type, battle_type, level, max_hp, exp, gold_min, gold_max)
VALUES (20801, 'Shadow_Wolf', 'Shadow Wolf', 'KNIGHT', 'MONSTER', 'MELEE', 42, 18500, 9200, 500, 1400);
-- the other columns fall back to the table defaults; adjust with UPDATE as needed

To localise the name, add the VNUM and display name to mob_names.txt as well. Define its drops by linking the VNUM in mob_drop_item.txt / common_drop_item.txt or through a quest.

Don't forget the client side

Even if the server knows the monster, the client must recognise the same VNUM for it to appear on the player's screen. To achieve this you generate a new client mob_proto with dump_proto and distribute it to the player client. The model folder named in the FOLDER field must also actually exist inside the client packs (usually the .gr2 model and its textures). If you are not adding a brand-new model, pointing to an existing wolf model's folder is the safest path.

Load and test

Once the changes are done, restart the relevant cores (the db and game/ch layers) so the proto is read fresh on the server. Then test in-game with a GM account:

// Spawn the monster next to you with a GM command (depends on serverfiles)
/m 20801

If the monster appears with the right name, the right model and sensible stats, the proto side is done. To make it spawn permanently on a map, add a spawn entry to the map server's regen.txt (or boss.txt for bosses). Two errors come up often during testing: the monster not appearing on the client (wrong FOLDER or an outdated client proto), and the server crashing on boot (the row's column count does not match the header).

Frequently Asked Questions

Should I use mob_proto.txt or MySQL?

It depends on which system your serverfiles read. New-generation files usually rely on the player.mob_proto table and build the client proto with dump_proto. On setups that use both, the source must always be the same one, otherwise server and client see different data and conflict.

My new monster appears but drops nothing — why?

The mob proto does not hold item drops directly; drops are defined in separate files like mob_drop_item.txt and common_drop_item.txt, or in quests. If you did not link the new VNUM to one of those systems, the monster drops nothing.

Why does the server crash on boot?

The most common cause is that the column count of your new row, or the type of a field (for example text where a number is expected), does not match the header line. Always start by copying the row of an existing monster, and do not break the tab alignment.

Want custom monsters, bosses or a balanced mob economy for your own server? If you need help with Metin2 proto, quest and system edits, get in touch with me — let's put your project on a solid foundation together.

Devamı için