OnurBoyla 1
OnurBoyla
noisiv 1
noisiv
Manwe Work 1
Manwe Work
farkmt2official 1
farkmt2official
mavzermete 1
mavzermete
dreamstone 1
dreamstone
Fethi Polat 1
Fethi Polat
Bvural41 1
Bvural41
Hikaye Ekle

Cevaplanmadı The online shop problem

  • Konuyu başlatan Konuyu başlatan Justice777
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 5
  • Görüntüleme Görüntüleme 560
Offline shop cpp üzerinden itemattr attr vaulpe kısımlarının socketlerini düzenleyiniz

offlineshop.cpp

All I did in that file was to delete the second coins and just make them Won and Yang

Kod:
    char szColumns[QUERY_MAX_LEN], szValues[QUERY_MAX_LEN];

    snprintf(szColumns, sizeof(szColumns),
        "owner_id, pos, count, price, price7, vnum,"
        "socket0, socket1, socket2,"
        "attrtype0, attrvalue0, attrtype1, attrvalue1,"
        "attrtype2, attrvalue2, attrtype3, attrvalue3,"
        "attrtype4, attrvalue4, attrtype5, attrvalue5,"
        "attrtype6, attrvalue6");

    snprintf(szValues, sizeof(szValues), "%u, %d, %u, %u, %u, %u, %ld, %ld, %ld, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",
        ch->GetPlayerID(), iPos, pkItem->GetCount(), iPrice, iPrice7, pkItem->GetVnum(),
        pkItem->GetSocket(0), pkItem->GetSocket(1),
        pkItem->GetSocket(2),
        pkItem->GetAttributeType(0), pkItem->GetAttributeValue(0), pkItem->GetAttributeType(1), pkItem->GetAttributeValue(1),
        pkItem->GetAttributeType(2), pkItem->GetAttributeValue(2), pkItem->GetAttributeType(3), pkItem->GetAttributeValue(3),
        pkItem->GetAttributeType(4), pkItem->GetAttributeValue(4), pkItem->GetAttributeType(5), pkItem->GetAttributeValue(5),
        pkItem->GetAttributeType(6), pkItem->GetAttributeValue(6));

offlineshop_manager.cpp

Kod:
void COfflineShopManager::FetchMyItems(LPCHARACTER ch)
{
    if (!ch)
        return;

    char szQuery[1024];
    snprintf(szQuery, sizeof(szQuery),
        "SELECT pos, count, vnum, socket0, socket1, socket2, "
        "attrtype0, attrvalue0, attrtype1, attrvalue1,"
        "attrtype2, attrvalue2, attrtype3, attrvalue3,"
        "attrtype4, attrvalue4, attrtype5, attrvalue5,"
        "attrtype6, attrvalue6 "
        "FROM %soffline_shop_item WHERE owner_id = %u", get_table_postfix(), ch->GetPlayerID());

    std::unique_ptr<SQLMsg> pMsg(DBManager::Instance().DirectQuery(szQuery));

    if (pMsg->Get()->uiNumRows == 0)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nothing found."));
        return;
    }

    MYSQL_ROW row;
    while (NULL != (row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
    {
        TPlayerItem item;

        str_to_number(item.pos, row[0]);
        str_to_number(item.count, row[1]);
        str_to_number(item.vnum, row[2]);

        for (int i = 0, n = 3; i < ITEM_SOCKET_MAX_NUM; ++i, n++)
            str_to_number(item.alSockets[i], row[n]);

        for (int i = 0, iStartAttributeType = 6, iStartAttributeValue = ITEM_ATTRIBUTE_MAX_NUM; i < ITEM_ATTRIBUTE_MAX_NUM; ++i, iStartAttributeType += 2, iStartAttributeValue += 2)
        {
            str_to_number(item.aAttr[i].bType, row[iStartAttributeType]);
            str_to_number(item.aAttr[i].sValue, row[iStartAttributeValue]);
        }

        LPITEM pItem = ITEM_MANAGER::instance().CreateItem(item.vnum, item.count);

        if (pItem)
        {
            pItem->SetSockets(item.alSockets);
            pItem->SetAttributes(item.aAttr);

            int cell;
            cell = ch->GetEmptyInventory(pItem->GetSize());

            if (cell != -1)
            {
                pItem->AddToCharacter(ch, TItemPos(INVENTORY, cell));
            }
            else
            {
                pItem->AddToGround(ch->GetMapIndex(), ch->GetXYZ());
                pItem->StartDestroyEvent();
                pItem->SetOwnership(ch, 60);
            }

            DBManager::instance().DirectQuery("DELETE FROM %soffline_shop_item WHERE owner_id = %u AND pos = %d AND vnum = %d LIMIT 1", get_table_postfix(), ch->GetPlayerID(), item.pos, item.vnum);

            LogManager::instance().OfflineShopLog(ch->GetDesc()->GetAccountTable().id, pItem->GetName(), "FETCH");
        }
    }
}
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst