[C++] Sınırsız Otomatik Pot Yapımı

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Merhaba, sizlere otomatik kırmızı ve mavi potu sınırsız yapmayı paylaşacağım.
WS ve Orta tip kullanan kişilerin işine yarayacaktır.

char_item.cpp dosyası içerisinde aratılır
Kod:
void CHARACTER::AutoRecoveryItemProcess(const EAffectTypes type)

kod bloğu komple değiştirilir;
Kod:
void CHARACTER::AutoRecoveryItemProcess(const EAffectTypes type) {     if ((true == IsDead()) || (true == IsStun()) || (false == IsPC()) || (AFFECT_AUTO_HP_RECOVERY != type && AFFECT_AUTO_SP_RECOVERY != type) || (NULL != FindAffect(AFFECT_STUN)))         return;     {         const DWORD stunSkills[*] = { SKILL_TANHWAN, SKILL_GEOMPUNG, SKILL_BYEURAK, SKILL_GIGUNG };         for (size_t i=0 ; i < sizeof(stunSkills)/sizeof(DWORD) ; ++i)         {             const CAffect* p = FindAffect(stunSkills[i]);             if (NULL != p && AFF_STUN == p->dwFlag)                 return;         }     }     const CAffect* pAffect = FindAffect(type);     if (NULL != pAffect)     {         LPITEM pItem = FindItemByID(pAffect->dwFlag);         if (NULL != pItem && true == pItem->GetSocket(0))         {             if (false == CArenaManager::instance().IsArenaMap(GetMapIndex()))             {                 int32_t gelendeger = 0;                 if (AFFECT_AUTO_HP_RECOVERY == type)                 {                     gelendeger = GetMaxHP() - (GetHP() + GetPoint(POINT_HP_RECOVERY));                 }                 else if (AFFECT_AUTO_SP_RECOVERY == type)                 {                     gelendeger = GetMaxSP() - (GetSP() + GetPoint(POINT_SP_RECOVERY));                 }                 if (gelendeger > 0)                 {                     if (AFFECT_AUTO_HP_RECOVERY == type)                     {                         PointChange(POINT_HP_RECOVERY,gelendeger);                         EffectPacket(SE_AUTO_HPUP);                     }                     else if (AFFECT_AUTO_SP_RECOVERY == type)                     {                         PointChange(POINT_SP_RECOVERY,gelendeger);                         EffectPacket(SE_AUTO_SPUP);                     }                 }             }             else             {                 pItem->Lock(false);                 pItem->SetSocket(0, false);                 RemoveAffect( const_cast<CAffect*>(pAffect) );             }         }         else         {             RemoveAffect( const_cast<CAffect*>(pAffect) );         }     } }

İtem üzerinde "Kalan miktar" yazısını kaldırmak için;
root > uitooltip.py dosyasında aratıp silinir.
Kod:
self.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (100.0 - ((usedAmount / totalAmount) * 100.0)), self.POSITIVE_COLOR)


Metin2 Lobby'da Gelişmiş C++ Sistemleri: Sınırsız Otomatik Pot Sistemi Nasıl Geliştirilir?

Metin2 özel sunucularında oyuncu deneyimini artırmak ve PvP mücadelesini daha keyifli hale getirmek adına geliştirilen sistemlerden birisi de otomatik pot sistemidir. Bu yazıda, C++ dilini kullanarak sınırsız otomatik pot yapımını nasıl gerçekleştirebileceğinizi adım adım anlatacağız. Bu sistem sayesinde oyuncuların savaş sırasında sağlığını koruma konusunda daha rahat hissetmesini sağlayabilirsiniz.

Otomatik Pot Nedir ve Neden Gereklidir?
Metin2 oyununda savaşlar oldukça hızlı ve yoğun geçer. Özellikle PvP savaşlarında HP düşüşü ani olabilir. Bu nedenle otomatik olarak pot içebilen bir sistem, oyuncunun dikkatini dağıtmadan mücadeleye odaklanmasını sağlar. Sınırsız pot sistemi sayesinde oyuncu, belirli bir miktar pot harcamadan sonsuz sayıda sağlık iksiri tüketebilir.

C++ ile Otomatik Pot Sistemi Geliştirme Adımları
1. Oyun Döngüsüne Entegrasyon: C++ tabanlı bir sistem geliştirmek için öncelikle game loop'a erişim sağlamak gerekir. Bu, sunucu tarafında çalışan bir yapıdır. Metin2 sunucu kaynak kodlarında genellikle client packet sistemleri üzerinden işlem yapılır. Bu yapıya özel bir paket tanımlanarak pot kullanım isteği sunulabilir.

2. Pot Kontrolü ve Tetikleme: Sistem, oyuncunun HP seviyesini sürekli takip eder. Belirlenen eşik değerinin altına düştüğünde otomatik olarak pot içilir. Bu kontrol döngüsü, tick-based bir yapıyla çalıştırılabilir. Her tick'te HP değeri kontrol edilir ve gerekirse pot içilir.

