[C++] QUICK SELL

  • 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


<a href=" " class="link link--external" target="_blank" rel="nofollow ugc noopener" data-proxy-href="/proxy.php?link=https%3A%2F%2Fwww.dosyaupload.com%2Fc6bz&amp;hash=e0c8409be8f7b6618c1daf2989e66e2e"> </a>

NOT : SİSTEM BANA AİT DEGİLDİR.
Metin2'de [C++] QUICK SELL Sistemi Geliştirme Rehberi

Metin2 özel sunucularında geliştirme yaparken oyuncuların deneyimini artırmak ve oyun içi ekonomiyi desteklemek adına bazı gelişmiş sistemler entegre edilir. Bu sistemlerden biri olan QUICK SELL sistemi, oyuncuların belirli bir süre içinde veya belirli koşullarda envanterindeki eşyaları hızlıca satabilmesini sağlar. Bu yazıda C++ tabanlı bir QUICK SELL sisteminin nasıl geliştirileceği ve Metin2 özel sunucu yapılarına nasıl entegre edileceği üzerinde duracağız.

QUICK SELL Nedir?
QUICK SELL, oyuncunun belirli bir arayüz üzerinden seçtiği eşyaları otomatik olarak NPC üzerinden satışa sunan bir özelliktir. Bu sistem, oyuncuların zaman kaybetmeden eşyalarını satabilmesini sağlar. Özellikle Metin2 gibi eşya yoğun oyunlarda, düşük değerli eşyaları hızlıca satarak depo alanını rahatlatmak büyük önem taşır.

Sistem Gereksinimleri
Bu sistemin çalışabilmesi için aşağıdaki bileşenlerin hazır olması gerekir:
- C++ tabanlı bir Game Server yapısı
- Oyun içi GUI sistemine entegrasyon (uiscript dosyaları)
- Eşya listeleme ve fiyat hesaplama mekanizması
- DBCore ile veritabanı bağlantısı

C++ Tarafında Kodlama[/CHARSET]
Öncelikle game/src/char_item.cpp dosyasında bir fonksiyon tanımlanır. Bu fonksiyon, oyuncunun seçtiği eşyaları alır ve her birinin satış fiyatını hesaplayarak NPC üzerinden satış yapar.

Kod:
[B]void CHARACTER::QuickSellItem(TPacketCGQuickSell * pkData){[BR][/BR]    for(int i = 0; i < pkData->ItemCount; ++i) {[BR][/BR]        LPITEM item = GetInventoryItem(pkData->Items[i].Cell);[BR][/BR]        if(item) {[BR][/BR]            DWORD price = item->GetVnum() * item->GetCount();[BR][/BR]            // Satış işlemi[BR][/BR]            PointChange(POINT_GOLD, price, false);[BR][/BR]            ItemDestroy(pkData->Items[i].Cell);[BR][/BR]        }[BR][/BR]    }[BR][/BR]}[/B]


Client Tarafında UI Entegrasyonu
Oyun istemcisi tarafında, QUICK SELL penceresi için bir uiscript dosyası hazırlanmalıdır. Bu dosya genellikle root/quick_sell.py gibi bir konumda yer alır ve oyuncuya eşya seçimi ve onaylama imkanı sunar.

Pencere Özellikleri:
- Çoklu eşya seçimi
- Her eşyanın adı, fiyatı ve miktarı
- Toplam fiyat gösterimi
- Onay ve iptal butonları

Veritabanı Entegrasyonu
Her eşyanın satış fiyatı, DBCore üzerinden veritabanından çekilebilir. Örneğin, item_proto tablosundaki gold değeri referans alınarak satış fiyatı belirlenebilir. Bu sayede sistem dinamik olarak eşya fiyatlarını güncelleyebilir.

SQL Örneği:
Kod:
[B]SELECT vnum, gold FROM item_proto WHERE type IN (0, 7, 8, 10);[/B]


Sistem Güvenliği
QUICK SELL sisteminin kötüye kullanımını önlemek için aşağıdaki kontroller yapılmalıdır:
- Eşyaların silinmeden önce tekrar kontrol edilmesi
- Zaman sınırlaması (örneğin, 5 dakikada bir kullanılabilir)
- Eşyaların sahiplik kontrolü

Sonuç:
Metin2 özel sunucularında QUICK SELL sistemi, oyuncu memnuniyetini artırırken sunucu ekonomisine de katkı sağlar. Doğru şekilde tasarlandığında, hem oyun içi deneyimi kolaylaştırır hem de geliştiriciye esneklik sunar. Bu sistem, C++ bilgisiyle birlikte uiscript ve DBCore bilgileriyle birleştirilerek güçlü bir şekilde entegre edilebilir.


Developing the [C++] QUICK SELL System in Metin2

When developing private servers for Metin2, various advanced systems are integrated to enhance player experience and support in-game economy. One such system is the QUICK SELL feature, which allows players to quickly sell items from their inventory under specific conditions or within a limited time. In this article, we will explore how to develop a QUICK SELL system based on C++ and integrate it into Metin2 private server structures.

What is QUICK SELL?
QUICK SELL is a feature that allows players to automatically sell selected items through an NPC via a specific interface. This system enables players to sell their items without wasting time. In games like Metin2 where item management is crucial, selling low-value items quickly helps free up storage space.

System Requirements
To operate this system, the following components must be ready:
- A Game Server built with C++
- Integration into the in-game GUI system (uiscript files)
- An item listing and pricing mechanism
- Connection to database via DBCore

Coding on the C++ Side
Firstly, a function is defined in the game/src/char_item.cpp file. This function receives the items selected by the player, calculates their selling prices, and sells them via an NPC.

Kod:
[B]void CHARACTER::QuickSellItem(TPacketCGQuickSell * pkData){[BR][/BR]    for(int i = 0; i < pkData->ItemCount; ++i) {[BR][/BR]        LPITEM item = GetInventoryItem(pkData->Items[i].Cell);[BR][/BR]        if(item) {[BR][/BR]            DWORD price = item->GetVnum() * item->GetCount();[BR][/BR]            // Sale process[BR][/BR]            PointChange(POINT_GOLD, price, false);[BR][/BR]            ItemDestroy(pkData->Items[i].Cell);[BR][/BR]        }[BR][/BR]    }[BR][/BR]}[/B]


UI Integration on the Client Side
On the game client side, a uiscript file must be prepared for the QUICK SELL window. This file is usually located at root/quick_sell.py and provides players with the ability to select and confirm items.

Window Features:
- Multiple item selection
- Name, price, and quantity of each item
- Total price display
- Confirm and cancel buttons

Database Integration
The selling price of each item can be retrieved from the database via DBCore. For example, the gold value in the item_proto table can be referenced to determine the selling price. This allows the system to dynamically update item prices.

SQL Example:
Kod:
[B]SELECT vnum, gold FROM item_proto WHERE type IN (0, 7, 8, 10);[/B]


System Security
To prevent misuse of the QUICK SELL system, the following checks should be implemented:
- Double-checking items before deletion
- Time limits (e.g., usable once every 5 minutes)
- Ownership verification of items

Conclusion:
In Metin2 private servers, the QUICK SELL system contributes to both player satisfaction and in-game economy. When designed properly, it simplifies the gaming experience while providing flexibility to developers. This system can be powerfully integrated using C++ knowledge combined with uiscript and DBCore expertise.
 

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

Benzer konular

Geri
Üst Alt