Metin2 Pvp ItemShop / Depoyu Aç / Şehire Dön Butonu. [C++][PY]

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Envanterdeki itemshop butonu üzerinde yaptım değişiklikleri ekstra bir buton eklemedim bunu belirtiyim. İsteyen game.py ye ekleyerek herhangi bi tuşa atayabilir bunu size kalmış. Yada taskbara buton olarak ekleyin.




Game Src Kısmı:

Öncelikle char.cpp açılır ve alttaki kısım silinir yada etkisiz hale getirilir.


else if (GetDistanceFromSafeboxOpen() > 1000)
{


ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<â°í> °Å¸®°¡ ¸Ö¾î¼* â°í¸¦ ¿* ¼ö ¾ø½À´Ï´Ù."));
return;
}


Açılır: cmd.cpp
Aratılır:

ACMD(do_click_mall);

Altına Eklenir:

ACMD(do_click_safebox);
ACMD(do_click_town);




Tekrar Aratılır:

{ "click_mall", do_click_mall, 0, POS_DEAD, GM_PLAYER },

Altına Eklenir:

{ "click_safebox", do_click_safebox, 0, POS_DEAD, GM_PLAYER },
{ "click_town", do_click_town, 0, POS_DEAD, GM_PLAYER },




______________________________

Açılır: cmd_general.cpp
Aratılır:

ACMD(do_click_mall)

Kod Bloğunun Altına Eklenir:
ACMD(do_click_town)

{
ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
}


ACMD(do_click_safebox)
{
ch->ChatPacket(CHAT_TYPE_COMMAND, "ShowMeSafeboxPassword");
}


_____________________________

Pack Kısmı.

Açılır: uiinventory.py
Aratılır:

def ClickMallButton(self):

Kod Bloğu Full Değiştirilir: Tıkla ( ) Siteye Giremeyenler DNS Ayarlarını 8.8.8.8 8.8.4.4 Yapsınlar Kodları altada Eklıyecegım


def ClickMallButton(self): if 0==interfaceModule.statutahta1:
interfaceModule.statutahta1 = 1
self.tahta1 = ui.BoardWithTitleBar()
self.tahta1.SetSize(270, 80)
self.tahta1.SetCenterPosition()
self.tahta1.AddFlag('float')
self.tahta1.AddFlag('movable')
self.tahta1.SetTitleName("TestMetin2")
self.tahta1.Show()

self.itemshop1 = ui.Button()
self.itemshop1.SetEvent(self._item_shop)
self.itemshop1.SetParent(self.tahta1)
self.itemshop1.SetPosition(35, 40)
self.itemshop1.SetUpVisual("d:/ymir work/ui/public/middle_button_01.sub")
self.itemshop1.SetOverVisual("d:/ymir work/ui/public/middle_button_02.sub")
self.itemshop1.SetDownVisual("d:/ymir work/ui/public/middle_button_03.sub")
self.itemshop1.SetText("ItemShop")
self.itemshop1.Show()

self.depo1 = ui.Button()
self.depo1.SetEvent(self._depo_ac)
self.depo1.SetParent(self.tahta1)
self.depo1.SetPosition(105, 40)
self.depo1.SetUpVisual("d:/ymir work/ui/public/middle_button_01.sub")
self.depo1.SetOverVisual("d:/ymir work/ui/public/middle_button_02.sub")
self.depo1.SetDownVisual("d:/ymir work/ui/public/middle_button_03.sub")
self.depo1.SetText("Depo")
self.depo1.Show()

self.sehir1 = ui.Button()
self.sehir1.SetEvent(self._sehire_git)
self.sehir1.SetParent(self.tahta1)
self.sehir1.SetPosition(175, 40)
self.sehir1.SetUpVisual("d:/ymir work/ui/public/middle_button_01.sub")
self.sehir1.SetOverVisual("d:/ymir work/ui/public/middle_button_02.sub")
self.sehir1.SetDownVisual("d:/ymir work/ui/public/middle_button_03.sub")
self.sehir1.SetText("Sehir")
self.sehir1.Show()
else:
interfaceModule.statutahta1 = 0
self.tahta1.Hide()
self.itemshop1.Hide()
self.depo1.Hide()
self.sehir1.Hide()

def _item_shop(self):
interfaceModule.statutahta1 = 0
self.tahta1.Hide()
self.itemshop1.Hide()
self.depo1.Hide()
self.sehir1.Hide()
net.SendChatPacket("/click_mall")