3. Sınırsız Pot Mekaniği: Bu kısım en kritik alandır. Normalde Metin2 sistemlerinde pot sayısı sınırlıdır. Ancak özel bir sistem tasarımı ile sunucu tarafında pot kontrolünü devre dışı bırakarak sınırsız pot kullanılabilmesini sağlayabilirsiniz. Bu işlem için inventory kontrol mekanizmalarında değişiklik yapılması gerekir.

Python ve C++ Arasındaki Entegrasyon
Metin2 özel sunucularında genellikle hem C++ hem de Python kullanılır. Client tarafında kullanıcı arayüzü (UI) işlemleri için Python tercih edilir. Bu nedenle, otomatik pot sisteminin tetiklenmesi için bir Py GUI penceresi veya buton tasarımı yapılabilir. Bu Python tabanlı UI, C++ tarafındaki sistemle entegre çalışarak pot kullanımını başlatır.

Py Root üzerinden gerekli fonksiyonları çağırarak, root dizininde tanımlanan UIScript dosyaları aracılığıyla bir arayüz oluşturulabilir. Böylece hem kullanıcı dostu hem de güçlü bir sistem elde edilir.

Martysama ve Diğer Geliştirici Kaynakları
Metin2 geliştirme sürecinde birçok geliştirici, Martysama gibi platformlardan yararlanır. Bu platformlarda paylaşılan source edit örnekleri, server src dosyaları ve pack yapıları sayesinde sisteminizi daha hızlı ve verimli bir şekilde geliştirebilirsiniz. Core dosyalarında yapılan değişiklikler doğrudan sunucu performansını etkiler. Bu yüzden dikkatli ve bilinçli bir şekilde kodlama yapmanız gerekir.

Auth ve Game sunucuları arasındaki senkronizasyon da önemlidir. Otomatik pot sisteminin güvenli ve hileye kapalı çalışması için, sunucu taraflı kontroller dikkatlice planlanmalıdır.

Sonuç
Sınırsız otomatik pot sistemi, Metin2 özel sunucularında oyuncu memnuniyetini artıran güçlü bir özelliktir. C++ tabanlı geliştirme ile bu sistemi doğru şekilde implemente edebilir, hem client hem de server tarafında gerekli değişiklikleri yaparak güçlü bir sistem oluşturabilirsiniz. Metin2 Lobby olarak biz, bu tür gelişmiş sistemlerin geliştirilmesi için size rehberlik etmeye devam edeceğiz.


Advanced C++ Systems on Metin2 Lobby: How to Develop an Unlimited Auto-Potion System?

To enhance the player experience in Metin2 private servers and make PvP battles more enjoyable, one of the systems developed is the auto-potion system. In this article, we will explain step-by-step how you can implement an unlimited auto-potion system using C++. This system allows players to maintain their health during combat more easily, improving focus and gameplay performance.

What is Auto-Potion and Why Is It Necessary?
In Metin2, battles are fast-paced and intense. During PvP fights, HP loss can occur very quickly. Therefore, having a system that automatically drinks potions allows the player to stay focused on the fight without distractions. An unlimited potion system allows the player to consume healing items infinitely without depleting their inventory count.

Steps for Developing an Auto-Potion System with C++
1. Integration into the Game Loop: To develop a C++-based system, first, access to the game loop must be established. This runs on the server side. In Metin2 server source code, operations are typically handled via client packet systems. A custom packet can be defined to trigger potion usage requests.

2. Potion Control and Triggering: The system continuously monitors the player's HP level. When the value drops below a certain threshold, a potion is automatically consumed. This check cycle can run based on a tick-based structure where HP is checked every tick and potions are used accordingly.

3. Unlimited Potion Mechanics: This part is critical. Normally, Metin2 systems limit potion counts. However, by designing a special server-side mechanism, you can bypass inventory checks and allow unlimited use of potions. Modifications to inventory control mechanisms are required for this.

Integration Between Python and C++
In Metin2 private servers, both C++ and Python are commonly used. On the client side, user interface (UI) operations are often handled with Python. Therefore, a Py GUI window or button design can be created to trigger the auto-potion system. This Python-based UI interacts with the C++ system to initiate potion usage.

Through Py Root, necessary functions can be invoked, and a UI can be built using UIScript files located in the root directory. This way, a user-friendly yet powerful system can be achieved.

Resources Like Martysama and Other Developer Tools
Throughout the Metin2 development process, many developers rely on platforms like Martysama. Shared source edit examples, server src files, and pack structures from these platforms allow you to develop your system faster and more efficiently. Changes made in core files directly impact server performance, so coding must be done carefully and consciously.

Synchronization between auth and game servers is also important. For the auto-potion system to work securely and prevent cheating, server-side controls must be carefully planned.

Conclusion
An unlimited auto-potion system is a feature that increases player satisfaction in Metin2 private servers. With C++-based development, you can properly implement this system, making necessary modifications on both client and server sides to build a robust solution. As Metin2 Lobby, we will continue to guide you in developing such advanced systems.
 

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

Benzer konular

Geri
Üst Alt