Kod:
Smokin veya gelinlik giyiliyken bineğe binemezsiniz. Binek takılıysada onları giyemezsiniz. // char.cpp Aratın: bool CHARACTER::Mount Hemen fonksiyonun başına { LPITEM bodyCostume = GetWear(WEAR_COSTUME_BODY); if (bodyCostume && (bodyCostume->GetVnum() == 71145 || bodyCostume->GetVnum() == 71146)) { ChatPacket(CHAT_TYPE_INFO, "Smokin veya Gelinlik giyiliyken bineğe binemezsiniz."); return false; } ekleyin. Sonra // char_item.cpp Aratın: bool CHARACTER::EquipItem( { fonksiyon içinde: if (!item) return false; //altına yapıştırın: if (item->GetVnum() == 71145 || item->GetVnum() == 71146) { if (IsRiding()) { ChatPacket(CHAT_TYPE_INFO, "Binek üzerindeyken Smokin veya Gelinlik giyemezsiniz."); return false; } }
Smokin veya Gelinlik Giyiliyken Binek Engelleme FIX
Metin2 özel sunucularında kullanıcı deneyimini artırmak adına geliştirilen sistemlerden birisi de oyuncuların belirli durumlarda binek kullanmasını engellemektir. Bu özellikle smokin ya da gelinlik gibi özel kıyafetler giyildiğinde devreye girmelidir. Ancak bazı sunucularda bu sistem doğru şekilde entegre edilmemiştir ve oyuncular bu kıyafetler giydikten sonra dahi at veya diğer binekleri kullanabilmektedir. Bu durum, hem estetik hem de oyun içi denge açısından istenmeyen bir durumdur. Bu yazıda, smokin veya gelinlik giyildiğinde binek kullanımını engelleyen FIX'i nasıl uygulayacağınızı adım adım anlatacağız.
Sorun Nedir?
Metin2 özel sunucularında bazı özel kostümler, örneğin smokin veya gelinlik gibi kıyafetler giyildiğinde, oyuncuların binek kullanması estetik açıdan uygun görülmemektedir. Ancak mevcut sistemlerde bu durum kontrol edilmiyor olabilir. Oyuncu bu kostümleri giymiş olsa bile atına binip gezinebilir. Bu da oyun içi atmosferi bozabilir ve bazı sunucularda dengesizliklere neden olabilir.
FIX Nasıl Uygulanır?
Bu sorunu çözmek için hem client hem de game server tarafında değişiklik yapılması gerekir. İlk olarak, hangi item ID'lerinin smokin ve gelinlik olduğu belirlenmelidir. Bu ID'ler genellikle item_proto dosyasında yer alır. Örnek olarak smokin ID 1001, gelinlik ID 1007 kabul edilebilir.
Client Tarafında Yapılacaklar:
root/uitooltip.py dosyasında, binek sistemine erişim kontrol edilir. Burada MountHelper.CanMount() fonksiyonu üzerine bir kontrol eklenmelidir. Eğer oyuncunun üzerinde smokin veya gelinlik varsa, binek kullanmasına izin verilmemelidir.
Game Sunucusunda Yapılacaklar:
game/src/char.cpp dosyasında, oyuncunun binek sistemine erişimi kontrol edilir. CMD_MOUNT komutu geldiğinde, oyuncunun üzerinde smokin veya gelinlik varsa bu komut reddedilmelidir. Bu işlem için özel bir kontrol fonksiyonu yazılması önerilir.
Örnek Kod Parçası (Python):
def can_mount(self):
if self.has_costume_equipped():
return False
return True
Örnek Kod Parçası (C++):
bool CHARACTER::CanMount() const {
if (IsWearingSpecialCostume()) {
return false;
}
return true;
}
Test Aşaması
Değişiklikler yapıldıktan sonra, hem smokin hem de gelinlik giyilmişken binek kullanılmaya çalışılmalıdır. Sistem doğru çalışıyorsa, oyuncu bineğe binmeye çalıştığında bir hata mesajı almalı ya da komut iptal edilmelidir. Bu testi farklı karakterlerle ve farklı sahnelerde yapmanız önerilir.
Sonuç
Smokin veya gelinlik giyildiğinde binek kullanımını engellemek, Metin2 özel sunucularında kullanıcı deneyimini artıran küçük ama önemli bir özelliktir. Bu FIX sayesinde hem görsel bütünlük korunur hem de oyun içi dengeler desteklenir. Bu sistemi doğru şekilde entegre etmek için C++ ve Python bilgisi gerekebilir. Ancak bu işlem bir defa doğru yapıldığında uzun vadede büyük kolaylıklar sağlar.
Fix for Blocking Mount When Wearing Smoking or Bridal Dress
In Metin2 private servers, one of the systems developed to enhance user experience is preventing players from using mounts under certain conditions. This should especially apply when wearing special outfits like smoking or bridal dress. However, on some servers this system may not be properly integrated, allowing players to still ride mounts even while wearing these costumes. This situation is undesirable both aesthetically and in terms of game balance. In this article, we will explain step by step how to implement the FIX that prevents mount usage when smoking or bridal dress is equipped.
What Is The Problem?
On Metin2 private servers, certain special costumes, such as smoking or bridal dresses, are not intended to be worn while riding mounts for aesthetic reasons. However, the current system might not check for this condition. Players may still be able to ride horses or other mounts even while wearing these costumes, which can break immersion and cause imbalances in some servers.
How To Apply The FIX?
To solve this issue, modifications need to be made on both the client and game server sides. First, identify the item IDs for smoking and bridal dresses. These IDs are usually located in the item_proto file. For example, assume smoking ID is 1001 and bridal dress ID is 1007.
Client Side Modifications:
In the root/uitooltip.py file, access to the mount system is controlled. Here, a check should be added to the MountHelper.CanMount() function. If the player is wearing a smoking or bridal dress, they should not be allowed to use a mount.
Server Side Modifications:
In the game/src/char.cpp file, the player's access to the mount system is checked. When the CMD_MOUNT command is issued, if the player is wearing a smoking or bridal dress, the command should be rejected. It is recommended to write a custom control function for this purpose.
Sample Code (Python):
def can_mount(self):
if self.has_costume_equipped():
return False
return True
Sample Code (C++):
bool CHARACTER::CanMount() const {
if (IsWearingSpecialCostume()) {
return false;
}
return true;
}
Testing Phase
After the changes have been applied, attempt to use mounts while wearing both smoking and bridal dresses. If the system works correctly, the player should receive an error message or the mount command should be canceled. Testing with different characters and scenarios is recommended.
Conclusion
Preventing mount usage while wearing smoking or bridal dresses is a small but important feature that enhances user experience on Metin2 private servers. With this FIX, visual consistency is maintained and game balance is supported. Integrating this system correctly may require knowledge of C++ and Python. However, once implemented correctly, it provides long-term benefits.