def _depo_ac(self):
interfaceModule.statutahta1 = 0
self.tahta1.Hide()
self.itemshop1.Hide()
self.depo1.Hide()
self.sehir1.Hide()
net.SendChatPacket("/click_safebox")

def _sehire_git(self):
interfaceModule.statutahta1 = 0
self.tahta1.Hide()
self.itemshop1.Hide()
self.depo1.Hide()
self.sehir1.Hide()
net.SendChatPacket("/click_town")

RAW Paste Data


def ClickMallButton(self): if 0==interfaceModule.statutahta1:
interfaceModule.statutahta1 = 1
self.tahta1 = ui.BoardWithTitleBar()
self.tahta1.SetSize(270, 80)
self.tahta1.SetCenterPosition()
self.tahta1.AddFlag('float')
self.tahta1.AddFlag('movable')
self.tahta1.SetTitleName("TestMetin2")
self.tahta1.Show()

self.itemshop1 = ui.Button()
self.itemshop1.SetEvent(self._item_shop)
self.itemshop1.SetParent(self.tahta1)
self.itemshop1.SetPosition(35, 40)
self.itemshop1.SetUpVisual("d:/ymir work/ui/public/middle_button_01.sub")
self.itemshop1.SetOverVisual("d:/ymir work/ui/public/middle_button_02.sub")
self.itemshop1.SetDownVisual("d:/ymir work/ui/public/middle_button_03.sub")
self.itemshop1.SetText("ItemShop")
self.itemshop1.Show()

self.depo1 = ui.Button()
self.depo1.SetEvent(self._depo_ac)
self.depo1.SetParent(self.tahta1)
self.depo1.SetPosition(105, 40)
self.depo1.SetUpVisual("d:/ymir work/ui/public/middle_button_01.sub")
self.depo1.SetOverVisual("d:/ymir work/ui/public/middle_button_02.sub")
self.depo1.SetDownVisual("d:/ymir work/ui/public/middle_button_03.sub")
self.depo1.SetText("Depo")
self.depo1.Show()

self.sehir1 = ui.Button()
self.sehir1.SetEvent(self._sehire_git)
self.sehir1.SetParent(self.tahta1)
self.sehir1.SetPosition(175, 40)
self.sehir1.SetUpVisual("d:/ymir work/ui/public/middle_button_01.sub")
self.sehir1.SetOverVisual("d:/ymir work/ui/public/middle_button_02.sub")
self.sehir1.SetDownVisual("d:/ymir work/ui/public/middle_button_03.sub")
self.sehir1.SetText("Sehir")
self.sehir1.Show()
else:
interfaceModule.statutahta1 = 0
self.tahta1.Hide()
self.itemshop1.Hide()
self.depo1.Hide()
self.sehir1.Hide()

def _item_shop(self):
interfaceModule.statutahta1 = 0
self.tahta1.Hide()
self.itemshop1.Hide()
self.depo1.Hide()
self.sehir1.Hide()
net.SendChatPacket("/click_mall")

def _depo_ac(self):
interfaceModule.statutahta1 = 0
self.tahta1.Hide()
self.itemshop1.Hide()
self.depo1.Hide()
self.sehir1.Hide()
net.SendChatPacket("/click_safebox")

def _sehire_git(self):
interfaceModule.statutahta1 = 0
self.tahta1.Hide()
self.itemshop1.Hide()
self.depo1.Hide()
self.sehir1.Hide()

net.SendChatPacket("/click_town")


Açılır: interfacemodule.py
Aratılır:

IsQBHide = 0

Altına Eklenir:

statutahta1 = 0​

Metin2 Pvp ItemShop / Depoyu Aç / Şehire Dön Butonu Sistemi

Metin2 özel sunucularında oyuncuların daha hızlı ve kolay bir şekilde temel işlemleri gerçekleştirmesi büyük önem taşır. Bu bağlamda, Pvp ItemShop, Depoyu Aç ve Şehire Dön gibi özelliklerin butonlar aracılığıyla erişilebilir olması, kullanıcı deneyimini ciddi anlamda artırır. Bu sistem, hem C++ hem de Python tabanlı yapılarla entegre edilebilir.

