Sistemi Yabancı Forumda Gördüm Paylaşayım Dedim Hayırlı Olsun.
Daha önce paylaşıldıysa kusura bakmayın
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
Metin2'de 'X Adet Y Kes Z Adet T Kazan' Sistemi Nasıl Geliştirilir?
Metin2 özel sunucularında oyuncuların motivasyonunu artırmak ve oyun içi ekonomiyi desteklemek adına geliştirilen sistemlerden birisi de 'X Adet Y Kes Z Adet T Kazan' mantığıdır. Bu sistem, oyuncuların belirli bir görevi tamamlaması durumunda ödüllerle karşılamasını sağlar. Bu yazıda, C++ tabanlı bir sistem üzerinden nasıl geliştirileceği, hangi dosyaların düzenleneceği ve Python GUI ile nasıl entegre edileceği detaylıca ele alınacaktır.
Sistem Nedir ve Ne İşe Yarar?
'X Adet Y Kes Z Adet T Kazan' sistemi, oyuncunun belirli bir objeyi (örneğin bir canavarı) öldürmesi durumunda belirli bir ödül almasını sağlar. Örneğin, oyuncu 10 adet 'Dev Orc' öldürdüğünde 1 adet 'Gümüş Kılıç' kazanabilir. Bu sistem, PvP sunucularında seviye atlama, güçlenme veya eşya toplama gibi aktiviteleri teşvik etmek için idealdir.
C++ Kaynak Kodlarında Uygulama
Öncelikle, game core üzerinde değişiklik yapmamız gerekir. Oyuncunun bir NPC öldürdüğünde tetiklenecek bir fonksiyon tanımlanmalıdır. Bu işlem için char_battle.cpp dosyasında DeadEvent fonksiyonuna müdahale edilir. Burada, öldürülen karakterin ID'si kontrol edilir ve belirli bir sayaç artırılır.
Ardından, sayaç belirli bir değere ulaştığında ödül verilir. Bu veri DB Core ile senkronize edilmelidir. Oyuncunun kill sayısını tutmak için özel bir tablo oluşturulur. Örnek olarak:
Kod:
[COLOR=#9365b8]CREATE TABLE player_kill_rewards ([/COLOR][BR][/BR][COLOR=#9365b8]player_id INT,[/COLOR][BR][/BR][COLOR=#9365b8]mob_vnum INT,[/COLOR][BR][/BR][COLOR=#9365b8]kill_count INT DEFAULT 0[/COLOR][BR][/BR][COLOR=#9365b8]);[/COLOR]
Python GUI ile Etkileşim
Bu sistemin kullanıcı dostu olması için Py Root üzerinden bir arayüz tasarlanabilir. Oyuncu, 'Hedeflerim' sekmesinden kaç adet daha öldürmesi gerektiğini görebilir. Bu GUI, uiscript kullanılarak geliştirilir ve Python GUI sistemine entegre edilir. Oyuncuya gerçek zamanlı geri bildirim sağlar.
Martysama ve Diğer Araçlar
Metin2 Lobby olarak, Martysama gibi gelişmiş araçlarla bu tür sistemlerin derlenmesi ve test edilmesi kolaylaştırılmıştır. Bu sistemlerin güvenli ve hatasız çalışması için compile işlemi önemlidir. Hatalar, auth ve game server arasında senkronizasyon sorunlarına yol açabilir.
Sonuç
'X Adet Y Kes Z Adet T Kazan' sistemi, Metin2 özel sunucularında oyuncu etkileşimini artırmak için güçlü bir araçtır. C++ ile backend, Python ile frontend entegrasyonu ile güçlü ve esnek sistemler geliştirilebilir. Source edit yaparken dikkatli olunmalı ve test süreçleri eksiksiz uygulanmalıdır.
How to Develop 'Kill X Ys and Win Z Ts' System in Metin2?
In Metin2 private servers, systems like 'Kill X Ys and Win Z Ts' are designed to increase player motivation and support in-game economy. This system rewards players upon completing specific tasks. In this article, we will explain how to develop such a system based on C++, which files need editing, and its integration with Python GUI.
What Is the System and What Does It Do?
The 'Kill X Ys and Win Z Ts' system allows players to receive rewards after eliminating certain NPCs. For instance, killing 10 'Great Orcs' may reward the player with 1 'Silver Sword'. This system is ideal for encouraging leveling up, power gain, or item collection in PvP servers.
Implementation in C++ Source Code
Firstly, modifications must be made to the game core. A function needs to trigger when a player kills an NPC. In char_battle.cpp, adjustments are made to the DeadEvent function where the killed NPC's ID is checked and a counter increases accordingly.
Once the counter reaches a set value, rewards are granted. The data should be synchronized with the DB Core. A custom table can be created to store kill counts per player. Example:
Kod:
[COLOR=#9365b8]CREATE TABLE player_kill_rewards ([/COLOR][BR][/BR][COLOR=#9365b8]player_id INT,[/COLOR][BR][/BR][COLOR=#9365b8]mob_vnum INT,[/COLOR][BR][/BR][COLOR=#9365b8]kill_count INT DEFAULT 0[/COLOR][BR][/BR][COLOR=#9365b8]);[/COLOR]
Interaction with Python GUI
To make this system user-friendly, an interface can be designed using Py Root. Players can see how many more kills they need under the 'My Goals' tab. This UI is developed using uiscript and integrated into the Python GUI system, providing real-time feedback to players.
Martysama and Other Tools
At Metin2 Lobby, tools like Martysama simplify compiling and testing such systems. Proper compilation is crucial to avoid synchronization issues between auth and game server.
Conclusion
The 'Kill X Ys and Win Z Ts' system is a powerful tool for increasing player engagement in Metin2 private servers. Combining C++ for backend logic and Python for frontend UI creates robust and flexible systems. Careful attention during source edits and thorough testing are essential.
