MaviAyGames | [C++] IsBoss Sorgusu

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 33

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Merhabalar, ronark sistemini yazarken Boss olup olmadığını kontrol etmek için bi sorgu gerekiyodu o da mevcut dosyalarda bulunmuyordu IsStone() olmasına rağmen IsBoss() yoktu.


//char.h açın

//Aratın

Kod:
IsStone


// Altına ekleyin

Kod:
bool IsBoss() const {    return GetMobRank() >= MOB_RANK_BOSS; }

MaviAyGames | [C++] IsBoss Sorgusu

Metin2 özel sunucularında oyun içi boss karakterlerin tespiti oldukça önemli bir yapıdır. Bu tespit sayesinde sistemsel olarak oyun içinde özel olaylar, ödül dağıtımları veya PvP aktiviteleri aktif hale getirilebilir. Bu yazıda, MaviAyGames tarafından geliştirilen bir IsBoss sorgusunun nasıl çalıştığını ve C++ tabanlı sunucu tarafında nasıl entegre edildiğini inceleyeceğiz.

IsBoss Nedir?

IsBoss, Metin2 özel sunucu geliştiricilerinin kullanabileceği bir fonksiyondur. Bu fonksiyon, belirli bir karakterin boss olup olmadığını kontrol eder. Özellikle PvP sistemlerinde, boss karakterlerin öldürülmesiyle ilgili özel etkinlikler başlatılabilir. Örneğin, bir boss öldürüldüğünde harita genelinde duyuru yapılabilir ya da belirli oyunculara özel ödüller verilebilir.

C++ ile IsBoss Entegrasyonu

Metin2 özel sunucularında, genellikle game server tarafında C++ kullanılır. Bu bağlamda, IsBoss sorgusu doğrudan C++ tabanlı source code içine gömülür. Bu işlem sırasında, mob_data veya char_data gibi yapılar üzerinden kontrol yapılır. Aşağıda basit bir örnek sunulmuştur:

Kod:
bool IsBoss(LPCHARACTER ch)[BR][/BR]{[BR][/BR]    if (!ch || !ch->IsNPC()) return false;[BR][/BR][BR][/BR]    int mobVnum = ch->GetRaceNum();[BR][/BR][BR][/BR]    // Boss VNUM listesi[BR][/BR]    static std::set<int> bossList = {1000, 1007, 1030, 1050};[BR][/BR][BR][/BR]    return bossList.find(mobVnum) != bossList.end();[BR][/BR]}


Faydalı Notlar

Bu yapıyı kullanırken dikkat etmeniz gereken bazı önemli konular vardır:

- Mob VNUM değerlerini doğru şekilde tanımlamalısınız. Aksi takdirde, doğru boss tespiti yapılamaz.
- Fonksiyonun performansı önemlidir. Çok sayıda NPC ile çalışan sunucularda, bu tespit işlemi optimize edilmelidir.
- Martysama gibi deneyimli geliştiricilerin önerdiği yöntemler doğrultusunda, bu tür sistemlerin DB ile entegre çalışması daha esnek sonuçlar verebilir.

Özet

IsBoss sorgusu, Metin2 özel sunucularında PvP aktiviteleri, olay yönetimi ve özel ödüller için kritik bir rol oynar. Doğru şekilde C++ ile entegre edildiğinde, güçlü ve esnek sistemler geliştirilebilir. Bu tür sistemlerin geliştirilmesi için hem server-side hem de client-side bilgi sahibi olmanız önerilir.

Kaynak Kod Paylaşımı

MaviAyGames tarafından geliştirilen bu tür sistemlerin örnek kaynak kodları, Metin2 Lobby adresinden erişilebilir. Bu platformda, C++, Python, uiscript, py root, pack ve diğer gelişmiş sistemlerle ilgili kaynaklar bulabilirsiniz.


MaviAyGames | [C++] IsBoss Query

Detecting boss characters in Metin2 private servers is a very important structure. This detection allows special events, reward distributions, or PvP activities to be activated systemically within the game. In this article, we will examine how the IsBoss query developed by MaviAyGames works and how it is integrated into the C++ based server side.

What is IsBoss?

IsBoss is a function that can be used by Metin2 private server developers. This function checks whether a specific character is a boss. Especially in PvP systems, special events can be triggered when a boss is killed. For example, announcements can be made across the map when a boss is defeated, or special rewards can be given to certain players.

Integration of IsBoss with C++

In Metin2 private servers, C++ is generally used on the game server side. In this context, the IsBoss query is embedded directly into the C++ based source code. During this process, the check is performed through structures such as mob_data or char_data. A simple example is provided below:

Kod:
bool IsBoss(LPCHARACTER ch)[BR][/BR]{[BR][/BR]    if (!ch || !ch->IsNPC()) return false;[BR][/BR][BR][/BR]    int mobVnum = ch->GetRaceNum();[BR][/BR][BR][/BR]    // Boss VNUM list[BR][/BR]    static std::set<int> bossList = {1000, 1007, 1030, 1050};[BR][/BR][BR][/BR]    return bossList.find(mobVnum) != bossList.end();[BR][/BR]}


Useful Notes

There are some important points to consider when using this structure:

- You must correctly define the Mob VNUM values. Otherwise, the correct boss detection cannot be done.
- The performance of the function is important. On servers with many NPCs, this detection process should be optimized.
- According to methods suggested by experienced developers like Martysama, integrating such systems with DB can provide more flexible results.

Summary

The IsBoss query plays a critical role in PvP activities, event management, and special rewards in Metin2 private servers. When correctly integrated with C++, powerful and flexible systems can be developed. It is recommended that you have knowledge of both server-side and client-side to develop such systems.

Source Code Sharing

Example source codes for systems like this developed by MaviAyGames are available at Metin2 Lobby. On this platform, you can find resources related to C++, Python, uiscript, py root, pack, and other advanced systems.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt