- Katılım
- 15 Nis 2016
- Konular
- 115
- Mesajlar
- 4,815
- Çözüm
- 58
- Online süresi
- 8mo 4d
- Reaksiyon Skoru
- 1,107
- Altın Konu
- 3
- Başarım Puanı
- 279
- MmoLira
- 6,261
- DevLira
- 66
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!
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
Kod:
CItem * GetItemByPosition(int i) const { return m_apItems[i]; }
Son düzenleme:
En Çok Reaksiyon Alan Mesajlar
Kardeşim onunla ne alakası var?
Tamam ben anladım mevzuyu tek taraftan simya verdiğinde diyelim 2 slot boşluğu var 3 tane verisen başarılı diyor ama 2 tanesi geliyor 1 tanesi gelmiyor. Eğer takas yaparken karşı karakterden herhangi bir eşya koyarsan simya deposu dolu olduğundan dolayı yer yok diyor. Artık o da çok sorun değil fixi gelirse yaparım. teşekkürler.
if (item->IsDragonSoul()) empty_pos = victim->GetEmptyDragonSoulInventory(item); else empty_pos = victim->GetEmptyInventory(item->GetSize()); if (empty_pos < 0) { sys_err("Exchange::Done : Cannot find blank position in inventory %s <-> %s item %s", m_pOwner->GetName(), victim->GetName(), item->GetName()); continue; }
ne alakası olduğunu bu kod bloğundan anlayabilirsin .
simya envanteri veya normal envanterinde yer olmadığında "continue;" çekiyor buda envanterin doluyken ticaret yapabileceğin anlamına geliyor.
eğer continue'yi return falseye çevirirsen ticaret yapımını engellemiş olsun.
Kaynaklarımızda ne varsa döküyorsun durmanın zamanı gelmedi sence yiğidim @atakanbakir
Öğeyi görmek için üye olmalısınız.
- Katılım
- 5 Eki 2015
- Konular
- 139
- Mesajlar
- 2,435
- Çözüm
- 33
- Online süresi
- 1mo 24d
- Reaksiyon Skoru
- 3,929
- Altın Konu
- 3
- Başarım Puanı
- 268
- MmoLira
- 20,299
- DevLira
- 163
Eline sağlık
- Katılım
- 16 Ara 2018
- Konular
- 7
- Mesajlar
- 104
- Çözüm
- 1
- Reaksiyon Skoru
- 34
- Altın Konu
- 0
- TM Yaşı
- 7 Yıl 6 Ay 3 Gün
- Başarım Puanı
- 41
- Yaş
- 24
- MmoLira
- 80
- DevLira
- 0
Çoğu serverde büyük bir sıkıntıydı kralsın bro
Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)
Benzer konular
- Cevaplar
- 12
- Görüntüleme
- 612
- Cevaplar
- 9
- Görüntüleme
- 454
- Cevaplar
- 20
- Görüntüleme
- 820
- Cevaplar
- 8
- Görüntüleme
- 310
- Cevaplar
- 3
- Görüntüleme
- 393










