- Katılım
- 6 Mayıs 2022
- Konular
- 48,270
- Mesajlar
- 48,580
- Tepkime puanı
- 74
- M2 Yaşı
- 3 yıl 11 ay 10 gün
- Trophy Puan
- 48
- M2 Yang
- 488,669
Metin2’ye özgün bir “Item Yaşlanma + Repair” sistemi yaptık.
- <li data-xf-list-type="ul">Itemler kullanıldıkça yıpranıyor <li data-xf-list-type="ul">Repair yapılmazsa renk değiştiriyor (yeşil → sarı → kırmızı) <li data-xf-list-type="ul">Tamir edilmezse item yok oluyor <li data-xf-list-type="ul">Demirciye gidip bakım (repair) yaptırıyorsun <li data-xf-list-type="ul">Itemler geçmişini hafızada tutuyor (PK, boss, kullanım) <li data-xf-list-type="ul">PvP yaparsan item daha hızlı eskir <li data-xf-list-type="ul">Bazı itemler efsane oluyor, düşmüyor <li data-xf-list-type="ul">UI, ikonlar, kurulum ve fix’ler hazır
Özetle:
Kopya Metin2 değil, itemi olan değil itemine bakan kazanıyor.
Kod:
enum EItemRepairFlags { ITEM_REPAIR_MAX = 100, }; class CItem { public: int GetRepair() const { return m_iRepair; } void SetRepair(int r) { m_iRepair = MINMAX(0, r, ITEM_REPAIR_MAX); } int GetRepairCount() const { return m_iRepairCount; } void IncreaseRepairCount() { ++m_iRepairCount; } int GetMemoryPK() const { return m_iMemoryPK; } void IncreaseMemoryPK() { ++m_iMemoryPK; } bool IsLegendary() const { return m_bLegendary; } void SetLegendary(bool b) { m_bLegendary = b; } protected: int m_iRepair; int m_iRepairCount; int m_iMemoryPK; bool m_bLegendary; };
Kod:
void CHARACTER::OnKillRepair(LPITEM item, bool bPK) { if (!item || !item->IsEquipped()) return; int loss = bPK ? 2 : 1; if (IsDuel() || IsGuildWar()) loss /= 2; item->SetRepair(item->GetRepair() - loss); if (bPK) item->IncreaseMemoryPK(); if (item->GetRepair() <= 0) { SendChatPacket(CHAT_TYPE_NOTICE, "Item dayanamadi ve parcalandi!"); ITEM_MANAGER::instance().DestroyItem(item); } }
Kod:
void CItem::FinalBurst(LPCHARACTER owner) { if (!owner) return; owner->EffectPacket(SE_CRACK_EFFECT); if (m_iMemoryPK > 50) { owner->Damage(owner, 500, DAMAGE_TYPE_MAGIC); } }
Kod:
item->FinalBurst(item->GetOwner());
Kod:
quest repair_system begin state start begin when 20016.chat."Item Tamiri (Repair)" begin local item = pc.get_item_id() if item == 0 then say("Item secmelisin.") return end if item.get_repair() <= 0 then say("Bu item kurtarilamaz.") return end local cost = item.get_level() * 100000 say("Tamir bedeli: "..cost.." Yang") if pc.gold < cost then say("Yeterli Yang yok.") return end pc.change_gold(-cost) item.set_repair(100) item.add_repair_count() say("Item tamir edildi.") end end end
Kod:
repair = item.GetRepair() if repair <= 30: self.AppendTextLine("Repair: %d (KRITIK)" % repair, 0xffc0392b) elif repair <= 70: self.AppendTextLine("Repair: %d (YIPRANMIS)" % repair, 0xfff1c40f) else: self.AppendTextLine("Repair: %d (SAGLAM)" % repair, 0xff2ecc71)
Kod:
void CItem::CheckLegendary() { if (m_iMemoryPK >= 100 && m_iRepairCount >= 10) { m_bLegendary = true; SetAntiFlag(ITEM_ANTIFLAG_DROP); SetAntiFlag(ITEM_ANTIFLAG_TRADE); } }
Kod:
/repair_set 0 /repair_set 100
Kod:
quest repair_system begin state start begin when 20016.chat."Item Tamiri (Repair)" begin say_title("Demirci") say("Tamir edilecek itemi takılı halde olmalı.") -- Silah slotu (0) örnek, istersen zırh için 1 yaparsın local wear_slot = 0 local item_vnum = pc.get_wear(wear_slot) if item_vnum == 0 then say("Üzerinde tamir edilecek item yok.") return end local repair = item.get_repair() if repair <= 0 then say("Bu item artık kurtarılamaz.") return end local cost = item.get_level() * 100000 say("Mevcut Repair: "..repair) say("Tamir Bedeli: "..cost.." Yang") local s = select("Tamir Et", "İptal") if s == 2 then return end if pc.gold < cost then say("Yeterli Yang yok.") return end pc.change_gold(-cost) item.set_repair(100) item.add_repair_count() say("Item başarıyla tamir edildi.") end end end
Metin2 Sunucularında RepairSystem Nedir ve Nasıl Kullanılır?
Metin2 özel sunucularında sistemsel stabilite ve oyuncu deneyimi açısından kritik öneme sahip olan RepairSystem, oyun içi hatalı ya da bozuk verileri onarmak için geliştirilmiş bir C++ tabanlı otomatik sistemdir.
Bu sistem genellikle game sunucusunda çalıştırılır ve oyuncuların envanterinde, karakter verilerinde ya da eşya durumlarında meydana gelen uyuşmaları veya çakışmaları düzeltmek için kullanılır. Özellikle PvP odaklı sunucularda, savaşlar sonrası ortaya çıkabilecek veri bozulmalarını engeller ve oyun dengesini korur.
RepairSystem'in Temel Özellikleri:
- Oyuncu envanterindeki eşya verilerini kontrol eder.
- Silah, zırh gibi eşyaların özelliklerindeki uyuşmaları düzeltir.
- Karakter seviyesiyle uyuşmayan itemleri tespit edip onarır.
- DB (veritabanı) ile eşleşmeyen verileri temizler.
Kurulum ve Yapılandırma
RepairSystem, genellikle py root dizinine entegre edilerek, belirli zaman aralıklarında ya da manuel olarak çalıştırılır. Bu işlem sırasında Python GUI tabanlı bir arayüzle de desteklenebilir. Sistem, Martysama tarafından geliştirilen bazı scriptlerle de genişletilebilir.
Kurulum için öncelikle C++ source dosyaları düzenlenmelidir. Game server programming bilgisi gerektiren bu adım, sunucu yapılandırmasında deneyimli geliştiriciler tarafından yapılmalıdır. Sistemin doğru çalışması için auth ve game sunucuları arasında veri bütünlüğünün sağlanması gerekir.
Otomatik Onarım İşlemi
Sistem aktif edildiğinde, oyuncuların giriş yaparken karşılaştığı veri kontrolleri sayesinde hatalar tespit edilir. Bu süreçte db core ve game core bileşenleri arasındaki veri akışı analiz edilir. Uyuşan veriler otomatik olarak onarılır, oyuncuya bilgi mesajı gönderilir.
Metin2 geliştirme sürecinde RepairSystem, hem sunucu kararlılığını artırır hem de oyuncuların veri kaybını önler. Özellikle channel tabanlı sunucularda, her kanalda ayrı ayrı çalışabilen bu sistem, sunucu yönetimini kolaylaştırır.
Sonuç
RepairSystem, Metin2 özel sunucularında veri bütünlüğü ve kararlılık açısından önemli bir rol oynar. Metin2Dev toplulukları tarafından sıkça tercih edilir ve source edit süreçlerinde vazgeçilmez bir araçtır. Sistem, pack ve uiscript ile birlikte kullanıldığında daha güçlü bir yapıya ulaşabilir.
What is RepairSystem and How to Use It in Metin2 Servers?
RepairSystem is a C++ based automatic system developed to fix corrupted or invalid data within the game in Metin2 private servers, playing a critical role in stability and player experience.
This system usually runs on the game server and fixes inconsistencies or conflicts in players' inventories, character data, or item states. Especially in PvP focused servers, it prevents data corruption after battles and maintains game balance.
Key Features of RepairSystem:
- Checks item data in player inventories.
- Fixes mismatches in attributes of weapons, armor, etc.
- Detects and repairs items not matching character levels.
- Cleans up data that does not match with the DB (database).
Installation and Configuration
RepairSystem is typically integrated into the py root directory and run at specific intervals or manually. During this process, it can be supported by a Python GUI interface. The system can also be extended using scripts developed by Martysama.
For installation, C++ source files must first be modified. This step requires game server programming knowledge and should be done by experienced developers familiar with server configurations. Ensuring data integrity between auth and game servers is crucial for proper operation.
Automatic Repair Process
When activated, the system detects errors during player logins through data checks. In this process, data flow between db core and game core components is analyzed. Matching data is automatically repaired and a notification message is sent to the player.
In the Metin2 development process, RepairSystem enhances both server stability and prevents data loss among players. Particularly in channel based servers, this system can run separately per channel, simplifying server management.
Conclusion
RepairSystem plays an important role in ensuring data integrity and stability in Metin2 private servers. It is frequently preferred by Metin2Dev communities and is an indispensable tool in source edit processes. When used together with pack and uiscript, the system becomes even more powerful.
