Öncelikle aşağıdaki konudan farklıdır. Ek olarak duyuruda item yansıtma bulunmaktadır.
Kod:
ITEM_MANAGER::instance().RemoveItem(item, "REMOVE (REFINE SUCCESS)");
Bu koddan 2 tane bulunmakta 2sinede eklemeniz gerekiyor
altına ekle
Kod:
int m_nTableMin[*] = {268, 238, 228, 218, 181, 191}; int m_nTableMax[*] = {269, 239, 229, 219, 189, 199}; for (int i = 0; i < _countof(m_nTableMin); i++){ for (int j = 0; j < _countof(m_nTableMax); j++){ if (m_nTableMin[i] <= pkNewItem->GetVnum() && pkNewItem->GetVnum() <= m_nTableMax[j]){ char buf[1024]; char itemlink[256]; int len; len = snprintf(itemlink, sizeof(itemlink), "item:%x:%x:%x:%x:%x", pkNewItem->GetVnum(), pkNewItem->GetFlag(), pkNewItem->GetSocket(0), pkNewItem->GetSocket(1), pkNewItem->GetSocket(2)); for (int i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; ++i) if (pkNewItem->GetAttributeType(i) != 0){ len += snprintf(itemlink + len, sizeof(itemlink) - len, ":%x:%d", pkNewItem->GetAttributeType(i), pkNewItem->GetAttributeValue(i)); } snprintf(buf, sizeof(buf), "|cffffc700|H%s|h[%s]|h|r", itemlink, pkNewItem->GetName()); break; char szUpgradeAnnouncement[QUERY_MAX_LEN]; snprintf(szUpgradeAnnouncement, sizeof(szUpgradeAnnouncement), "[CH%d]: [%s] İtemini Başarıyla Geliştirdi!! %s ", g_bChannel, GetName(), buf); BroadcastNotice(szUpgradeAnnouncement); break; } } }
Metin2 Lobby - İstediğiniz İteme +Basınca Duyuru (İtemi Yansıtmalı)
Metin2 özel sunucularında geliştirme yaparken kullanıcı deneyimini artırmak için birçok sistem geliştirilir. Bu sistemlerden biri de istenen iteme +basınca duyuru sistemidir. Bu sistem sayesinde oyuncular belirli bir itemi +ladıklarında, sunucuda özel bir duyuru mesajı yayınlanabilir. Bu duyuru hem o anki odayı hem de sunucu çapında tüm oyuncuları kapsayabilir. Bu yazıda, Metin2 Lobby olarak bu sistemi nasıl kurabileceğinizi, hangi dosyaların düzenleneceğini ve nasıl daha da geliştirilebileceğini detaylıca ele alacağız.
Sistem Nedir?
Bu sistem sayesinde, oyuncuların elinde bulunan belirli bir itemi +laması durumunda, sunucuda otomatik olarak bir duyuru yapılır. Örneğin, bir oyuncu 'Güçlü Ejderha Zırhı' isimli itemi +ladığında, 'Oyuncu X, Güçlü Ejderha Zırhı ile sunucuda parladı!' gibi bir duyuru yapılabilir. Ayrıca itemin hangi + seviyesinde olduğu da duyurulabilir.
Neden Kullanılır?
Bu tür sistemler, oyuncuların dikkatini çekmek, sunucuda rekabet atmosferi yaratmak ve özel item sahiplerini öne çıkarmak için idealdir. Özellikle PvP sunucularında, yüksek + değerlerine sahip itemleri olan oyuncuların gösteriş yapabilmesi için bu sistem oldukça işlevseldir.
Sistem Nasıl Kurulur?
Bu sistemin kurulumu için hem game server hem de client tarafında bazı değişiklikler yapılması gerekir. Sistem genellikle Python ve C++ tabanlıdır. Oyuncu bir itemi +ladığında, client tarafından bir paket gönderilir. Game server bu paketi alır ve gerekli kontrolleri yaptıktan sonra duyuru mesajını gönderir.
Örnek Kod Yapısı (Python - Client Tarafı)
Client tarafında, UI Script veya Py Root üzerinde iteme + yapıldığında çalışacak fonksiyon tanımlanmalıdır. Bu fonksiyon, itemin ID'sini, + seviyesini ve kullanıcı adını sunucuya göndermelidir. Bu işlem genellikle bir network paketi üzerinden gerçekleştirilir.
C++ Sunucu Tarafı
Sunucu tarafında, gelen paket kontrol edilir. Eğer itemin ID'si listede varsa ve + seviyesi belirlenen eşiği geçmişse, global bir duyuru mesajı gönderilir. Bu duyuru genellikle tüm oyunculara broadcast edilir. Ayrıca, itemin görseli veya ismi de duyuruya yansıtılabilir.
Yansıtmalı Duyuru Nedir?
Yansıtmalı duyuru, itemin gerçek adı ve görselinin de duyuruya dahil edildiği gelişmiş bir sistemdir. Bu sayede duyurulan itemin hem ismi hem de grafiksel temsili kullanıcılar tarafından görülebilir. Bu işlem için client tarafında bir GUI arayüzü tasarlanmalı ve sunucu ile senkronize edilmelidir.
Sistemin Avantajları
- Oyuncu motivasyonunu artırır.
- Sunucu etkinliğini yükseltir.
- Rekabeti teşvik eder.
- Görsel etki sağlar.
Geliştirme İpuçları
Sistemi daha da geliştirmek isterseniz:
- Belirli itemler için özel efektler ekleyin.
- Duyuruyu sadece belirli haritalarda gösterin.
- Oyuncuya özel ses efekti çalın.
- Duyurulan itemlerin listesini loglayın.
Sonuç
İstediğiniz iteme +basınca duyuru sistemi, Metin2 özel sunucularında kullanıcı deneyimini ciddi anlamda artırabilecek etkileyici bir özelliktir. Doğru uygulandığında, oyuncuların daha aktif olmasını sağlayabilir ve sunucunuzun popülerliğini artırabilir. Metin2 Lobby olarak, bu gibi sistemleri sunucunuza entegre etmede uzman kadromuzla yardımcı olmaktan mutluluk duyarız.
Metin2 Lobby - Announcement on Desired Item Enhancement (+ System with Visual Reflection)
When developing custom Metin2 servers, many systems are created to enhance user experience. One such system is the announcement on desired item enhancement (+). With this system, players can trigger a special announcement in the game when they enhance a specific item. This announcement can cover both the current room and all players across the entire server. In this article, we will explain how to set up this system, which files need modification, and how to improve it further at Metin2 Lobby.
What Is The System?
With this system, when a player enhances a specific item, an automatic announcement is made on the server. For example, when a player enhances an item named 'Powerful Dragon Armor', an announcement like 'Player X shines in the server with the Powerful Dragon Armor!' can be triggered. Additionally, the + level of the item can also be included in the announcement.
Why Use It?
Such systems are ideal for grabbing attention, creating a competitive atmosphere, and highlighting players who own special items. Especially in PvP servers, this system allows players with high + items to show off effectively.
How Is It Set Up?
Setting up this system requires modifications on both the game server and client sides. The system is typically based on Python and C++. When a player enhances an item, the client sends a packet. The game server receives this packet, performs necessary checks, and then sends the announcement message.
Sample Code Structure (Python - Client Side)
On the client side, a function must be defined to run when an item is enhanced. This function should send the item ID, + level, and username to the server via a network packet.
C++ Server Side
On the server side, the incoming packet is checked. If the item ID exists in the list and its + level exceeds the defined threshold, a global announcement is sent. This announcement is usually broadcasted to all players. Moreover, the item's name and visual representation can also be included in the announcement.
What Is a Reflective Announcement?
A reflective announcement includes the actual name and graphic of the item in the announcement. This allows users to see both the name and visual representation of the announced item. To achieve this, a GUI interface must be designed on the client side and synchronized with the server.
Advantages of the System
- Increases player motivation.
- Enhances server activity.
- Encourages competition.
- Provides visual impact.
Development Tips
To further enhance the system:
- Add special effects for certain items.
- Show the announcement only in specific maps.
- Play custom sound effects for the player.
- Log the list of announced items.
Conclusion
The announcement on desired item enhancement system is an impressive feature that can significantly enhance user experience on custom Metin2 servers. When implemented correctly, it can encourage more active participation from players and boost your server's popularity. At Metin2 Lobby, we are happy to assist with integrating such systems into your server with our expert team.
