[C++] 6 Taş sistemi

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 29

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
common/item_length.h[/FONT]

arat,

Kod:
ITEM_SOCKET_MAX_NUM         = 3,

Değiştir,

Kod:
ITEM_SOCKET_MAX_NUM         = 6,

db/cache.cpp

Arat,

Kod:
if (isSocket)         {             iLen += snprintf(szColumns + iLen, sizeof(szColumns) - iLen, ", socket0, socket1, socket2");             iValueLen += snprintf(szValues + iValueLen, sizeof(szValues) - iValueLen,                     ", %lu, %lu, %lu", p->alSockets[0], p->alSockets[1], p->alSockets[2]);             iUpdateLen += snprintf(szUpdate + iUpdateLen, sizeof(szUpdate) - iUpdateLen,                     ", socket0=%lu, socket1=%lu, socket2=%lu", p->alSockets[0], p->alSockets[1], p->alSockets[2]);         }

değiştir,

Kod:
if (isSocket)         {             iLen += snprintf(szColumns + iLen, sizeof(szColumns) - iLen, ", socket0, socket1, socket2, socket3, socket4, socket5");             iValueLen += snprintf(szValues + iValueLen, sizeof(szValues) - iValueLen,                     ", %lu, %lu, %lu, %lu, %lu, %lu", p->alSockets[0], p->alSockets[1], p->alSockets[2], p->alSockets[3], p->alSockets[4], p->alSockets[5]);             iUpdateLen += snprintf(szUpdate + iUpdateLen, sizeof(szUpdate) - iUpdateLen,                     ", socket0=%lu, socket1=%lu, socket2=%lu, socket3=%lu, socket4=%lu, socket5=%lu", p->alSockets[0], p->alSockets[1], p->alSockets[2], p->alSockets[3], p->alSockets[4], p->alSockets[5]);         }

db/clientmanagerplayer.cpp

Arat,

Kod:
str_to_number(item.alSockets[2], row[cur++]);

Şeklinde düzenleyin,

Kod:
str_to_number(item.alSockets[3], row[cur++]);
Kod:
[B]        str_to_number(item.alSockets[4], row[cur++]);[/B] [B]        str_to_number(item.alSockets[5], row[cur++]);[/B]


Arat,

Kod:
"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "

Şeklinde ayarla

Kod:
"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,socket3,socket4,socket5,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "

Arat,

Kod:
"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "

Şeklinde ayarla,

Kod:
"SELECT id,window+0,pos,count,vnum,socket0,socket1,socket2,socket3,socket4,socket5,attrtype0,attrvalue0,attrtype1,attrvalue1,attrtype2,attrvalue2,attrtype3,attrvalue3,attrtype4,attrvalue4,attrtype5,attrvalue5,attrtype6,attrvalue6 "

game/constants.cpp

Arat,

Kod:
3, // WEAPON_SWORD, 3, // WEAPON_DAGGER, 3, // WEAPON_BOW, 3, // WEAPON_TWO_HANDED, 3, // WEAPON_BELL, 3, // WEAPON_FAN, 3, // WEAPON_CLAW 0, // WEAPON_ARROW, 0, // WEAPON_MOUNT_SPEAR

Şeklinde ayarla,

Kod:
6, // WEAPON_SWORD, 6, // WEAPON_DAGGER, 6, // WEAPON_BOW, 6, // WEAPON_TWO_HANDED, 6, // WEAPON_BELL, 6, // WEAPON_FAN, 6, // WEAPON_CLAW 0, // WEAPON_ARROW, 0, // WEAPON_MOUNT_SPEAR

Arat,
Kod:
3, // ARMOR_BODY,

Şeklinde ayarla,
Kod:
6, // ARMOR_BODY,

userinterface/gametype.h

Arat,
Kod:
ITEM_SOCKET_SLOT_MAX_NUM = 3,

Şeklinde ayarla,

Kod:
ITEM_SOCKET_SLOT_MAX_NUM = 6,

Arkadaşlar , bug vs. sorunu yaşarsanız konu altına yorum atın çözümü yapıldıkça konuya dahil olacaktır ...

Python Kısmı



C++ ile Metin2'de 6 Taş Sistemi Geliştirme

Metin2 özel sunucularında PvP deneyimini zenginleştirmek ve oyuncuların karakter güçlerini artırmak amacıyla taş sistemleri büyük önem taşır. Bu sistemlerden biri olan 6 Taş Sistemi, karakterin farklı yönlerini güçlendiren 6 farklı taş tipini içerir. Bu yazıda, C++ tabanlı game server tarafında bu sistemi nasıl entegre edeceğinizi adım adım anlatacağız.

6 Taş Sistemi Nedir?

6 Taş Sistemi, oyuncunun karakterine takılabilecek ve belirli stat bonusları veren taşlardır. Bu taşlar genellikle STR, DEX, INT, CON, LUCK, ATTACK gibi alanlarda destek sağlar. Her taş, farklı bonuslar sunarak karakter gelişimini kişiselleştirmeye olanak tanır.

