HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. HEMEN TIKLA!
Offline shop cpp üzerinden itemattr attr vaulpe kısımlarının socketlerini düzenleyiniz
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));
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");
}
}
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?