Kahramanlık Derecesine Özellik Ekleme Sistemi
A guy asked in this community a tutorial on how to add a bonus of alignment.
Well today I show you a small tutorial that can do that, i not tested.
- [ File: /Src/game/affect.h ]
#1.) Search:
// 2) After make a new line and paste:
Code for use:
- [ File: /Src/common/service.h ]
- [ File: /Src/common/ length .h ]
You can use the code in function ComputePoints() from char.cpp or EnterGame() from input_main.cpp
Metin2 özel sunucularında geliştirme yaparken C++ tabanlı sistemlerin kullanımı oldukça yaygındır. Bu sistemlerden biri olan dereceye göre özellik ekleme sistemi, oyuncuların karakterlerinin belirli bir seviyeye ulaştığında otomatik olarak belirli bonus nitelikler kazanmasını sağlar. Bu sayede oyuncu deneyimi artırılır ve karakter gelişimine daha fazla derinlik katar. Bu yazıda Metin2 özel sunucularda dereceye göre özellik ekleme sistemini nasıl C++ ile uygulayacağınızı adım adım anlatacağız.
Öncelikle, bu sistemin temel mantığı karakterin derecesine göre belirli bonus niteliklerin eklenmesidir. Örneğin, 100. seviyeye ulaşan bir karakterin can veya mana miktarında otomatik artışlar görebilir. Bu gibi sistemler, game server tarafında C++ ile kodlanır ve client ile senkronize çalışır. Sistem genellikle player_manager.cpp, char.cpp ve char.h gibi dosyalarda tanımlanır.
Adım 1: Nitelik Tanımı Oluşturmak
C++ dosyalarında öncelikle hangi niteliklerin ne zaman ekleneceğini belirlemek gerekir. Bu tanımı genellikle header dosyasında bir fonksiyon olarak tanımlarsınız:
Adım 2: Fonksiyonu Gerçekleştirmek
Game server tarafında bu fonksiyonu .cpp dosyasında tanımlamalısınız. Örneğin:
Adım 3: Fonksiyonu Tetiklemek
Level değişikliğinde bu fonksiyonun çağrılması gerekir. Bunun için level artışı gerçekleştiğinde AddBonusStatsByLevel fonksiyonunu tetiklemek önemlidir. Genellikle char_battle.cpp veya char_skill.cpp gibi dosyalarda seviye değişikliği işlemleri yapılır. Tetikleme işlemi şu şekilde yapılabilir:
Bonus Niteliklerin Listesi
Sistemde tanımlayabileceğiniz bazı bonus nitelikler şunlardır:
- POINT_MAX_HP: Maksimum can miktarı
- POINT_MAX_SP: Maksimum mana miktarı
- POINT_ATT_SPEED: Saldırı hızı
- POINT_MOV_SPEED: Hareket hızı
- POINT_ST: Güç bonusu
- POINT_DX: Çeviklik bonusu
- POINT_HT: Dayanıklılık bonusu
- POINT_IQ: Zeka bonusu
Dikkat Edilmesi Gerekenler
Metin2 özel sunucularında server side ve client side uyumunun sağlanması çok önemlidir. Nitelik değişiklikleri hem sunucuda doğru şekilde hesaplanmalı hem de istemci tarafında doğru yansıtılmalıdır. Aksi takdirde oyuncularda hatalı bilgi görüntülenebilir. Ayrıca C++ kodlarında yapılan değişikliklerin derleme sürecinden geçmesi gerekir. Metin2 derleme işlemleri genellikle Visual Studio ortamında yapılır. Compile hatası alınırsa kodda eksiklik veya yazım hatası olabilir.
Sonuç
Dereceye göre özellik ekleme sistemi, Metin2 özel sunucularında karakter gelişimini destekleyen güçlü bir özelliktir. C++ ile kolayca entegre edilebilir ve özelleştirilebilir. Bu sistem sayesinde oyuncuların ilerleme hissi artar ve sunucuya sadakat sağlanabilir.
Metin2 private servers, developing C++ based systems like the adding stats by level feature is common practice. This system allows players to automatically gain bonus attributes when their character reaches certain levels, enhancing gameplay and adding depth to character progression. In this article, we will explain how to implement the add stats by level system in Metin2 private servers using C++.
The core logic of this system is to add specific bonus stats based on the character's level. For example, once a player reaches level 100, they might receive increased HP or SP. Such features are coded within the game server using C++ and synchronized with the client. The system typically involves files like player_manager.cpp, char.cpp, and char.h.
Step 1: Define Stats
Firstly, you need to define which stats will be added at what levels. This is usually done in a header file:
Step 2: Implement the Function
You must implement this function inside a .cpp file on the game server side. Example implementation:
Step 3: Trigger the Function
Whenever the character's level increases, the AddBonusStatsByLevel function should be called. This can be implemented in files like char_battle.cpp or char_skill.cpp. Example trigger code:
List of Possible Bonus Stats
Some common stats that can be added:
- POINT_MAX_HP: Max health points
- POINT_MAX_SP: Max skill points
- POINT_ATT_SPEED: Attack speed
- POINT_MOV_SPEED: Movement speed
- POINT_ST: Strength bonus
- POINT_DX: Dexterity bonus
- POINT_HT: Health bonus
- POINT_IQ: Intelligence bonus
Important Considerations
In Metin2 private servers, maintaining synchronization between server-side and client-side is critical. Stat changes must be correctly calculated on the server and properly displayed on the client. Additionally, modifications made in C++ code must be successfully compiled. Compiling Metin2 server code is usually done in Visual Studio. Compilation errors may occur due to syntax or logical mistakes.
Conclusion
The add stats by level system is a powerful feature for enhancing character progression in Metin2 private servers. It can easily be integrated and customized using C++. This system increases player engagement and helps retain loyalty to the server.
A guy asked in this community a tutorial on how to add a bonus of alignment.
Well today I show you a small tutorial that can do that, i not tested.
- [ File: /Src/game/affect.h ]
#1.) Search:
Kod:
AFFECT_BLEND,
// 2) After make a new line and paste:
Kod:
ALIGNMENT_BONUS_1, ALIGNMENT_BONUS_2,
Code for use:
Kod:
#ifdef __ALIGNMENT_BONUS__ if (GetRealAlignment() == NAME_ALIGNMENT_1) { AddAffect(ALIGNMENT_BONUS_1, POINT_MAX_HP, VALUE_BONUS_ALIGNMENT_1, 0, ALIGNMENT_TIME, 0, true); } if (GetRealAlignment() == NAME_ALIGNMENT_2) { AddAffect(ALIGNMENT_BONUS_2, POINT_MAX_HP, VALUE_BONUS_ALIGNMENT_2, 0, ALIGNMENT_TIME, 0, true); } #endif #ifdef __ALIGNMENT_BONUS__ if (FindAffect(ALIGNMENT_BONUS_1)) { if (GetRealAlignment() != NAME_ALIGNMENT_1) { RemoveAffect(ALIGNMENT_BONUS_1); } } #endif
- [ File: /Src/common/service.h ]
Kod:
#define __ALIGNMENT_BONUS__
- [ File: /Src/common/ length .h ]
Kod:
#ifdef __ALIGNMENT_BONUS__ enum EAlignmentBonus { NAME_ALIGNMENT_1 = 100000 NAME_ALIGNMENT_2 = 200000, ALIGNMENT_TIME = 60*60*24*365, VALUE_BONUS_ALIGNMENT_1 = 1000, VALUE_BONUS_ALIGNMENT_2 = 2000, }; #endif
You can use the code in function ComputePoints() from char.cpp or EnterGame() from input_main.cpp
Metin2 özel sunucularında geliştirme yaparken C++ tabanlı sistemlerin kullanımı oldukça yaygındır. Bu sistemlerden biri olan dereceye göre özellik ekleme sistemi, oyuncuların karakterlerinin belirli bir seviyeye ulaştığında otomatik olarak belirli bonus nitelikler kazanmasını sağlar. Bu sayede oyuncu deneyimi artırılır ve karakter gelişimine daha fazla derinlik katar. Bu yazıda Metin2 özel sunucularda dereceye göre özellik ekleme sistemini nasıl C++ ile uygulayacağınızı adım adım anlatacağız.
Öncelikle, bu sistemin temel mantığı karakterin derecesine göre belirli bonus niteliklerin eklenmesidir. Örneğin, 100. seviyeye ulaşan bir karakterin can veya mana miktarında otomatik artışlar görebilir. Bu gibi sistemler, game server tarafında C++ ile kodlanır ve client ile senkronize çalışır. Sistem genellikle player_manager.cpp, char.cpp ve char.h gibi dosyalarda tanımlanır.
Adım 1: Nitelik Tanımı Oluşturmak
C++ dosyalarında öncelikle hangi niteliklerin ne zaman ekleneceğini belirlemek gerekir. Bu tanımı genellikle header dosyasında bir fonksiyon olarak tanımlarsınız:
Kod:
[COLOR=green]void AddBonusStatsByLevel(LPCHARACTER ch);[/COLOR]
Adım 2: Fonksiyonu Gerçekleştirmek
Game server tarafında bu fonksiyonu .cpp dosyasında tanımlamalısınız. Örneğin:
Kod:
[COLOR=green]void AddBonusStatsByLevel(LPCHARACTER ch)[/COLOR][BR][/BR][COLOR=green]{[/COLOR][BR][/BR][COLOR=green] int level = ch->GetLevel();[/COLOR][BR][/BR][COLOR=green] if (level >= 100) {[/COLOR][BR][/BR][COLOR=green] ch->PointChange(POINT_MAX_HP, 1000, true); // +1000 HP[/COLOR][BR][/BR][COLOR=green] }[/COLOR][BR][/BR][COLOR=green] if (level >= 150) {[/COLOR][BR][/BR][COLOR=green] ch->PointChange(POINT_ATT_SPEED, 5, true); // +5 Attack Speed[/COLOR][BR][/BR][COLOR=green] }[/COLOR][BR][/BR][COLOR=green]}[/COLOR]
Adım 3: Fonksiyonu Tetiklemek
Level değişikliğinde bu fonksiyonun çağrılması gerekir. Bunun için level artışı gerçekleştiğinde AddBonusStatsByLevel fonksiyonunu tetiklemek önemlidir. Genellikle char_battle.cpp veya char_skill.cpp gibi dosyalarda seviye değişikliği işlemleri yapılır. Tetikleme işlemi şu şekilde yapılabilir:
Kod:
[COLOR=green]if (ch->GetLevel() > old_level) {[/COLOR][BR][/BR][COLOR=green] AddBonusStatsByLevel(ch);[/COLOR][BR][/BR][COLOR=green]}[/COLOR]
Bonus Niteliklerin Listesi
Sistemde tanımlayabileceğiniz bazı bonus nitelikler şunlardır:
- POINT_MAX_HP: Maksimum can miktarı
- POINT_MAX_SP: Maksimum mana miktarı
- POINT_ATT_SPEED: Saldırı hızı
- POINT_MOV_SPEED: Hareket hızı
- POINT_ST: Güç bonusu
- POINT_DX: Çeviklik bonusu
- POINT_HT: Dayanıklılık bonusu
- POINT_IQ: Zeka bonusu
Dikkat Edilmesi Gerekenler
Metin2 özel sunucularında server side ve client side uyumunun sağlanması çok önemlidir. Nitelik değişiklikleri hem sunucuda doğru şekilde hesaplanmalı hem de istemci tarafında doğru yansıtılmalıdır. Aksi takdirde oyuncularda hatalı bilgi görüntülenebilir. Ayrıca C++ kodlarında yapılan değişikliklerin derleme sürecinden geçmesi gerekir. Metin2 derleme işlemleri genellikle Visual Studio ortamında yapılır. Compile hatası alınırsa kodda eksiklik veya yazım hatası olabilir.
Sonuç
Dereceye göre özellik ekleme sistemi, Metin2 özel sunucularında karakter gelişimini destekleyen güçlü bir özelliktir. C++ ile kolayca entegre edilebilir ve özelleştirilebilir. Bu sistem sayesinde oyuncuların ilerleme hissi artar ve sunucuya sadakat sağlanabilir.
Metin2 private servers, developing C++ based systems like the adding stats by level feature is common practice. This system allows players to automatically gain bonus attributes when their character reaches certain levels, enhancing gameplay and adding depth to character progression. In this article, we will explain how to implement the add stats by level system in Metin2 private servers using C++.
The core logic of this system is to add specific bonus stats based on the character's level. For example, once a player reaches level 100, they might receive increased HP or SP. Such features are coded within the game server using C++ and synchronized with the client. The system typically involves files like player_manager.cpp, char.cpp, and char.h.
Step 1: Define Stats
Firstly, you need to define which stats will be added at what levels. This is usually done in a header file:
Kod:
[COLOR=green]void AddBonusStatsByLevel(LPCHARACTER ch);[/COLOR]
Step 2: Implement the Function
You must implement this function inside a .cpp file on the game server side. Example implementation:
Kod:
[COLOR=green]void AddBonusStatsByLevel(LPCHARACTER ch)[/COLOR][BR][/BR][COLOR=green]{[/COLOR][BR][/BR][COLOR=green] int level = ch->GetLevel();[/COLOR][BR][/BR][COLOR=green] if (level >= 100) {[/COLOR][BR][/BR][COLOR=green] ch->PointChange(POINT_MAX_HP, 1000, true); // +1000 HP[/COLOR][BR][/BR][COLOR=green] }[/COLOR][BR][/BR][COLOR=green] if (level >= 150) {[/COLOR][BR][/BR][COLOR=green] ch->PointChange(POINT_ATT_SPEED, 5, true); // +5 Attack Speed[/COLOR][BR][/BR][COLOR=green] }[/COLOR][BR][/BR][COLOR=green]}[/COLOR]
Step 3: Trigger the Function
Whenever the character's level increases, the AddBonusStatsByLevel function should be called. This can be implemented in files like char_battle.cpp or char_skill.cpp. Example trigger code:
Kod:
[COLOR=green]if (ch->GetLevel() > old_level) {[/COLOR][BR][/BR][COLOR=green] AddBonusStatsByLevel(ch);[/COLOR][BR][/BR][COLOR=green]}[/COLOR]
List of Possible Bonus Stats
Some common stats that can be added:
- POINT_MAX_HP: Max health points
- POINT_MAX_SP: Max skill points
- POINT_ATT_SPEED: Attack speed
- POINT_MOV_SPEED: Movement speed
- POINT_ST: Strength bonus
- POINT_DX: Dexterity bonus
- POINT_HT: Health bonus
- POINT_IQ: Intelligence bonus
Important Considerations
In Metin2 private servers, maintaining synchronization between server-side and client-side is critical. Stat changes must be correctly calculated on the server and properly displayed on the client. Additionally, modifications made in C++ code must be successfully compiled. Compiling Metin2 server code is usually done in Visual Studio. Compilation errors may occur due to syntax or logical mistakes.
Conclusion
The add stats by level system is a powerful feature for enhancing character progression in Metin2 private servers. It can easily be integrated and customized using C++. This system increases player engagement and helps retain loyalty to the server.