C++ ile Geliştirme Adımları

1. Database tarafında yeni bir tablo oluşturmalısınız. Bu tablo, karakterin hangi taşlara sahip olduğunu ve taşların slot durumlarını saklamalıdır. Örneğin:

CREATE TABLE player_stones (
id INT AUTO_INCREMENT PRIMARY KEY,
player_id INT NOT NULL,
slot_1 TINYINT DEFAULT 0,
slot_2 TINYINT DEFAULT 0,
slot_3 TINYINT DEFAULT 0,
slot_4 TINYINT DEFAULT 0,
slot_5 TINYINT DEFAULT 0,
slot_6 TINYINT DEFAULT 0
);

2. Game Server tarafında taş eklentisi için packet tanımlamaları yapılmalıdır. Oyuncu bir taş takarken veya çıkarırken bu verileri sunucuya iletmek gerekir. client ile server arasında bu işlem için özel header tanımlanabilir.

3. Bonus hesaplamaları, karakterin stat sistemine entegre edilmelidir. Her taş türü için farklı bonus değerleri atanabilir. Bu değerler C++ içinde sabit ya da dinamik olarak tanımlanabilir.

4. UI tarafında bir Python arayüzü tasarlanabilir. Bu arayüzde oyuncu taşları takabilir, çıkarabilir ve mevcut bonusları görebilir. UIScript dosyaları ile bu arayüz client tarafında aktif hale getirilir.

Sistem Güvenliği ve Hile Önleme

Taş sistemi geliştirilirken hile ve exploit engelleri mutlaka düşünülmelidir. Sunucu tarafında taş takma ve çıkarma işlemleri kontrol edilmeli, istemci tarafından gönderilen veriler doğrulanmalıdır. Ayrıca taşların ID kontrolleri yapılarak sadece belirli taşların kullanılmasına izin verilmelidir.

Taş Sistemi ile PvP Dengesi

Oyuncuların PvP deneyimini zenginleştirmek için taş sistemleri dengeli olmalıdır. Aşırı güçlü taşlar bazı sınıfları baskın hale getirebilir. Bu nedenle taş bonusları test edilmeli ve balance ayarları yapılmalıdır. Metin2 Lobby gibi platformlarda sunucuların dengeli sistemlere sahip olması önemlidir.

Sonuç

6 Taş Sistemi, Metin2 özel sunucularında oyuncu deneyimini ciddi anlamda artıran bir özelliktir. C++ ile geliştirilen bu sistem, doğru uygulandığında hem PvP hem de PvE oyun stillerine destek sağlar. Bu sistem sayesinde karakterler daha güçlü ve özelleştirilebilir hale gelir. Metin2 Lobby kullanıcıları için bu tür sistemler sunucu kalitesini artırır.


Developing 6 Stone System in Metin2 with C++

In order to enhance the PvP experience and increase character power in Metin2 private servers, stone systems are very important. One of these systems, the 6 Stone System, includes six different stone types that support various aspects of the character. In this article, we will explain step by step how to integrate this system on the C++ based game server.

What is the 6 Stone System?

The 6 Stone System consists of stones that can be equipped on the player's character and provide certain stat bonuses. These stones typically offer support in areas like STR, DEX, INT, CON, LUCK, and ATTACK. Each stone provides different bonuses, allowing players to customize their character development.

Development Steps with C++

1. Create a new table in the database to store which stones the character has and their slot status. For example:

CREATE TABLE player_stones (
id INT AUTO_INCREMENT PRIMARY KEY,
player_id INT NOT NULL,
slot_1 TINYINT DEFAULT 0,
slot_2 TINYINT DEFAULT 0,
slot_3 TINYINT DEFAULT 0,
slot_4 TINYINT DEFAULT 0,
slot_5 TINYINT DEFAULT 0,
slot_6 TINYINT DEFAULT 0
);

2. Define packets for the stone system on the game server side. When a player equips or removes a stone, these data must be sent to the server. A custom header can be defined for communication between the client and server.

3. Stat bonus calculations should be integrated into the character's stat system. Different bonus values can be assigned to each stone type, defined either statically or dynamically in C++.

4. Design a Python-based UI interface where players can equip or remove stones and view active bonuses. This interface can be activated on the client side using UIScript files.

System Security and Exploit Prevention

When developing the stone system, cheat and exploit prevention measures must be considered. Equipping and removing stone operations should be validated on the server-side, ensuring only allowed stone IDs are used.

PvP Balance with the Stone System

To enrich the PvP experience, the stone system must remain balanced. Overly powerful stones may dominate certain classes, so bonuses should be tested and balance adjustments made accordingly. Balanced systems like these increase server quality on platforms like Metin2 Lobby.

Conclusion

The 6 Stone System is a feature that significantly enhances the player experience in Metin2 private servers. When properly implemented with C++, this system supports both PvP and PvE gameplay styles, making characters stronger and more customizable. Such systems increase server quality for users of Metin2 Lobby.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt