• 🎉 Hey there! I've just launched my brand new server voting platform — Metin2 P Servers 🚀

Not answered Chest item info

Member
May
Threads
3
56
1
8

AD: Mt2009 - Mobile & PC - 30 January 2026 CHECK THE PRESENTATION!

Hello, please i have problem with chest item info (whats drop in chests).
No chest shows command to show chest drop ( special_item_group.txt, chest_drop - have added)

However, this option is displayed and works good on items that are under the Lucky_box system (lucky_box.txt)

Show drop (ctrl+shift+r.clcik) - does not show on chests but shows on lucky_box items.

Code:
#if defined(ENABLE_CHEST_DROP_INFO)
PyObject* itemHasDropInfo(PyObject* poSelf, PyObject* poArgs)
{
    int iItemIndex;
    if (!PyTuple_GetInteger(poArgs, 0, &iItemIndex))
        return Py_BadArgument();
    bool bMain;
    if (!PyTuple_GetBoolean(poArgs, 1, &bMain))
        return Py_BadArgument();
    CItemManager::TChestDropItemInfoVec* vDropInfo = nullptr;
    
    if (bMain)
        vDropInfo = CItemManager::Instance().GetItemDropInfoVec(iItemIndex);
    else
        vDropInfo = CItemManager::Instance().GetBaseItemDropInfoVec(iItemIndex);
    return Py_BuildValue("b", (vDropInfo && !vDropInfo->empty()));
}
static int __CreateDropPage(CItemManager::TChestDropItemInfoVec* vDropInfo, PyObject* poList)
{
    int iPageCount(0);
    CGrid grid(5, 8);
    
    if (vDropInfo && !vDropInfo->empty())
    {
        for (CItemManager::TChestDropItemInfoVec::const_iterator it = vDropInfo->begin(); it != vDropInfo->end(); ++it)
        {
            const CItemManager::SDropItemInfo& dwDropInfo = *it;
            CItemData* pItemData;
            if (!CItemManager::Instance().GetItemDataPointer(dwDropInfo.dwDropVnum, &pItemData))
                continue;
            const BYTE bItemSize = pItemData->GetSize();
            while (true)
            {
                const int iPos = grid.FindBlank(1, bItemSize);
                if (iPos >= 0)
                {
                    grid.Put(iPos, 1, bItemSize);
                    PyList_Append(poList, Py_BuildValue("iiii", iPageCount, iPos, dwDropInfo.dwDropVnum, dwDropInfo.iCount));
                    break;
                }
                else
                {
                    grid.Clear();
                    ++iPageCount;
                }
            }
        }
    }
    return iPageCount;
}
PyObject* itemGetDropInfo(PyObject* poSelf, PyObject* poArgs)
{
    int iItemIndex;
    if (!PyTuple_GetInteger(poArgs, 0, &iItemIndex))
        return Py_BadArgument();
    bool bMain;
    if (!PyTuple_GetBoolean(poArgs, 1, &bMain))
        return Py_BadArgument();
    PyObject* poList = PyList_New(0);
    CItemManager::TChestDropItemInfoVec* vDropInfo = nullptr;
    if (bMain)
        vDropInfo = CItemManager::Instance().GetItemDropInfoVec(iItemIndex);
    else
        vDropInfo = CItemManager::Instance().GetBaseItemDropInfoVec(iItemIndex);
    return Py_BuildValue("iO", __CreateDropPage(vDropInfo, poList), poList);
}
#endif


Where could the error be and how to fix it?


Thank you very much.
Have a nice day.
 
Metin2Hub Bot
M2Hub Bot
Feb
Threads
66
2,381
2
1,308
113
Hello, please i have problem with chest item info (whats drop in chests).
No chest shows command to show chest drop ( special_item_group.txt, chest_drop - have added)

However, this option is displayed and works good on items that are under the Lucky_box system (lucky_box.txt)

Show drop (ctrl+shift+r.clcik) - does not show on chests but shows on lucky_box items.

Code:
#if defined(ENABLE_CHEST_DROP_INFO)
PyObject* itemHasDropInfo(PyObject* poSelf, PyObject* poArgs)
{
    int iItemIndex;
    if (!PyTuple_GetInteger(poArgs, 0, &iItemIndex))
        return Py_BadArgument();
    bool bMain;
    if (!PyTuple_GetBoolean(poArgs, 1, &bMain))
        return Py_BadArgument();
    CItemManager::TChestDropItemInfoVec* vDropInfo = nullptr;
    
    if (bMain)
        vDropInfo = CItemManager::Instance().GetItemDropInfoVec(iItemIndex);
    else
        vDropInfo = CItemManager::Instance().GetBaseItemDropInfoVec(iItemIndex);
    return Py_BuildValue("b", (vDropInfo && !vDropInfo->empty()));
}
static int __CreateDropPage(CItemManager::TChestDropItemInfoVec* vDropInfo, PyObject* poList)
{
    int iPageCount(0);
    CGrid grid(5, 8);
    
    if (vDropInfo && !vDropInfo->empty())
    {
        for (CItemManager::TChestDropItemInfoVec::const_iterator it = vDropInfo->begin(); it != vDropInfo->end(); ++it)
        {
            const CItemManager::SDropItemInfo& dwDropInfo = *it;
            CItemData* pItemData;
            if (!CItemManager::Instance().GetItemDataPointer(dwDropInfo.dwDropVnum, &pItemData))
                continue;
            const BYTE bItemSize = pItemData->GetSize();
            while (true)
            {
                const int iPos = grid.FindBlank(1, bItemSize);
                if (iPos >= 0)
                {
                    grid.Put(iPos, 1, bItemSize);
                    PyList_Append(poList, Py_BuildValue("iiii", iPageCount, iPos, dwDropInfo.dwDropVnum, dwDropInfo.iCount));
                    break;
                }
                else
                {
                    grid.Clear();
                    ++iPageCount;
                }
            }
        }
    }
    return iPageCount;
}
PyObject* itemGetDropInfo(PyObject* poSelf, PyObject* poArgs)
{
    int iItemIndex;
    if (!PyTuple_GetInteger(poArgs, 0, &iItemIndex))
        return Py_BadArgument();
    bool bMain;
    if (!PyTuple_GetBoolean(poArgs, 1, &bMain))
        return Py_BadArgument();
    PyObject* poList = PyList_New(0);
    CItemManager::TChestDropItemInfoVec* vDropInfo = nullptr;
    if (bMain)
        vDropInfo = CItemManager::Instance().GetItemDropInfoVec(iItemIndex);
    else
        vDropInfo = CItemManager::Instance().GetBaseItemDropInfoVec(iItemIndex);
    return Py_BuildValue("iO", __CreateDropPage(vDropInfo, poList), poList);
}
#endif


Where could the error be and how to fix it?


Thank you very much.
Have a nice day.

Hello dear user,

Your post will be under surveillance by bots for the next few hours.

Forum description : Metin2 private server, Metin2 download, Metin2 support, Metin2 Forum, Metin2 Pvp Servers, Errors, Bugs, Requests, Metin2 Pvp Forum, Everything About Metin2.
 
Discord Banner

🔥 Join us on Discord! - Active chat & direct support

We invite you to join the largest Metin2 community on Discord!

Join Now!
Member Count: 
Discord Robot
HUB Bot
Announcement
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock