C++ Yerdeki İtemi Hızlı Toplama

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Arkdaşlar yerdeki item alma süresinin kaldırılmış halidir her şey açık ortada zaten kullanacak olan arkadaşlara iyi kullanımlar.
7793171c55686.gif

Kod:
client src/PythonPlayer.cpp aratılır void CPythonPlayer::SendClickItemPacket(DWORD dwIID) kod blogu komple değiştirilir
Kod:
void CPythonPlayer::SendClickItemPacket(DWORD dwIID) {     if (IsObserverMode())         return;         const char * c_szOwnerName;         if (!CPythonItem::Instance().GetOwnership(dwIID, &c_szOwnerName))         return;         if (strlen(c_szOwnerName) > 0)         if (0 != strcmp(c_szOwnerName, GetName()))         {             CItemData * pItemData;             if (!CItemManager::Instance().GetItemDataPointer(CPythonItem::Instance().GetVirtualNumberOfGroundItem(dwIID), &pItemData))             {                 Tracenf("CPythonPlayer::SendClickItemPacket(dwIID=%d) : Non-exist item.", dwIID);                 return;             }             if (!IsPartyMemberByName(c_szOwnerName) || pItemData->IsAntiFlag(CItemData::ITEM_ANTIFLAG_DROP | CItemData::ITEM_ANTIFLAG_GIVE))             {             PyCallClassMemberFunc(m_ppyGameWindow, "OnCannotPickItem", Py_BuildValue("()"));             return;             }         }         CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance();         rkNetStream.SendItemPickUpPacket(dwIID); }

C++ Yerdeki İtemi Hızlı Toplama Sistemi

Metin2 özel sunucularında oyun deneyimini artırmak için geliştiriciler sürekli yenilikler eklemektedir. Bu yeniliklerden biri de yerdeki itemleri hızlıca toplamak için geliştirilen sistemlerdir. Özellikle yoğun PvP ortamlarında veya raid savaşlarında bu özellik oyuncuların zaman kazanmasını sağlar. Bu yazıda C++ tabanlı bir hızlı item toplama sisteminin nasıl geliştirileceğini anlatacağız.

Hızlı Toplama Sisteminin Amacı

Metin2 oyununda öldürülen düşmanlardan veya sandıklardan çıkan itemler yere düşer. Oyuncular bu itemleri almak için tek tek üzerine gelip tıklamak zorundadır. Bu durum özellikle savaş esnasında büyük bir zaman kaybına neden olabilir. İşte tam burada devreye hızlı toplama sistemi girer. Bu sistem sayesinde oyuncu belirli bir menzildeki tüm itemleri tek bir komutla toplayabilir.

C++ Kaynak Kodlarıyla Entegrasyon

Metin2 özel sunucularında bu tür sistemler genellikle oyun sunucusunun game_core kısmında geliştirilir. C++ dilinde yazılmış olan bu sistem, oyuncu komutlarını dinler ve belirlenen mesafe içindeki itemleri toplama işlemi gerçekleştirir. Bu işlem sırasında db_core ile de haberleşilerek itemlerin doğru şekilde oyuncu envanterine aktarılması sağlanır.

Sistem Nasıl Çalışır?

Hızlı toplama sistemi şu adımlarla çalışır:
- Oyuncu bir komut gönderir (örneğin /topla).
- Sunucu bu komutu alır ve oyuncunun etrafındaki itemleri tarar.
- Belirlenen mesafe içindeki tüm itemleri bulur.
- Itemleri sırasıyla oyuncunun envanterine ekler.
- Gerekirse DB ile senkronize eder.

Geliştiriciye Özel Özellikler

Bu sistemi daha da geliştirmek isterseniz aşağıdaki eklemeler yapılabilir:

- Filtreleme: Belirli itemleri toplama veya atlanacak itemleri seçme özelliği.
- Toplama Menzili Ayarı[/BR]- Otomatik Satış: Değerli olmayan itemleri otomatik olarak satma.

Python ve C++ Arasında Entegrasyon

Bazı özel sunucularda Python ile yazılmış GUI (grafiksel arayüz) sistemleri de yer alabilir. Bu durumda C++ ile yazılmış olan backend sistemi ile Python GUI arasında iletişim kurulması gerekir. Bu iletişim genellikle py_root ve uiscript yapıları üzerinden yapılır.

Sonuç[/BR]
Metin2 özel sunucularında gelişmiş sistemler eklemek, hem oyuncuların hem de geliştiricilerin deneyimini artırır. Yerdeki itemi hızlı toplama sistemi gibi küçük ama etkili sistemler, oyun içi akışı ciddi anlamda iyileştirebilir. Bu tür sistemlerin geliştirilmesi için C++ bilgisi ve Metin2'nin yapısını iyi bilmeniz gerekir.


C++ Fast Ground Item Pickup System

In order to enhance the gaming experience on Metin2 private servers, developers constantly add new features. One of these innovations is systems designed to quickly collect items dropped on the ground. This feature especially saves time for players during intense PvP environments or raid battles. In this article, we will explain how to develop such a fast pickup system based on C++.

Purpose of the Fast Pickup System

In the Metin2 game, items drop on the ground after defeating enemies or opening chests. Players must individually click on each item to pick them up, which can cause significant delays, especially during combat. This is where the fast pickup system comes into play. It allows players to collect all items within a certain radius with a single command.

Integration with C++ Source Code

Such systems are typically developed within the game_core part of the Metin2 server, using C++. The system listens for player commands and performs the pickup operation for items located within a defined distance. During this process, communication with db_core ensures that items are correctly transferred to the player's inventory.

How Does the System Work?

The fast pickup system operates in the following steps:
- Player sends a command (e.g., /pickup).
- Server receives the command and scans for items around the player.
- Finds all items within the defined range.
- Adds the items sequentially to the player's inventory.
- Updates the database if necessary.

Custom Features for Developers

To further enhance the system, consider adding these features:

- Filtering: Ability to select which items to skip or only pickup specific ones.
- Pickup Range Configuration[/BR]- Auto-Sell: Automatically sell low-value items.

Integration Between Python and C++

In some private servers, Python-based GUI systems may also be implemented. In such cases, communication between the C++ backend and the Python-based UI must be established. This is usually handled via py_root and uiscript structures.

Conclusion

Adding advanced systems to Metin2 private servers enhances the experience for both players and developers. Small but effective systems like the fast ground item pickup can significantly improve in-game flow. Developing such systems requires knowledge of C++ and a good understanding of the Metin2 game structure.
 

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

Benzer konular

Geri
Üst Alt