Pvp ItemShop Sistemi
Oyuncuların PvP odaklı sunucularda hızlıca eşya satın alabilmesi için geliştirilen bu sistem, uiscript dosyasında özel bir pencere olarak tanımlanabilir. Python tarafında butona basıldığında belirlenen bir item listesi sunulur. Oyuncu seçim yaparak satın alma işlemini gerçekleştirebilir. Bu işlem sırasında py root üzerinden sunucuya istek gönderilerek envanter güncellenir.

Depoyu Aç Butonu
Oyuncuların karakterindeki depoyu doğrudan açması için tasarlanan bu buton, game core ile entegre çalışır. C++ tarafında bir packet gönderilerek depo açılır. Python tarafında ise buton tıklaması ile bu işlem başlatılır. Oyuncuların depo şifresi doğruysa, depo doğrudan açılır ve kullanıcı daha hızlı bir şekilde envanter yönetimini sağlar.

Şehire Dön Butonu
Bu buton, oyuncuların savaş alanlarında sıkıştıklarında veya hızlıca şehre dönmeleri gerektiğinde kullanılır. C++ tarafında bir warp komutu gönderilir. Bu işlem sırasında oyuncunun PvP statüsü kontrol edilir ve belirlenen kurallara göre şehre dönüş yapılır. Python tarafında buton tıklamasıyla birlikte gerekli kontroller sağlanır.

Sistem Entegrasyonu ve Kurulum
Bu sistemin kurulumu için öncelikle client src üzerinde değişiklik yapılması gerekir. Uiscript dosyasına buton tanımları eklenir. Py root dosyalarında gerekli fonksiyonlar yazılır. Game server programming ile buton tıklamaları karşılanır ve sunucu tarafında işlemler gerçekleştirilir.

Özel Sunucular İçin Avantajlar
Bu tür sistemler sayesinde özel Metin2 sunucularında kullanıcı memnuniyeti artar. Hızlı menü işlemleri, oyuncuların daha aktif kalmasını sağlar. Ayrıca martysama gibi geliştiricilerin paylaştığı sistemlerle entegrasyon daha da kolaylaşır. Metin2 development süreci hızlanır ve daha fazla kullanıcı kitlesine ulaşmak mümkün olur.

Sonuç
Metin2 özel sunucularında kullanıcı dostu arayüzler geliştirmek, hem teknik hem de stratejik açıdan büyük önem taşır. C++ ve Python ile geliştirilen bu sistemler, db core ile entegre çalışarak güçlü bir temel oluşturur. Metin2dev topluluğu bu tür gelişmelerle daha da güçlenmektedir.


Metin2 Pvp ItemShop / Open Depot / Return to City Button System

In Metin2 private servers, enabling players to perform basic operations more quickly and easily is crucial. In this context, features like Pvp ItemShop, Open Depot, and Return to City accessible through buttons significantly enhance user experience. This system can be integrated with both C++ and Python based structures.

Pvp ItemShop System
Designed for players on PvP-focused servers to quickly purchase items, this system can be defined as a custom window in the uiscript file. When a button is pressed in Python, a predefined item list appears. The player can make a selection and finalize the purchase. During this process, the inventory is updated by sending a request to the server via py root.

Open Depot Button
This button allows players to directly open their character's depot. It works integrated with the game core. A packet is sent from the C++ side to open the depot. On the Python side, the button click triggers the action. If the player enters the correct depot password, the depot opens directly, allowing faster inventory management.

Return to City Button
This button is used when players are stuck in battlefields or need to return to the city quickly. A warp command is sent from the C++ side. During this process, the player's PvP status is checked, and they are returned to the city according to predefined rules. On the Python side, necessary checks are performed upon button click.

System Integration and Installation
To install this system, modifications must first be made to the client src. Button definitions are added to the uiscript file. Relevant functions are written in the py root files. Server-side operations are handled via game server programming when button clicks occur.

Advantages for Private Servers
Thanks to such systems, user satisfaction increases on private Metin2 servers. Quick menu operations help players stay more active. Moreover, integration becomes easier with systems shared by developers like martysama. The Metin2 development process speeds up, allowing access to larger audiences.

Conclusion
Developing user-friendly interfaces in Metin2 private servers is highly important both technically and strategically. Systems developed with C++ and Python create a strong foundation by working integrated with db core. The Metin2dev community grows stronger with such advancements.
 

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

Geri
Üst Alt