Metin ve moba vurmaya başladığınızda sayaç gözüküyor ve saymaya başlıyor.[/FONT]
Alıntı : 1-120 paylaştıgım filesdan sökülmüştür.
Alıntı : 1-120 paylaştıgım filesdan sökülmüştür.
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.
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 Mob Attack Sayaç Sistemi Nedir ve Nasıl Geliştirilir?
Metin2 özel sunucularında oyuncu deneyimini artırmak için geliştirilen sistemlerden biri olan Mob Attack Sayaç, PvP odaklı sunucularda sıklıkla tercih edilir.
Bu sistem sayesinde oyuncuların moblar tarafından saldırıya uğrama sayısı takip edilebilir ve buna göre çeşitli bonuslar veya cezalar uygulanabilir. Bu yazıda, Mob Attack Sayaç özelliğini nasıl geliştireceğinizi, hangi dosyalar üzerinde değişiklik yapmanız gerektiğini ve sistemin genel işleyişini detaylı olarak ele alacağız.
Mob Attack Sayaç Sisteminin Temeli
Mob Attack Sayaç, genellikle game core kısmında geliştirilir. Sistem, oyuncuya has bir sayaç tutar. Oyuncu bir mob tarafından saldırıya uğradığında sayaç belirli bir miktar artar. Bu sayaç, belirli bir limite ulaştığında, oyuncuya özel efektler, düşmanlık seviyesi artışı ya da PvP avantajları gibi durumlar devreye girebilir.
Sistem Geliştirme Adımları
1. Database (DB) Değişikliği
Öncelikle, her karakterin sayaç değerini saklayabilmek için player DB tablosuna yeni bir alan eklenmelidir. Örneğin:
Kod:
ALTER TABLE player ADD COLUMN mob_attack_counter INT DEFAULT 0;
Bu işlem sayesinde her karakterin sayaç değeri veritabanında tutulur.
2. Game Sunucusu Tarafında Kodlama
MobAttack Sayaç sistemi genellikle C++ ile geliştirilir. char_battle.cpp veya benzeri dosyalarda, bir mob karaktere saldırınca sayaç artıran bir fonksiyon tanımlanmalıdır.
Kod:
void CHARACTER::IncreaseMobAttackCounter() {
Kod:
m_iMobAttackCounter++;
Kod:
// Save to DB
Kod:
SaveMobAttackCounter();
Kod:
}
Bu fonksiyon, mob tarafından saldırı yapıldığında çağrılır. Ayrıca sayaç değeri her artışta veritabanına yazılmalıdır ki oyuncu tekrar giriş yaptığında değer korunsun.
3. Client Tarafında Gösterim
Oyuncunun sayaç değerini görebilmesi için uiscript dosyalarında GUI geliştirilmelidir. Python ve PyGUI kullanarak sayaç değerini gösteren bir pencere oluşturulabilir.
Örnek bir Python GUI kod parçası:
Kod:
import ui
Kod:
class MobAttackCounterWindow(ui.ScriptWindow):
Kod:
def __init__(self):
Kod:
ui.ScriptWindow.__init__(self)
Kod:
self.CounterValue = 0
Kod:
def LoadWindow(self):
Kod:
self.CounterValue = net.GetMobAttackCounter()
Kod:
self.CounterText.SetText('Sayaç: %d' % self.CounterValue)
4. PvP ve Sistem Entegrasyonu
Sayaç belirli bir değere ulaştığında oyuncunun PvP durumu değişebilir. Örneğin, sayaç 100'e ulaştığında PvP moduna otomatik geçiş yapılabilir veya moblar tarafından saldırıya uğramış bir karakter PvP'de daha fazla hasar alabilir.
Bu tür kurallar game server programming kısmında tanımlanır ve martysama veya diğer sistemlerle entegre edilerek test edilir.
Sistem Avantajları
Mob Attack Sayaç sistemi sayesinde:
- Oyuncuların PvP'ye yönlendirilmesi sağlanabilir.
- Mob saldırılarına karşı farkındalık artırılır.
- Sunucuda daha aktif PvP ortamı oluşur.
- Anti-grind sistemleri geliştirilebilir.
Sonuç
Mob Attack Sayaç, Metin2 özel sunucularında deneyimi zenginleştiren güçlü bir özelliktir. C++, Python, DB ve Client tarafında yapılan değişikliklerle kolayca entegre edilebilir. Bu sistem, özellikle PvP odaklı sunucularda büyük avantaj sağlar ve oyuncu etkileşimini artırır.
What is the Mob Attack Counter System in Metin2 and How to Develop It?
The Mob Attack Counter is one of the systems developed to enhance the player experience on Metin2 private servers, especially preferred in PvP-oriented servers.
Thanks to this system, the number of times a player is attacked by monsters can be tracked and various bonuses or penalties can be applied accordingly. In this article, we will detail how to develop the Mob Attack Counter feature, which files need modification, and how the system works overall.
Foundation of the Mob Attack Counter System
The Mob Attack Counter is typically developed within the game core. The system maintains a player-specific counter. When a monster attacks a player, the counter increases by a certain amount. When the counter reaches a specific limit, special effects for the player, increased hostility levels, or PvP advantages may come into play.
Development Steps
1. Database (DB) Modification
Firstly, a new field must be added to the player DB table to store the counter value for each character. For example:
Kod:
ALTER TABLE player ADD COLUMN mob_attack_counter INT DEFAULT 0;
With this change, the counter value of each character is stored in the database.
2. Coding on the Game Server Side
The MobAttack Counter system is usually developed with C++. In files like char_battle.cpp, a function that increments the counter when a monster attacks a player should be defined.
Kod:
void CHARACTER::IncreaseMobAttackCounter() {
Kod:
m_iMobAttackCounter++;
Kod:
// Save to DB
Kod:
SaveMobAttackCounter();
Kod:
}
This function is called whenever a monster attacks. Additionally, the counter value must be saved to the database after each increment so that the value remains upon re-login.
3. Display on the Client Side
To allow players to see their counter value, a GUI should be created in uiscript files. Using Python and PyGUI, a window showing the counter can be built.
An example Python GUI code snippet:
Kod:
import ui
Kod:
class MobAttackCounterWindow(ui.ScriptWindow):
Kod:
def __init__(self):
Kod:
ui.ScriptWindow.__init__(self)
Kod:
self.CounterValue = 0
Kod:
def LoadWindow(self):
Kod:
self.CounterValue = net.GetMobAttackCounter()
Kod:
self.CounterText.SetText('Counter: %d' % self.CounterValue)
4. PvP and System Integration
When the counter reaches a certain value, the player's PvP status might change. For instance, once the counter hits 100, the player could automatically switch to PvP mode or take more damage in PvP after being attacked by monsters.
Such rules are defined during game server programming and tested integrated with systems like martysama.
System Advantages
Thanks to the Mob Attack Counter system:
- Players can be directed toward PvP activities.
- Awareness against monster attacks increases.
- A more active PvP environment is created on the server.
- Anti-grinding systems can be implemented.
Conclusion
The Mob Attack Counter is a powerful feature that enriches the experience on Metin2 private servers. It can be easily integrated through modifications on the C++, Python, DB, and Client sides. This system provides significant benefits especially on PvP-oriented servers and enhances player interaction.
