Jump to content

Offline Shop Syserr Please Help Me


Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

hello

the version is not complete:

fix:

Open:  PythonShop.cpp

Search:

PyObject * shopBuildPrivateShop(PyObject * poSelf, PyObject * poArgs)
{
    char * szName;
    if (!PyTuple_GetString(poArgs, 0, &szName))
        return Py_BuildException();

    CPythonShop::Instance().BuildPrivateShop(szName);
    return Py_BuildNone();
}

paste under:

PyObject * shopIsOfflineShop(PyObject * poSelf, PyObject * poArgs)
{
    CPythonShop & rkShop = CPythonShop::Instance();
    return Py_BuildValue("i", rkShop.IsOfflineShop());
}

PyObject * shopGetOfflineShopItemID(PyObject * poSelf, PyObject * poArgs)
{
    int nPos;
    if (!PyTuple_GetInteger(poArgs, 0, &nPos))
        return Py_BuildException();

    const TShopItemData * c_pItemData;
    if (CPythonShop::Instance().GetOfflineShopItemData(nPos, &c_pItemData))
        return Py_BuildValue("i", c_pItemData->vnum);

    return Py_BuildValue("i", 0);
}

PyObject * shopGetOfflineShopItemCount(PyObject * poSelf, PyObject * poArgs)
{
    int iIndex;
    if (!PyTuple_GetInteger(poArgs, 0, &iIndex))
        return Py_BuildException();

    const TShopItemData * c_pItemData;
    if (CPythonShop::Instance().GetOfflineShopItemData(iIndex, &c_pItemData))
        return Py_BuildValue("i", c_pItemData->count);

    return Py_BuildValue("i", 0);
}

PyObject * shopGetOfflineShopItemPrice(PyObject * poSelf, PyObject * poArgs)
{
    int iIndex;
    if (!PyTuple_GetInteger(poArgs, 0, &iIndex))
        return Py_BuildException();

    const TShopItemData * c_pItemData;
    if (CPythonShop::Instance().GetOfflineShopItemData(iIndex, &c_pItemData))
        return Py_BuildValue("i", c_pItemData->price);

    return Py_BuildValue("i", 0);
}

PyObject * shopGetOfflineShopItemMetinSocket(PyObject * poSelf, PyObject * poArgs)
{
    int iIndex;
    if (!PyTuple_GetInteger(poArgs, 0, &iIndex))
        return Py_BuildException();
    int iMetinSocketIndex;
    if (!PyTuple_GetInteger(poArgs, 1, &iMetinSocketIndex))
        return Py_BuildException();

    const TShopItemData * c_pItemData;
    if (CPythonShop::Instance().GetOfflineShopItemData(iIndex, &c_pItemData))
        return Py_BuildValue("i", c_pItemData->alSockets[iMetinSocketIndex]);

    return Py_BuildValue("i", 0);
}

PyObject * shopGetOfflineShopItemAttribute(PyObject * poSelf, PyObject * poArgs)
{
    int iIndex;
    if (!PyTuple_GetInteger(poArgs, 0, &iIndex))
        return Py_BuildException();
    int iAttrSlotIndex;
    if (!PyTuple_GetInteger(poArgs, 1, &iAttrSlotIndex))
        return Py_BuildException();

    if (iAttrSlotIndex >= 0 && iAttrSlotIndex < ITEM_ATTRIBUTE_SLOT_MAX_NUM)
    {
        const TShopItemData * c_pItemData;
        if (CPythonShop::Instance().GetOfflineShopItemData(iIndex, &c_pItemData))
            return Py_BuildValue("ii", c_pItemData->aAttr[iAttrSlotIndex].bType, c_pItemData->aAttr[iAttrSlotIndex].sValue);
    }

    return Py_BuildValue("ii", 0, 0);
}

PyObject * shopClearOfflineShopStock(PyObject * poSelf, PyObject * poArgs)
{
    CPythonShop::Instance().ClearOfflineShopStock();
    return Py_BuildNone();
}
PyObject * shopAddOfflineShopItemStock(PyObject * poSelf, PyObject * poArgs)
{
    BYTE bItemWindowType;
    if (!PyTuple_GetInteger(poArgs, 0, &bItemWindowType))
        return Py_BuildException();
    WORD wItemSlotIndex;
    if (!PyTuple_GetInteger(poArgs, 1, &wItemSlotIndex))
        return Py_BuildException();
    int iDisplaySlotIndex;
    if (!PyTuple_GetInteger(poArgs, 2, &iDisplaySlotIndex))
        return Py_BuildException();
    int iPrice;
    if (!PyTuple_GetInteger(poArgs, 3, &iPrice))
        return Py_BuildException();

    CPythonShop::Instance().AddOfflineShopItemStock(TItemPos(bItemWindowType, wItemSlotIndex), iDisplaySlotIndex, iPrice);
    return Py_BuildNone();
}
PyObject * shopDelOfflineShopItemStock(PyObject * poSelf, PyObject * poArgs)
{
    BYTE bItemWindowType;
    if (!PyTuple_GetInteger(poArgs, 0, &bItemWindowType))
        return Py_BuildException();
    WORD wItemSlotIndex;
    if (!PyTuple_GetInteger(poArgs, 1, &wItemSlotIndex))
        return Py_BuildException();

    CPythonShop::Instance().DelOfflineShopItemStock(TItemPos(bItemWindowType, wItemSlotIndex));
    return Py_BuildNone();
}
PyObject * shopGetOfflineShopItemPrice2(PyObject * poSelf, PyObject * poArgs)
{
    BYTE bItemWindowType;
    if (!PyTuple_GetInteger(poArgs, 0, &bItemWindowType))
        return Py_BuildException();
    WORD wItemSlotIndex;
    if (!PyTuple_GetInteger(poArgs, 1, &wItemSlotIndex))
        return Py_BuildException();

    int iValue = CPythonShop::Instance().GetOfflineShopItemPrice(TItemPos(bItemWindowType, wItemSlotIndex));
    return Py_BuildValue("i", iValue);
}
PyObject * shopBuildOfflineShop(PyObject * poSelf, PyObject * poArgs)
{
    char * szName;
    if (!PyTuple_GetString(poArgs, 0, &szName))
        return Py_BuildException();

    BYTE bTime;
    if (!PyTuple_GetInteger(poArgs, 1, &bTime))
        return Py_BuildException();

    CPythonShop::Instance().BuildOfflineShop(szName, bTime);
    return Py_BuildNone();
}

 

 

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.