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

Metin2 Adding a New Skill: Source and Client Guide

Metin2 adding a new skill looks at first glance like inserting a single line into one file, but it actually requires two separate worlds to stay in sync: the source (server) side defines the ability's maths and rules, while the client side shows the player the icon, the description and the effect. If the vnum on each side does not match, the skill either never shows up or triggers with the wrong effect. In this guide we build a skill from scratch, from planning all the way to testing.

Plan first: vnum, type and audience

Every skill is identified by a unique vnum. Before adding a new ability, decide which class it belongs to (warrior, ninja, sura, shaman), whether it is active or passive, and what its target is. Metin2 skill target types are roughly:

  • SKILL_TARGET_TYPE_SELF — buff / self-enhancement.
  • SKILL_TARGET_TYPE_TARGET — damage or effect on a single target.
  • SKILL_TARGET_TYPE_AROUND — area effect on nearby enemies.

Picking an unused vnum is critical. To see the existing skill range without collisions, check the table in the player database:

SELECT dwVnum, szName FROM player.skill_proto ORDER BY dwVnum;

Source side: skill_proto and constants

The server reads skill data from the player.skill_proto table at boot. When you add the new row, you need to fill at least these fields: dwVnum, szName, bType (class/type), bMaxLevel, bLevelStep, plus the SP/HP cost and cooldown columns. Damage or heal formulas are usually held in polynomial (formula) string columns such as szPointPoly and szDurationPoly; these are evaluated in-game from k (the skill-level coefficient) and the character's stats.

A typical formula column follows this logic:

-- szPointPoly example (damage formula)
1.5 * atk + 3.0 * k * lv

Here atk is attack power, lv is character level, and k is a 0–1 ratio tied to the skill level. The most important rule is keeping formulas balanced against existing skills rather than overtuning them; otherwise PvP balance breaks.

Extra C++ changes in the source are usually only needed when the skill requires a special mechanic (for example a new affect type, or an extra per-hit effect). For standard damage/buff skills, the existing ComputeSkill flow in char_skill.cpp is enough. If you use a new affect, remember to define your constant in length.h / affect.h and to keep serverproto and syncproto consistent with the client.

Binding to the skill tree and learning conditions

For the skill to appear to the player, it must be tied to a learning path. On most servers this is done through the Skill Master NPC on the quest side or through a skill-book system. Adding the new vnum to the skill list in the quest lua typically looks like this:

when 20309.chat."Learn New Ability" begin
    if pc.get_level() < 40 then
        say("You must be level 40 to learn this ability.")
        return
    end
    pc.give_skillbook(141)  -- new skill vnum
end

Here you can add rules like a level check, a soul-point condition or item consumption. If you use the skill-book system, you also have to define the book on the item_proto side.

Client side: skilltable, description and icon

Even if the server knows the skill, the player sees an empty square unless the client knows how to draw it. There are three core points to edit on the client side:

  • locale/<lang>/skilltable.txt — maps the skill's vnum, name, type and the motiongraph/effect references it uses.
  • locale/<lang>/skilldesc.txt — the description text the player sees on hover.
  • icon/skill/ — the skill's .tga icon; the path in skilltable.txt must point to this file.

skilltable.txt consists of tab-separated columns; if the column order breaks, the skill will not load. When you add the new row, make sure the vnum is exactly the same as on the source. You also specify the icon path here:

icon/skill/warrior/new_skill.tga

Binding effect and motion

The visual effect is the particle/animation file that plays when the skill is used. In Metin2 these effects are usually bound through .mse (effect) files and, for the character animation, through .msa/motiongraph. The relevant column in skilltable.txt states which motion and effect get triggered. When adding a new effect file to the project, watch two things:

  • The effect file must actually exist in the client's pack/index structure (for example in the effect pack); otherwise nothing plays, silently.
  • The animation must correspond to a motion index defined in the relevant race's motiongraph. Calling a non-existent motion can freeze the character in a T-pose.

Reusing a ready-made effect (referencing an existing skill's .mse) is the safest path for the first test; once you confirm everything is wired up, you can swap in your own effect.

Testing and debugging

After applying the changes, test in this order: first restart the server and check the boot logs for any skill_proto read error, then pack the client, learn the skill and use it. Common problems:

  • Empty skill icon → wrong path in skilltable.txt or the .tga is missing from the pack.
  • Skill can't be learned → a quest condition is blocking it, or the book item is undefined.
  • Effect won't play → wrong .mse reference or motion index.
  • Damage is 0 → a typo in the formula string; check the syserr logs.

Always keep syserr.txt open; most Metin2 skill errors are written there silently and give no in-game symptom.

Frequently Asked Questions

Do I always have to compile the source for a new skill?

No. Standard damage or buff skills can be added with just skill_proto and the client files. A source compile is only needed when you want behavior the existing system lacks, such as a new affect type or a custom per-hit mechanic.

What happens if the client and source vnum differ?

The skill either never shows up or matches the wrong icon/effect. Keeping the vnum identical on both sides is the most critical rule; it is the root of most "the skill doesn't work" problems.

If the effect won't play, where should I look first?

First confirm the .mse effect file really exists in the client pack, then confirm the called motion index is defined in the relevant race's motiongraph. If either is missing, the effect is silently skipped.

Building a custom skill system on your own server? If you need help with Metin2 skill work, from source-side mechanic design to client effect/icon integration, get in touch with me.

Bu kategorideki tüm yazılar →

Devamı için