InfernoShade 1
InfernoShade
farkmt2official 1
farkmt2official
romegames 1
romegames
bikral 1
bikral
PrimeAC 1
PrimeAC
shrpnl 1
shrpnl
Agora Metin2 1
Agora Metin2
xranzei 1
xranzei
Bvural41 1
Bvural41
Hikaye Ekle

Simya envanteri düzenlemesi !

  • Konuyu başlatan Konuyu başlatan [DEV]AB
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 51
  • Görüntüleme Görüntüleme 5K

[DEV]AB

Level 9
Telefon Numarası Onaylanmış Üye
TM Üye
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
Ticaret - 100%
8   0   0

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.
Ç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)

Geri
Üst