Simya envanteri slot genişletilmesidir. ticarette simya alışverişinizde sıkıntı yaşanmamasını sağlayan kodlar.
Char_item.cpp arat
Kod:
bool CHARACTER::IsEmptyItemGrid(TItemPos Cell, BYTE bSize, int iExceptionCell) const
Kod bloğu altına ekle
Kod:
bool CHARACTER::IsEmptyItemGridSpecial(const TItemPos &Cell, BYTE bSize, int iExceptionCell, std::vector<WORD>& vec) const { if (std::find(vec.begin(), vec.end(), Cell.cell) != vec.end()) { return false; } switch (Cell.window_type) { case INVENTORY: { WORD bCell = (WORD)Cell.cell; // bItemCellÀº 0ÀÌ falseÀÓÀ» ³ªÅ¸³»±â À§ÇØ + 1 ÇØ¼ ó¸®ÇÑ´Ù. // µû¶ó¼ iExceptionCell¿¡ 1À» ´õÇØ ºñ±³ÇÑ´Ù. ++iExceptionCell; if (Cell.IsBeltInventoryPosition()) { LPITEM beltItem = GetWear(WEAR_BELT); if (NULL == beltItem) return false; if (false == CBeltInventoryHelper::IsAvailableCell(bCell - BELT_INVENTORY_SLOT_START, beltItem->GetValue(0))) return false; if (m_pointsInstant.bItemGrid[bCell]) { if (m_pointsInstant.bItemGrid[bCell] == iExceptionCell) return true; return false; } if (bSize == 1) return true; } else if (bCell >= INVENTORY_MAX_NUM) return false; if (m_pointsInstant.bItemGrid[bCell]) { if (m_pointsInstant.bItemGrid[bCell] == iExceptionCell) { if (bSize == 1) return true; int j = 1; WORD bPage = bCell / (45); do { WORD p = bCell + (5 * j); if (p >= INVENTORY_MAX_NUM) return false; if (p / (45) != bPage) return false; if (m_pointsInstant.bItemGrid[p]) if (m_pointsInstant.bItemGrid[p] != iExceptionCell) return false; } while (++j < bSize); return true; } else return false; } // Å©±â°¡ 1À̸é ÇÑÄÀ» Â÷ÁöÇÏ´Â °ÍÀ̹ǷΠ±×³É ¸®ÅÏ if (1 == bSize) return true; else { int j = 1; WORD bPage = bCell / (45); do { WORD p = bCell + (5 * j); if (p >= INVENTORY_MAX_NUM) return false; if (p / (45) != bPage) return false; if (m_pointsInstant.bItemGrid[p]) if (m_pointsInstant.bItemGrid[p] != iExceptionCell) return false; } while (++j < bSize); return true; } } break; case DRAGON_SOUL_INVENTORY: { WORD wCell = Cell.cell; if (wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM) return false; // bItemCellÀº 0ÀÌ falseÀÓÀ» ³ªÅ¸³»±â À§ÇØ + 1 ÇØ¼ ó¸®ÇÑ´Ù. // µû¶ó¼ iExceptionCell¿¡ 1À» ´õÇØ ºñ±³ÇÑ´Ù. iExceptionCell++; if (m_pointsInstant.wDSItemGrid[wCell]) { if (m_pointsInstant.wDSItemGrid[wCell] == iExceptionCell) { if (bSize == 1) return true; int j = 1; do { WORD p = wCell + (DRAGON_SOUL_BOX_COLUMN_NUM * j); if (p >= DRAGON_SOUL_INVENTORY_MAX_NUM) return false; if (m_pointsInstant.wDSItemGrid[p]) if (m_pointsInstant.wDSItemGrid[p] != iExceptionCell) return false; } while (++j < bSize); return true; } else return false; } // Å©±â°¡ 1À̸é ÇÑÄÀ» Â÷ÁöÇÏ´Â °ÍÀ̹ǷΠ±×³É ¸®ÅÏ if (1 == bSize) return true; else { int j = 1; do { WORD p = wCell + (DRAGON_SOUL_BOX_COLUMN_NUM * j); if (p >= DRAGON_SOUL_INVENTORY_MAX_NUM) return false; if (m_pointsInstant.bItemGrid[p]) if (m_pointsInstant.wDSItemGrid[p] != iExceptionCell) return false; } while (++j < bSize); return true; } } break; } return false; }
aynı cppde arat
Kod:
int CHARACTER::GetEmptyInventory(BYTE size) const
kod bloğu altına ekle
Kod:
int CHARACTER::GetEmptyDragonSoulInventoryWithExceptions(LPITEM pItem, std::vector<WORD>& vec /*= -1*/) const { if (NULL == pItem || !pItem->IsDragonSoul()) return -1; if (!DragonSoul_IsQualified()) { return -1; } BYTE bSize = pItem->GetSize(); WORD wBaseCell = DSManager::instance().GetBasePosition(pItem); if (WORD_MAX == wBaseCell) return -1; for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; ++i) if (IsEmptyItemGridSpecial(TItemPos(DRAGON_SOUL_INVENTORY, i + wBaseCell), bSize, -1, vec)) return i + wBaseCell; return -1; }
char.h aç ve arat
Kod:
void CopyDragonSoulItemGrid(std::vector<WORD>& vDragonSoulItemGrid) const;
altına ekle
Kod:
int GetEmptyDragonSoulInventoryWithExceptions(LPITEM pItem, std::vector<WORD>& vec /*= -1*/) const;
arat
Kod:
bool IsEmptyItemGrid(TItemPos Cell, BYTE size, int iExceptionCell = -1) const;
altına ekle
Kod:
bool IsEmptyItemGridSpecial(const TItemPos &Cell, BYTE bSize, int iExceptionCell, std::vector<WORD>& vec) const;
exchange.cpp aç ve arat
Kod:
bool CExchange::CheckSpace() {
altına ekle
Kod:
LPCHARACTER me = GetOwner();
arat
Kod:
static std::vector <WORD> s_vDSGrid(DRAGON_SOUL_INVENTORY_MAX_NUM);
elseye kadar değiştir
Kod:
static std::vector <WORD> s_vDSGrid(DRAGON_SOUL_INVENTORY_MAX_NUM); std::vector<WORD> exceptDSCells; exceptDSCells.clear(); for (i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i) { if (!((item = GetCompany()->GetItemByPosition(i)))) continue; BYTE itemSize = item->GetSize(); if (item->IsDragonSoul()) { WORD foundCell = me->GetEmptyDragonSoulInventoryWithExceptions(item, exceptDSCells); if (foundCell != -1) { exceptDSCells.push_back(foundCell); continue; } return false;
exchange.h aç ve arat
Kod:
bool GetAcceptStatus() { return m_bAccept; }
altına ekle
Simya Envanteri Düzenlemesi
Metin2 özel sunucularında simya sistemi, oyuncuların eşyaları dönüştürme, güçlendirme ve yeniden oluşturma gibi işlemler yapabilmesini sağlayan önemli bir özelliktir. Bu bağlamda simya envanteri, oyuncuların simya işlemleri sırasında kullanacağı öğeleri taşıdığı kritik bir alandır. Bu yazıda, simya envanterinin düzenlenmesi konusunu detaylı olarak ele alacağız.
Simya Envanteri Nedir?
Simya envanteri, Metin2 oyununda oyuncuların simya işlemi sırasında kullandıkları özel bir envanterdir. Oyuncu, simya yaparken bu envantere eşyalarını yerleştirir ve işlemi başlatır. Bu nedenle, simya envanteri doğru şekilde yapılandırılmadığında, simya sisteminin çalışması engellenebilir veya istenmeyen sonuçlar doğabilir.
Simya Envanteri Yapısı
Simya envanteri genellikle 3 ana bölümden oluşur:
- Girdi kutuları (Input slots)
- İşlem butonları
- Çıktı kutusu
Bu yapı, simya işlemi sırasında veri akışını sağlar. Girdi kutularına yerleştirilen eşyalar, belirlenen kurallara göre işlenerek çıktı kutusuna aktarılır. Bu yapıyı doğru tanımlamak, simya sisteminin stabil çalışması için kritiktir.
Simya Envanteri Düzenleme Adımları
1. Giriş ve çıkış slotlarını tanımlayın: Simya arayüzünde kaç adet girdi kutusu olacağına karar verin. Genellikle 3-5 slot yeterlidir. Bu slotlar, kullanıcıdan alınacak eşyaları temsil eder.
2. Butonları tanımlayın: Simya işlemi başlatmak için bir buton tanımlanmalıdır. Bu buton genellikle 'Simya Yap' veya 'Dönüştür' gibi isimler alır. Buton tıklaması üzerine, sistem girdi slotlarındaki eşyaları kontrol eder.
3. Çıktı slotunu belirleyin: İşlem tamamlandığında elde edilecek eşya burada gösterilir. Çıktı slotu sadece okunabilir olmalıdır, yani kullanıcı buraya eşya yerleştiremez.
4. Python ve C++ kodlarıyla entegrasyon: Simya envanteri, client tarafında Python ile UIScript tabanlı bir arayüzle oluşturulur. Backend ise genellikle C++ ile yazılmış server-side fonksiyonlarla haberleşir. Bu iki bileşen arasında veri alışverişi, paketler üzerinden yapılır.
Simya Envanteri İçin Örnek UI Kodu
PyRoot ve UIScript sistemleri kullanılarak aşağıdaki gibi bir arayüz oluşturulabilir:
window = {
'name': 'AlchemyWindow',
'style': ['movable', 'float'],
'x': 100,
'y': 100,
'width': 300,
'height': 400,
'children': [
{ 'name': 'input_slot_1', 'type': 'slot', 'x': 10, 'y': 50, 'width': 32, 'height': 32 },
{ 'name': 'input_slot_2', 'type': 'slot', 'x': 50, 'y': 50, 'width': 32, 'height': 32 },
{ 'name': 'output_slot', 'type': 'slot', 'x': 100, 'y': 100, 'width': 32, 'height': 32, 'readonly': True },
{ 'name': 'alchemy_button', 'type': 'button', 'x': 120, 'y': 200, 'text': 'Simya Yap' }
]
}
Sunucu Tarafında Simya Mantığı
Sunucu tarafında simya işlemleri genellikle Auth ve Game sunucuları arasında koordineli çalışarak gerçekleşir. Simya işlemi başlatıldığında, girdi slotlarındaki eşyaların doğruluğu kontrol edilir. Eğer tüm koşullar sağlanıyorsa, eşya dönüştürme işlemi başlatılır ve sonuç çıktı slotuna yerleştirilir.
Sonuç
Simya envanteri düzenlemek, Metin2 özel sunucularında kullanıcı deneyimini artırmak ve simya sistemini stabilize etmek için kritik öneme sahiptir. Bu makalede anlatılan adımları takip ederek, hem client hem de server tarafında simya envanteri için sağlam bir yapı oluşturabilirsiniz.
Alchemy Inventory Editing
In Metin2 private servers, the alchemy system allows players to transform, enhance, and reconstruct items. In this context, the alchemy inventory is a critical area where players store items used during alchemy processes. In this article, we will examine the editing of the alchemy inventory in detail.
What is Alchemy Inventory?
The alchemy inventory is a special inventory in Metin2 that players use during alchemy operations. Players place items into this inventory and initiate the process. Therefore, if the alchemy inventory is not configured properly, the alchemy system may fail or produce unwanted results.
Alchemy Inventory Structure
The alchemy inventory typically consists of three main parts:
- Input slots
- Action buttons
- Output slot
This structure ensures data flow during the alchemy process. Items placed in input slots are processed according to defined rules and transferred to the output slot. Defining this structure correctly is critical for the stable operation of the alchemy system.
Steps for Editing Alchemy Inventory
1. Define input and output slots: Decide how many input slots will be available in the alchemy interface. Usually 3-5 slots are sufficient. These slots represent the items taken from the user.
2. Define buttons: A button must be defined to initiate the alchemy process. This button usually has names like 'Do Alchemy' or 'Transform'. Upon clicking the button, the system checks the items in the input slots.
3. Set the output slot: The resulting item after the process is completed is displayed here. The output slot should be read-only, meaning users cannot place items here.
4. Integration with Python and C++ code: The alchemy inventory is created on the client side using Python-based UI scripts. The backend typically communicates through server-side functions written in C++. Data exchange between these two components occurs via packets.
Sample UI Code for Alchemy Inventory
Using PyRoot and UIScript systems, an interface like the following can be created:
window = {
'name': 'AlchemyWindow',
'style': ['movable', 'float'],
'x': 100,
'y': 100,
'width': 300,
'height': 400,
'children': [
{ 'name': 'input_slot_1', 'type': 'slot', 'x': 10, 'y': 50, 'width': 32, 'height': 32 },
{ 'name': 'input_slot_2', 'type': 'slot', 'x': 50, 'y': 50, 'width': 32, 'height': 32 },
{ 'name': 'output_slot', 'type': 'slot', 'x': 100, 'y': 100, 'width': 32, 'height': 32, 'readonly': True },
{ 'name': 'alchemy_button', 'type': 'button', 'x': 120, 'y': 200, 'text': 'Do Alchemy' }
]
}
Alchemy Logic on Server Side
Alchemy operations on the server side typically occur through coordinated work between Auth and Game servers. When the alchemy process is initiated, the validity of items in the input slots is checked. If all conditions are met, the item transformation process starts, and the result is placed in the output slot.
Conclusion
Editing the alchemy inventory is crucial for enhancing the user experience and stabilizing the alchemy system in Metin2 private servers. By following the steps outlined in this article, you can build a robust structure for the alchemy inventory on both the client and server sides.
Kod:
CItem * GetItemByPosition(int i) const { return m_apItems[i]; }
Simya Envanteri Düzenlemesi
Metin2 özel sunucularında simya sistemi, oyuncuların eşyaları dönüştürme, güçlendirme ve yeniden oluşturma gibi işlemler yapabilmesini sağlayan önemli bir özelliktir. Bu bağlamda simya envanteri, oyuncuların simya işlemleri sırasında kullanacağı öğeleri taşıdığı kritik bir alandır. Bu yazıda, simya envanterinin düzenlenmesi konusunu detaylı olarak ele alacağız.
Simya Envanteri Nedir?
Simya envanteri, Metin2 oyununda oyuncuların simya işlemi sırasında kullandıkları özel bir envanterdir. Oyuncu, simya yaparken bu envantere eşyalarını yerleştirir ve işlemi başlatır. Bu nedenle, simya envanteri doğru şekilde yapılandırılmadığında, simya sisteminin çalışması engellenebilir veya istenmeyen sonuçlar doğabilir.
Simya Envanteri Yapısı
Simya envanteri genellikle 3 ana bölümden oluşur:
- Girdi kutuları (Input slots)
- İşlem butonları
- Çıktı kutusu
Bu yapı, simya işlemi sırasında veri akışını sağlar. Girdi kutularına yerleştirilen eşyalar, belirlenen kurallara göre işlenerek çıktı kutusuna aktarılır. Bu yapıyı doğru tanımlamak, simya sisteminin stabil çalışması için kritiktir.
Simya Envanteri Düzenleme Adımları
1. Giriş ve çıkış slotlarını tanımlayın: Simya arayüzünde kaç adet girdi kutusu olacağına karar verin. Genellikle 3-5 slot yeterlidir. Bu slotlar, kullanıcıdan alınacak eşyaları temsil eder.
2. Butonları tanımlayın: Simya işlemi başlatmak için bir buton tanımlanmalıdır. Bu buton genellikle 'Simya Yap' veya 'Dönüştür' gibi isimler alır. Buton tıklaması üzerine, sistem girdi slotlarındaki eşyaları kontrol eder.
3. Çıktı slotunu belirleyin: İşlem tamamlandığında elde edilecek eşya burada gösterilir. Çıktı slotu sadece okunabilir olmalıdır, yani kullanıcı buraya eşya yerleştiremez.
4. Python ve C++ kodlarıyla entegrasyon: Simya envanteri, client tarafında Python ile UIScript tabanlı bir arayüzle oluşturulur. Backend ise genellikle C++ ile yazılmış server-side fonksiyonlarla haberleşir. Bu iki bileşen arasında veri alışverişi, paketler üzerinden yapılır.
Simya Envanteri İçin Örnek UI Kodu
PyRoot ve UIScript sistemleri kullanılarak aşağıdaki gibi bir arayüz oluşturulabilir:
window = {
'name': 'AlchemyWindow',
'style': ['movable', 'float'],
'x': 100,
'y': 100,
'width': 300,
'height': 400,
'children': [
{ 'name': 'input_slot_1', 'type': 'slot', 'x': 10, 'y': 50, 'width': 32, 'height': 32 },
{ 'name': 'input_slot_2', 'type': 'slot', 'x': 50, 'y': 50, 'width': 32, 'height': 32 },
{ 'name': 'output_slot', 'type': 'slot', 'x': 100, 'y': 100, 'width': 32, 'height': 32, 'readonly': True },
{ 'name': 'alchemy_button', 'type': 'button', 'x': 120, 'y': 200, 'text': 'Simya Yap' }
]
}
Sunucu Tarafında Simya Mantığı
Sunucu tarafında simya işlemleri genellikle Auth ve Game sunucuları arasında koordineli çalışarak gerçekleşir. Simya işlemi başlatıldığında, girdi slotlarındaki eşyaların doğruluğu kontrol edilir. Eğer tüm koşullar sağlanıyorsa, eşya dönüştürme işlemi başlatılır ve sonuç çıktı slotuna yerleştirilir.
Sonuç
Simya envanteri düzenlemek, Metin2 özel sunucularında kullanıcı deneyimini artırmak ve simya sistemini stabilize etmek için kritik öneme sahiptir. Bu makalede anlatılan adımları takip ederek, hem client hem de server tarafında simya envanteri için sağlam bir yapı oluşturabilirsiniz.
Alchemy Inventory Editing
In Metin2 private servers, the alchemy system allows players to transform, enhance, and reconstruct items. In this context, the alchemy inventory is a critical area where players store items used during alchemy processes. In this article, we will examine the editing of the alchemy inventory in detail.
What is Alchemy Inventory?
The alchemy inventory is a special inventory in Metin2 that players use during alchemy operations. Players place items into this inventory and initiate the process. Therefore, if the alchemy inventory is not configured properly, the alchemy system may fail or produce unwanted results.
Alchemy Inventory Structure
The alchemy inventory typically consists of three main parts:
- Input slots
- Action buttons
- Output slot
This structure ensures data flow during the alchemy process. Items placed in input slots are processed according to defined rules and transferred to the output slot. Defining this structure correctly is critical for the stable operation of the alchemy system.
Steps for Editing Alchemy Inventory
1. Define input and output slots: Decide how many input slots will be available in the alchemy interface. Usually 3-5 slots are sufficient. These slots represent the items taken from the user.
2. Define buttons: A button must be defined to initiate the alchemy process. This button usually has names like 'Do Alchemy' or 'Transform'. Upon clicking the button, the system checks the items in the input slots.
3. Set the output slot: The resulting item after the process is completed is displayed here. The output slot should be read-only, meaning users cannot place items here.
4. Integration with Python and C++ code: The alchemy inventory is created on the client side using Python-based UI scripts. The backend typically communicates through server-side functions written in C++. Data exchange between these two components occurs via packets.
Sample UI Code for Alchemy Inventory
Using PyRoot and UIScript systems, an interface like the following can be created:
window = {
'name': 'AlchemyWindow',
'style': ['movable', 'float'],
'x': 100,
'y': 100,
'width': 300,
'height': 400,
'children': [
{ 'name': 'input_slot_1', 'type': 'slot', 'x': 10, 'y': 50, 'width': 32, 'height': 32 },
{ 'name': 'input_slot_2', 'type': 'slot', 'x': 50, 'y': 50, 'width': 32, 'height': 32 },
{ 'name': 'output_slot', 'type': 'slot', 'x': 100, 'y': 100, 'width': 32, 'height': 32, 'readonly': True },
{ 'name': 'alchemy_button', 'type': 'button', 'x': 120, 'y': 200, 'text': 'Do Alchemy' }
]
}
Alchemy Logic on Server Side
Alchemy operations on the server side typically occur through coordinated work between Auth and Game servers. When the alchemy process is initiated, the validity of items in the input slots is checked. If all conditions are met, the item transformation process starts, and the result is placed in the output slot.
Conclusion
Editing the alchemy inventory is crucial for enhancing the user experience and stabilizing the alchemy system in Metin2 private servers. By following the steps outlined in this article, you can build a robust structure for the alchemy inventory on both the client and server sides.
