K Envanter Sistemi

  • Konuyu açan Konuyu açan CuRSED
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 9
  • Gösterim Gösterim 3K

CuRSED

MT Üye
MT Üye
Mesaj
161
Çözümler
1
Beğeni
472
Puan
784
Ticaret Puanı
0



Linkleri görebilmek için giriş yap veya kayıt ol.


Linkleri görebilmek için giriş yap veya kayıt ol.

C++:
Genişlet Daralt Kopyala
#include "stdafx.h"
#include "../../libgame/include/grid.h"
#include "utils.h"
#include "desc.h"
#include "desc_client.h"
#include "char.h"
#include "item.h"
#include "item_manager.h"
#include "packet.h"
#include "log.h"
#include "db.h"
#include "locale_service.h"
#include "../../common/length.h"
#include "exchange.h"
#include "DragonSoul.h"
#include "questmanager.h" // @fixme150

void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, DWORD arg1, TItemPos arg2, DWORD arg3, void * pvData = NULL);

// ±³È¯ ÆĞŶ
void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, DWORD arg1, TItemPos arg2, DWORD arg3, void * pvData)
{
    if (!ch->GetDesc())
        return;

    struct packet_exchange pack_exchg;

    pack_exchg.header         = HEADER_GC_EXCHANGE;
    pack_exchg.sub_header     = sub_header;
    pack_exchg.is_me        = is_me;
    pack_exchg.arg1        = arg1;
    pack_exchg.arg2        = arg2;
    pack_exchg.arg3        = arg3;

    if (sub_header == EXCHANGE_SUBHEADER_GC_ITEM_ADD && pvData)
    {
        thecore_memcpy(&pack_exchg.alSockets, ((LPITEM) pvData)->GetSockets(), sizeof(pack_exchg.alSockets));
        thecore_memcpy(&pack_exchg.aAttr, ((LPITEM) pvData)->GetAttributes(), sizeof(pack_exchg.aAttr));
    }
    else
    {
        memset(&pack_exchg.alSockets, 0, sizeof(pack_exchg.alSockets));
        memset(&pack_exchg.aAttr, 0, sizeof(pack_exchg.aAttr));
    }

    ch->GetDesc()->Packet(&pack_exchg, sizeof(pack_exchg));
}

// ±³È¯À» ½ÃÀÛ
bool CHARACTER::ExchangeStart(LPCHARACTER victim)
{
    if (this == victim)    // ÀÚ±â ÀڽŰú´Â ±³È¯À» ¸øÇÑ´Ù.
        return false;

    if (IsObserverMode())
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°üÀü »óÅ¿¡¼´Â ±³È¯À» ÇÒ ¼ö ¾ø½À´Ï´Ù."));
        return false;
    }

    if (victim->IsNPC())
        return false;

    //PREVENT_TRADE_WINDOW
    if ( IsOpenSafebox() || GetShopOwner() || GetMyShop() || IsCubeOpen())
    {
        ChatPacket( CHAT_TYPE_INFO, LC_TEXT("´Ù¸¥ °Å·¡Ã¢ÀÌ ¿·ÁÀÖÀ»°æ¿ì °Å·¡¸¦ ÇÒ¼ö ¾ø½À´Ï´Ù." ) );
        return false;
    }

    if ( victim->IsOpenSafebox() || victim->GetShopOwner() || victim->GetMyShop() || victim->IsCubeOpen() )
    {
        ChatPacket( CHAT_TYPE_INFO, LC_TEXT("»ó´ë¹æÀÌ ´Ù¸¥ °Å·¡ÁßÀ̶ó °Å·¡¸¦ ÇÒ¼ö ¾ø½À´Ï´Ù." ) );
        return false;
    }
    //END_PREVENT_TRADE_WINDOW
    int iDist = DISTANCE_APPROX(GetX() - victim->GetX(), GetY() - victim->GetY());

    // °Å¸® üũ
    if (iDist >= EXCHANGE_MAX_DISTANCE)
        return false;

    if (GetExchange())
        return false;

    if (victim->GetExchange())
    {
        exchange_packet(this, EXCHANGE_SUBHEADER_GC_ALREADY, 0, 0, NPOS, 0);
        return false;
    }

    if (victim->IsBlockMode(BLOCK_EXCHANGE))
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ë¹æÀÌ ±³È¯ °ÅºÎ »óÅÂÀÔ´Ï´Ù."));
        return false;
    }

    SetExchange(M2_NEW CExchange(this));
    victim->SetExchange(M2_NEW CExchange(victim));

    victim->GetExchange()->SetCompany(GetExchange());
    GetExchange()->SetCompany(victim->GetExchange());

    //
    SetExchangeTime();
    victim->SetExchangeTime();

    exchange_packet(victim, EXCHANGE_SUBHEADER_GC_START, 0, GetVID(), NPOS, 0);
    exchange_packet(this, EXCHANGE_SUBHEADER_GC_START, 0, victim->GetVID(), NPOS, 0);

    return true;
}

CExchange::CExchange(LPCHARACTER pOwner)
{
    m_pCompany = NULL;

    m_bAccept = false;

    for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
    {
        m_apItems[i] = NULL;
        m_aItemPos[i] = NPOS;
        m_abItemDisplayPos[i] = 0;
    }

    m_lGold = 0;

    m_pOwner = pOwner;
    pOwner->SetExchange(this);

    m_pGrid = M2_NEW CGrid(4,3);
}

CExchange::~CExchange()
{
    M2_DELETE(m_pGrid);
}

bool CExchange::AddItem(TItemPos item_pos, BYTE display_pos)
{
    assert(m_pOwner != NULL && GetCompany());

    if (!item_pos.IsValidItemPosition())
        return false;

    // Àåºñ´Â ±³È¯ÇÒ ¼ö ¾øÀ½
    if (item_pos.IsEquipPosition())
        return false;

    LPITEM item;

    if (!(item = m_pOwner->GetItem(item_pos)))
        return false;

    if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_GIVE))
    {
        m_pOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¾ÆÀÌÅÛÀ» °Ç³×ÁÙ ¼ö ¾ø½À´Ï´Ù."));
        return false;
    }

    if (true == item->isLocked())
    {
        return false;
    }

    // ÀÌ¹Ì ±³È¯Ã¢¿¡ Ãß°¡µÈ ¾ÆÀÌÅÛÀΰ¡?
    if (item->IsExchanging())
    {
        sys_log(0, "EXCHANGE under exchanging");
        return false;
    }

    if (!m_pGrid->IsEmpty(display_pos, 1, item->GetSize()))
    {
        sys_log(0, "EXCHANGE not empty item_pos %d %d %d", display_pos, 1, item->GetSize());
        return false;
    }

    Accept(false);
    GetCompany()->Accept(false);

    for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
    {
        if (m_apItems[i])
            continue;

        m_apItems[i]        = item;
        m_aItemPos[i]        = item_pos;
        m_abItemDisplayPos[i]    = display_pos;
        m_pGrid->Put(display_pos, 1, item->GetSize());

        item->SetExchanging(true);

        exchange_packet(m_pOwner,
                EXCHANGE_SUBHEADER_GC_ITEM_ADD,
                true,
                item->GetVnum(),
                TItemPos(RESERVED_WINDOW, display_pos),
                item->GetCount(),
                item);

        exchange_packet(GetCompany()->GetOwner(),
                EXCHANGE_SUBHEADER_GC_ITEM_ADD,
                false,
                item->GetVnum(),
                TItemPos(RESERVED_WINDOW, display_pos),
                item->GetCount(),
                item);

        sys_log(0, "EXCHANGE AddItem success %s pos(%d, %d) %d", item->GetName(), item_pos.window_type, item_pos.cell, display_pos);

        return true;
    }

    // Ãß°¡ÇÒ °ø°£ÀÌ ¾øÀ½
    return false;
}

bool CExchange::RemoveItem(BYTE pos)
{
    if (pos >= EXCHANGE_ITEM_MAX_NUM)
        return false;

    if (!m_apItems[pos])
        return false;

    TItemPos PosOfInventory = m_aItemPos[pos];
    m_apItems[pos]->SetExchanging(false);

    m_pGrid->Get(m_abItemDisplayPos[pos], 1, m_apItems[pos]->GetSize());

    exchange_packet(GetOwner(),    EXCHANGE_SUBHEADER_GC_ITEM_DEL, true, pos, NPOS, 0);
    exchange_packet(GetCompany()->GetOwner(), EXCHANGE_SUBHEADER_GC_ITEM_DEL, false, pos, PosOfInventory, 0);

    Accept(false);
    GetCompany()->Accept(false);

    m_apItems[pos]        = NULL;
    m_aItemPos[pos]        = NPOS;
    m_abItemDisplayPos[pos] = 0;
    return true;
}

bool CExchange::AddGold(long gold)
{
    if (gold <= 0)
        return false;

    if (GetOwner()->GetGold() < gold)
    {
        // °¡Áö°í ÀÖ´Â µ·ÀÌ ºÎÁ·.
        exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_LESS_GOLD, 0, 0, NPOS, 0);
        return false;
    }

    if (m_lGold > 0)
        return false;

    Accept(false);
    GetCompany()->Accept(false);

    m_lGold = gold;

    exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, true, m_lGold, NPOS, 0);
    exchange_packet(GetCompany()->GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, false, m_lGold, NPOS, 0);
    return true;
}

// µ·ÀÌ ÃæºĞÈ÷ ÀÖ´ÂÁö, ±³È¯ÇÏ·Á´Â ¾ÆÀÌÅÛÀÌ ½ÇÁ¦·Î ÀÖ´ÂÁö È®ÀÎ ÇÑ´Ù.
bool CExchange::Check(int * piItemCount)
{
    if (GetOwner()->GetGold() < m_lGold)
        return false;

    int item_count = 0;

    for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
    {
        if (!m_apItems[i])
            continue;

        if (!m_aItemPos[i].IsValidItemPosition())
            return false;

        if (m_apItems[i] != GetOwner()->GetItem(m_aItemPos[i]))
            return false;

        ++item_count;
    }

    *piItemCount = item_count;
    return true;
}

bool CExchange::CheckSpace()
{
    static CGrid s_grid1(INVENTORY_PAGE_COLUMN, INVENTORY_PAGE_ROW);
    static CGrid s_grid2(INVENTORY_PAGE_COLUMN, INVENTORY_PAGE_ROW);
    static CGrid s_grid3(INVENTORY_PAGE_COLUMN, INVENTORY_PAGE_ROW);
    static CGrid s_grid4(INVENTORY_PAGE_COLUMN, INVENTORY_PAGE_ROW);
    static CGrid s_grid5(INVENTORY_PAGE_COLUMN, INVENTORY_PAGE_ROW);

#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
    LPCHARACTER    me = GetOwner();
    static CGrid s_grid6(5, SKILL_BOOK_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid7(5, SKILL_BOOK_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid8(5, SKILL_BOOK_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid9(5, UPGRADE_ITEMS_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid10(5, UPGRADE_ITEMS_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid11(5, UPGRADE_ITEMS_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid12(5, STONE_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid13(5, STONE_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid14(5, STONE_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid15(5, BOX_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid16(5, BOX_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid17(5, BOX_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid18(5, EFSUN_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid19(5, EFSUN_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid20(5, EFSUN_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid21(5, CICEK_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid22(5, CICEK_INVENTORY_MAX_NUM / 5 / 4);
    static CGrid s_grid23(5, CICEK_INVENTORY_MAX_NUM / 5 / 4);
#endif

    s_grid1.Clear();
    s_grid2.Clear();
    s_grid3.Clear();
    s_grid4.Clear();
    s_grid5.Clear();

#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
    s_grid6.Clear();
    s_grid7.Clear();
    s_grid8.Clear();
    s_grid9.Clear();
    s_grid10.Clear();
    s_grid11.Clear();
    s_grid12.Clear();
    s_grid13.Clear();
    s_grid14.Clear();
    s_grid15.Clear();
    s_grid16.Clear();
    s_grid17.Clear();
    s_grid18.Clear();
    s_grid19.Clear();
    s_grid20.Clear();
    s_grid21.Clear();
    s_grid22.Clear();
    s_grid23.Clear();
#endif

    LPCHARACTER    victim = GetCompany()->GetOwner();
    LPITEM item;

    int i;

    for (i = 0; i < INVENTORY_PAGE_SIZE*1; ++i)
    {
        if (!(item = victim->GetInventoryItem(i)))
            continue;

        s_grid1.Put(i, 1, item->GetSize());
    }
    for (i = INVENTORY_PAGE_SIZE*1; i < INVENTORY_PAGE_SIZE*2; ++i)
    {
        if (!(item = victim->GetInventoryItem(i)))
            continue;

        s_grid2.Put(i - INVENTORY_PAGE_SIZE*1, 1, item->GetSize());
    }
    for (i = INVENTORY_PAGE_SIZE*2; i < INVENTORY_PAGE_SIZE*3; ++i)
    {
        if (!(item = victim->GetInventoryItem(i)))
            continue;

        s_grid3.Put(i - INVENTORY_PAGE_SIZE*2, 1, item->GetSize());
    }
    for (i = INVENTORY_PAGE_SIZE*3; i < INVENTORY_PAGE_SIZE*4; ++i)
    {
        if (!(item = victim->GetInventoryItem(i)))
            continue;

        s_grid4.Put(i - INVENTORY_PAGE_SIZE*3, 1, item->GetSize());
    }
    for (i = INVENTORY_PAGE_SIZE * 4; i < INVENTORY_PAGE_SIZE * 5; ++i)
    {
        if (!(item = victim->GetInventoryItem(i)))
            continue;

        s_grid5.Put(i - INVENTORY_PAGE_SIZE * 4, 1, item->GetSize());
    }

#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
    int b;
    int v;
    int u;
    int r;
    int a;
    int l;
    const int perPageSkillBookSlotCount = 45;
    const int perPageUpgradeItemsSlotCount = 45;
    const int perPageStoneSlotCount = 45;
    const int perPageBoxSlotCount = 45;
    const int perPageEfsunSlotCount = 45;
    const int perPageCicekSlotCount = 45;
    for (b = 0; b < SKILL_BOOK_INVENTORY_MAX_NUM; ++b) {
        if (!(item = me->GetSkillBookInventoryItem(b)))
            continue;
        
        BYTE itemSize = item->GetSize();
            
        if (i < perPageSkillBookSlotCount) // Notice: This is adjusted for 3 Pages only!
            s_grid6.Put(i, 1, itemSize);
        else if (i < perPageSkillBookSlotCount * 2)
            s_grid7.Put(i - perPageSkillBookSlotCount, 1, itemSize);
        else if (i < perPageSkillBookSlotCount * 3)
            s_grid8.Put(i - perPageSkillBookSlotCount * 2, 1, itemSize);
    }
    
    for (v = 0; v < UPGRADE_ITEMS_INVENTORY_MAX_NUM; ++v) {
        if (!(item = me->GetUpgradeItemsInventoryItem(v)))
            continue;
        
        BYTE itemSize = item->GetSize();
        
        if (i < perPageUpgradeItemsSlotCount) // Notice: This is adjusted for 3 Pages only!
            s_grid9.Put(i, 1, itemSize);
        else if (i < perPageUpgradeItemsSlotCount * 2)
            s_grid10.Put(i - perPageUpgradeItemsSlotCount, 1, itemSize);
        else if (i < perPageUpgradeItemsSlotCount * 3)
            s_grid11.Put(i - perPageUpgradeItemsSlotCount * 2, 1, itemSize);
    }
    
    for (u = 0; u < STONE_INVENTORY_MAX_NUM; ++u) {
        if (!(item = me->GetStoneInventoryItem(u)))
            continue;
        
        BYTE itemSize = item->GetSize();
        
        if (i < perPageStoneSlotCount) // Notice: This is adjusted for 3 Pages only!
            s_grid12.Put(i, 1, itemSize);
        else if (i < perPageStoneSlotCount * 2)
            s_grid13.Put(i - perPageStoneSlotCount, 1, itemSize);
        else if (i < perPageStoneSlotCount * 3)
            s_grid14.Put(i - perPageStoneSlotCount * 2, 1, itemSize);
    }
    
    for (r = 0; r < BOX_INVENTORY_MAX_NUM; ++r) {
        if (!(item = me->GetBoxInventoryItem(r)))
            continue;
        
        BYTE itemSize = item->GetSize();
        
        if (i < perPageBoxSlotCount) // Notice: This is adjusted for 3 Pages only!
            s_grid15.Put(i, 1, itemSize);
        else if (i < perPageBoxSlotCount * 2)
            s_grid16.Put(i - perPageBoxSlotCount, 1, itemSize);
        else if (i < perPageBoxSlotCount * 3)
            s_grid17.Put(i - perPageBoxSlotCount * 2, 1, itemSize);
    }
    
    for (a = 0; a < EFSUN_INVENTORY_MAX_NUM; ++a) {
        if (!(item = me->GetEfsunInventoryItem(a)))
            continue;
        
        BYTE itemSize = item->GetSize();
        
        if (i < perPageEfsunSlotCount) // Notice: This is adjusted for 3 Pages only!
            s_grid18.Put(i, 1, itemSize);
        else if (i < perPageEfsunSlotCount * 2)
            s_grid19.Put(i - perPageEfsunSlotCount, 1, itemSize);
        else if (i < perPageEfsunSlotCount * 3)
            s_grid20.Put(i - perPageEfsunSlotCount * 2, 1, itemSize);
    }
    
    for (l = 0; l < CICEK_INVENTORY_MAX_NUM; ++l) {
        if (!(item = me->GetCicekInventoryItem(l)))
            continue;
        
        BYTE itemSize = item->GetSize();
        
        if (i < perPageCicekSlotCount) // Notice: This is adjusted for 3 Pages only!
            s_grid21.Put(i, 1, itemSize);
        else if (i < perPageCicekSlotCount * 2)
            s_grid22.Put(i - perPageCicekSlotCount, 1, itemSize);
        else if (i < perPageCicekSlotCount * 3)
            s_grid23.Put(i - perPageCicekSlotCount * 2, 1, itemSize);
    }
#endif

    // ¾Æ... ¹º°¡ °³º´½Å °°Áö¸¸... ¿ëÈ¥¼® Àκ¥À» ³ë¸Ö Àκ¥ º¸°í µû¶ó ¸¸µç ³» À߸øÀÌ´Ù ¤Ğ¤Ğ
    static std::vector <WORD> s_vDSGrid(DRAGON_SOUL_INVENTORY_MAX_NUM);

    // ÀÏ´Ü ¿ëÈ¥¼®À» ±³È¯ÇÏÁö ¾ÊÀ» °¡´É¼ºÀÌ Å©¹Ç·Î, ¿ëÈ¥¼® Àκ¥ º¹»ç´Â ¿ëÈ¥¼®ÀÌ ÀÖÀ» ¶§ Çϵµ·Ï ÇÑ´Ù.
    bool bDSInitialized = false;

    for (i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
    {
        if (!(item = m_apItems[i]))
            continue;

        if (item->IsDragonSoul())
        {
            if (!victim->DragonSoul_IsQualified())
            {
                return false;
            }

            if (!bDSInitialized)
            {
                bDSInitialized = true;
                victim->CopyDragonSoulItemGrid(s_vDSGrid);
            }

            bool bExistEmptySpace = false;
            WORD wBasePos = DSManager::instance().GetBasePosition(item);
            if (wBasePos >= DRAGON_SOUL_INVENTORY_MAX_NUM)
                return false;

            for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; i++)
            {
                WORD wPos = wBasePos + i;
                if (0 == s_vDSGrid[wPos]) // @fixme159 (wBasePos to wPos)
                {
                    bool bEmpty = true;
                    for (int j = 1; j < item->GetSize(); j++)
                    {
                        if (s_vDSGrid[wPos + j * DRAGON_SOUL_BOX_COLUMN_NUM])
                        {
                            bEmpty = false;
                            break;
                        }
                    }
                    if (bEmpty)
                    {
                        for (int j = 0; j < item->GetSize(); j++)
                        {
                            s_vDSGrid[wPos + j * DRAGON_SOUL_BOX_COLUMN_NUM] =  wPos + 1;
                        }
                        bExistEmptySpace = true;
                        break;
                    }
                }
                if (bExistEmptySpace)
                    break;
            }
            if (!bExistEmptySpace)
                return false;
        }
#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
        else if (item->IsSkillBook())
        {
            BYTE itemSize = item->GetSize();
            int iPos = s_grid6.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid6.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid7.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid7.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid8.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid8.Put(iPos, 1, itemSize);
                continue;
            }
            
            return false;
        }
        else if (item->IsUpgradeItem())
        {
            BYTE itemSize = item->GetSize();
            int iPos = s_grid9.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid9.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid10.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid10.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid11.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid11.Put(iPos, 1, itemSize);
                continue;
            }
            
            return false;
        }
        else if (item->IsStone())
        {
            BYTE itemSize = item->GetSize();
            int iPos = s_grid12.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid12.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid13.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid13.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid14.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid14.Put(iPos, 1, itemSize);
                continue;
            }
            
            return false;
        }
        else if (item->IsBox())
        {
            BYTE itemSize = item->GetSize();
            int iPos = s_grid15.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid15.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid16.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid16.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid17.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid17.Put(iPos, 1, itemSize);
                continue;
            }
            
            return false;
        }
        else if (item->IsEfsun())
        {
            BYTE itemSize = item->GetSize();
            int iPos = s_grid18.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid18.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid19.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid19.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid20.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid20.Put(iPos, 1, itemSize);
                continue;
            }
            
            return false;
        }
        else if (item->IsCicek())
        {
            BYTE itemSize = item->GetSize();
            int iPos = s_grid21.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid21.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid22.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid22.Put(iPos, 1, itemSize);
                continue;
            }
            
            iPos = s_grid23.FindBlank(1, itemSize);
            if (iPos >= 0) {
                s_grid23.Put(iPos, 1, itemSize);
                continue;
            }
            
            return false;
        }
#endif
        else
        {
            int iPos;

            if ((iPos = s_grid1.FindBlank(1, item->GetSize())) >= 0)
            {
                s_grid1.Put(iPos, 1, item->GetSize());
            }
            else if ((iPos = s_grid2.FindBlank(1, item->GetSize())) >= 0)
            {
                s_grid2.Put(iPos, 1, item->GetSize());
            }
            else if ((iPos = s_grid3.FindBlank(1, item->GetSize())) >= 0)
            {
                s_grid3.Put(iPos, 1, item->GetSize());
            }
            else if ((iPos = s_grid4.FindBlank(1, item->GetSize())) >= 0)
            {
                s_grid4.Put(iPos, 1, item->GetSize());
            }
            else if ((iPos = s_grid4.FindBlank(1, item->GetSize())) >= 0)
            {
                s_grid5.Put(iPos, 1, item->GetSize());
            }
            else
                return false;
        }
    }

    return true;
}

// ±³È¯ ³¡ (¾ÆÀÌÅÛ°ú µ· µîÀ» ½ÇÁ¦·Î ¿Å±ä´Ù)
bool CExchange::Done()
{
    int        empty_pos, i;
    LPITEM    item;

    LPCHARACTER    victim = GetCompany()->GetOwner();

    for (i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
    {
        if (!(item = m_apItems[i]))
            continue;

        if (item->IsDragonSoul())
            empty_pos = victim->GetEmptyDragonSoulInventory(item);
#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
        else if (item->IsSkillBook())
            empty_pos = victim->GetEmptySkillBookInventory(item->GetSize());
        else if (item->IsUpgradeItem())
            empty_pos = victim->GetEmptyUpgradeItemsInventory(item->GetSize());
        else if (item->IsStone())
            empty_pos = victim->GetEmptyStoneInventory(item->GetSize());
        else if (item->IsBox())
            empty_pos = victim->GetEmptyBoxInventory(item->GetSize());
        else if (item->IsEfsun())
            empty_pos = victim->GetEmptyEfsunInventory(item->GetSize());
        else if (item->IsCicek())
            empty_pos = victim->GetEmptyCicekInventory(item->GetSize());
#endif
        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;
        }

        assert(empty_pos >= 0);

        if (item->GetVnum() == 90008 || item->GetVnum() == 90009) // VCARD
        {
            VCardUse(m_pOwner, victim, item);
            continue;
        }

        m_pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 255);

        item->RemoveFromCharacter();
        if (item->IsDragonSoul())
            item->AddToCharacter(victim, TItemPos(DRAGON_SOUL_INVENTORY, empty_pos));
#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
        else if (item->IsSkillBook())
            item->AddToCharacter(victim, TItemPos(INVENTORY, empty_pos));
        else if (item->IsUpgradeItem())
            item->AddToCharacter(victim, TItemPos(INVENTORY, empty_pos));
        else if (item->IsStone())
            item->AddToCharacter(victim, TItemPos(INVENTORY, empty_pos));
        else if (item->IsBox())
            item->AddToCharacter(victim, TItemPos(INVENTORY, empty_pos));
        else if (item->IsEfsun())
            item->AddToCharacter(victim, TItemPos(INVENTORY, empty_pos));
        else if (item->IsCicek())
            item->AddToCharacter(victim, TItemPos(INVENTORY, empty_pos));
#endif
        else
            item->AddToCharacter(victim, TItemPos(INVENTORY, empty_pos));
        ITEM_MANAGER::instance().FlushDelayedSave(item);

        item->SetExchanging(false);
        {
            char exchange_buf[51];

            snprintf(exchange_buf, sizeof(exchange_buf), "%s %u %u", item->GetName(), GetOwner()->GetPlayerID(), item->GetCount());
            LogManager::instance().ItemLog(victim, item, "EXCHANGE_TAKE", exchange_buf);

            snprintf(exchange_buf, sizeof(exchange_buf), "%s %u %u", item->GetName(), victim->GetPlayerID(), item->GetCount());
            LogManager::instance().ItemLog(GetOwner(), item, "EXCHANGE_GIVE", exchange_buf);

            if (item->GetVnum() >= 80003 && item->GetVnum() <= 80007)
            {
                LogManager::instance().GoldBarLog(victim->GetPlayerID(), item->GetID(), EXCHANGE_TAKE, "");
                LogManager::instance().GoldBarLog(GetOwner()->GetPlayerID(), item->GetID(), EXCHANGE_GIVE, "");
            }
        }

        m_apItems[i] = NULL;
    }

    if (m_lGold)
    {
        GetOwner()->PointChange(POINT_GOLD, -m_lGold, true);
        victim->PointChange(POINT_GOLD, m_lGold, true);

        if (m_lGold > 1000)
        {
            char exchange_buf[51];
            snprintf(exchange_buf, sizeof(exchange_buf), "%u %s", GetOwner()->GetPlayerID(), GetOwner()->GetName());
            LogManager::instance().CharLog(victim, m_lGold, "EXCHANGE_GOLD_TAKE", exchange_buf);

            snprintf(exchange_buf, sizeof(exchange_buf), "%u %s", victim->GetPlayerID(), victim->GetName());
            LogManager::instance().CharLog(GetOwner(), m_lGold, "EXCHANGE_GOLD_GIVE", exchange_buf);
        }
    }

    m_pGrid->Clear();
    return true;
}

// ±³È¯À» µ¿ÀÇ
bool CExchange::Accept(bool bAccept)
{
    if (m_bAccept == bAccept)
        return true;

    m_bAccept = bAccept;

    // µÑ ´Ù µ¿ÀÇ ÇßÀ¸¹Ç·Î ±³È¯ ¼º¸³
    if (m_bAccept && GetCompany()->m_bAccept)
    {
        int    iItemCount;

        LPCHARACTER victim = GetCompany()->GetOwner();

        //PREVENT_PORTAL_AFTER_EXCHANGE
        GetOwner()->SetExchangeTime();
        victim->SetExchangeTime();
        //END_PREVENT_PORTAL_AFTER_EXCHANGE

        // @fixme150 BEGIN
        if (quest::CQuestManager::instance().GetPCForce(GetOwner()->GetPlayerID())->IsRunning() == true)
        {
            GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot trade if you're using quests"));
            victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot trade if the other part using quests"));
            goto EXCHANGE_END;
        }
        else if (quest::CQuestManager::instance().GetPCForce(victim->GetPlayerID())->IsRunning() == true)
        {
            victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot trade if you're using quests"));
            GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot trade if the other part using quests"));
            goto EXCHANGE_END;
        }
        // @fixme150 END

        // exchange_check ¿¡¼´Â ±³È¯ÇÒ ¾ÆÀÌÅÛµéÀÌ Á¦ÀÚ¸®¿¡ ÀÖ³ª È®ÀÎÇÏ°í,
        // ¿¤Å©µµ ÃæºĞÈ÷ ÀÖ³ª È®ÀÎÇÑ´Ù, µÎ¹ø° ÀÎÀÚ·Î ±³È¯ÇÒ ¾ÆÀÌÅÛ °³¼ö
        // ¸¦ ¸®ÅÏÇÑ´Ù.
        if (!Check(&iItemCount))
        {
            GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("µ·ÀÌ ºÎÁ·Çϰųª ¾ÆÀÌÅÛÀÌ Á¦ÀÚ¸®¿¡ ¾ø½À´Ï´Ù."));
            victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ë¹æÀÇ µ·ÀÌ ºÎÁ·Çϰųª ¾ÆÀÌÅÛÀÌ Á¦ÀÚ¸®¿¡ ¾ø½À´Ï´Ù."));
            goto EXCHANGE_END;
        }

        // ¸®ÅÏ ¹ŞÀº ¾ÆÀÌÅÛ °³¼ö·Î »ó´ë¹æÀÇ ¼ÒÁöÇ°¿¡ ³²Àº ÀÚ¸®°¡ ÀÖ³ª È®ÀÎÇÑ´Ù.
        if (!CheckSpace())
        {
            GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ë¹æÀÇ ¼ÒÁöÇ°¿¡ ºó °ø°£ÀÌ ¾ø½À´Ï´Ù."));
            victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇ°¿¡ ºó °ø°£ÀÌ ¾ø½À´Ï´Ù."));
            goto EXCHANGE_END;
        }

        // »ó´ë¹æµµ ¸¶Âù°¡Áö·Î..
        if (!GetCompany()->Check(&iItemCount))
        {
            victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("µ·ÀÌ ºÎÁ·Çϰųª ¾ÆÀÌÅÛÀÌ Á¦ÀÚ¸®¿¡ ¾ø½À´Ï´Ù."));
            GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ë¹æÀÇ µ·ÀÌ ºÎÁ·Çϰųª ¾ÆÀÌÅÛÀÌ Á¦ÀÚ¸®¿¡ ¾ø½À´Ï´Ù."));
            goto EXCHANGE_END;
        }

        if (!GetCompany()->CheckSpace())
        {
            victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ë¹æÀÇ ¼ÒÁöÇ°¿¡ ºó °ø°£ÀÌ ¾ø½À´Ï´Ù."));
            GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇ°¿¡ ºó °ø°£ÀÌ ¾ø½À´Ï´Ù."));
            goto EXCHANGE_END;
        }

        if (db_clientdesc->GetSocket() == INVALID_SOCKET)
        {
            sys_err("Cannot use exchange feature while DB cache connection is dead.");
            victim->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
            GetOwner()->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
            goto EXCHANGE_END;
        }

        if (Done())
        {
            if (m_lGold) // µ·ÀÌ ÀÖÀ» ‹š¸¸ ÀúÀå
                GetOwner()->Save();

            if (GetCompany()->Done())
            {
                if (GetCompany()->m_lGold) // µ·ÀÌ ÀÖÀ» ¶§¸¸ ÀúÀå
                    victim->Save();

                // INTERNATIONAL_VERSION
                GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ´Ô°úÀÇ ±³È¯ÀÌ ¼º»ç µÇ¾ú½À´Ï´Ù."), victim->GetName());
                victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s ´Ô°úÀÇ ±³È¯ÀÌ ¼º»ç µÇ¾ú½À´Ï´Ù."), GetOwner()->GetName());
                // END_OF_INTERNATIONAL_VERSION
            }
        }

EXCHANGE_END:
        Cancel();
        return false;
    }
    else
    {
        // ¾Æ´Ï¸é accept¿¡ ´ëÇÑ ÆĞŶÀ» º¸³»ÀÚ.
        exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_ACCEPT, true, m_bAccept, NPOS, 0);
        exchange_packet(GetCompany()->GetOwner(), EXCHANGE_SUBHEADER_GC_ACCEPT, false, m_bAccept, NPOS, 0);
        return true;
    }
}

// ±³È¯ Ãë¼Ò
void CExchange::Cancel()
{
    exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_END, 0, 0, NPOS, 0);
    GetOwner()->SetExchange(NULL);

    for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
    {
        if (m_apItems[i])
            m_apItems[i]->SetExchanging(false);
    }

    if (GetCompany())
    {
        GetCompany()->SetCompany(NULL);
        GetCompany()->Cancel();
    }

    M2_DELETE(this);
}

Linkleri görebilmek için giriş yap veya kayıt ol.
C++:
Genişlet Daralt Kopyala
char_item.cpp & char.h Açılır

BYTE bCell -> UINT bCell
BYTE bDestCell -> UINT bDestCell

Şeklinde tümünü değiştirsin
 

Dosya Eklentileri

bu sitemi eklememde yardımcı olabilecek birisi varmı dır ya gerek ücretlide olur
 
GÜNCEL BÖYLE BİR SYSER İLE KARŞI KARŞIYAYIM
 

Dosya Eklentileri

  • 2.webp
    2.webp
    51,4 KB · Gösterim: 167
Biraz saçma bi durum var uyarlamaya calısıyorumda sürükleyerek eklemesi için uideleteitem.py'de bunu yaptım

if app.WJ_SPLIT_INVENTORY_SYSTEM:
if player.SLOT_TYPE_INVENTORY != attachedSlotType and \
player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedSlotType and \
player.SLOT_TYPE_SKILL_BOOK_INVENTORY != attachedSlotType and \
player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY != attachedSlotType and \
player.SLOT_TYPE_STONE_INVENTORY != attachedSlotType and \
player.SLOT_TYPE_BOX_INVENTORY != attachedSlotType and \
player.SLOT_TYPE_EFSUN_INVENTORY != attachedSlotType and \
player.SLOT_TYPE_CICEK_INVENTORY != attachedSlotType:
return

başarılı ama şimdi sağ tıkla yapması için bişeyler yaptım direk envanterdeki itemleri alıyo yoksada cannot by item id 0 yazıyor

interfacemoduledeki kod bu
if app.WJ_SPLIT_INVENTORY_SYSTEM:
if self.wndExtendedInventory:
self.wndExtendedInventory.SetDeleteItemDlg(self.deleteitem)

0108_192510.webp


Hem sürükleyerek hemde sağ click ile sorunsuzca toplu satmaya geliyor artık yaptığım güncellemeyi paylaşayım kullanacaklar olabilir yardımım dokunsun.

interfacemodule.py
_MakeDialogs kısmındaki kod bu şekilde olsun

Kod:
Genişlet Daralt Kopyala
        if app.ENABLE_ITEM_DELETE_SYSTEM:
            self.deleteitem = uiDeleteItem.DeleteItem()
            self.deleteitem.BindInterface(self)
            self.deleteitem.Hide()
            if self.wndInventory:
                self.wndInventory.SetDeleteItemDlg(self.deleteitem)
            if app.WJ_SPLIT_INVENTORY_SYSTEM:
                if self.wndExtendedInventory:
                    self.wndExtendedInventory.SetDeleteItemDlg(self.deleteitem)
            if app.ENABLE_DRAGON_SOUL_SYSTEM:
                if self.wndDragonSoul:
                    self.wndDragonSoul.SetDeleteItemDlg(self.deleteitem)

uiinventory.py içindeki ExtendedInventoryWindow clası bu şekilde olsun if app.ENABLE_ITEM_DELETE_SYSTEM: içindeki bu if taglarındaki kodları aynen yaparsanız sorunsuz olacaktır

Kod:
Genişlet Daralt Kopyala
if app.WJ_SPLIT_INVENTORY_SYSTEM:
    class ExtendedInventoryWindow(ui.ScriptWindow):
        tooltipItem = None
        interface = None
        dlgPickMoney = None
        if app.ENABLE_ITEM_DELETE_SYSTEM:
            wndItemDelete = None
        dlgPickItem = None
        sellingSlotNumber = -1
        isLoaded = 0
      
        def __init__(self):
            ui.ScriptWindow.__init__(self)
            self.inventoryPageIndex = 0
            self.__LoadWindow()
          
        def __del__(self):
            ui.ScriptWindow.__del__(self)


        def Show(self):
            self.__LoadWindow()
            ui.ScriptWindow.Show(self) 
          
        def BindInterfaceClass(self, interface):
            self.interface = interface

        def __LoadWindow(self):
            if self.isLoaded == 1:
                return

            self.isLoaded = 1
          
            try:
                pyScrLoader = ui.PythonScriptLoader()
                pyScrLoader.LoadScriptFile(self, "UIScript/ExtendedInventoryWindow.py")
            except:
                import exception
                exception.Abort("ExtendedInventoryWindow.LoadWindow.LoadObject")

            try:
                wndItem = self.GetChild("ItemSlot")
                self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))
                self.titleName = self.GetChild("TitleName")
                self.SkillBookButton = self.GetChild("SkillBookButton")
                self.UpgradeItemsButton = self.GetChild("UpgradeItemsButton")
                self.stoneButton = self.GetChild("StoneButton")
                self.boxButton = self.GetChild("BoxButton")
                self.efsunButton = self.GetChild("EfsunButton")
                self.cicekButton = self.GetChild("CicekButton")
                if app.ENABLE_ITEM_DELETE_SYSTEM:
                    self.ItemDelete = self.GetChild2("ItemDelete")
                self.inventoryTab = []
                self.inventoryTab.append(self.GetChild("Inventory_Tab_01"))
                self.inventoryTab.append(self.GetChild("Inventory_Tab_02"))
                self.inventoryTab.append(self.GetChild("Inventory_Tab_03"))
                self.MalzemeDeposuInfo = self.GetChild("MalzemeDeposuInfo")
            except:
                import exception
                exception.Abort("ExtendedInventoryWindow.LoadWindow.BindObject")

            ## Info
            self.tlInfo = uiToolTip.ItemToolTip()
            self.tlInfo.Hide()
            self.tooltipInfo = [self.tlInfo]*7
            self.InformationText = [localeInfo.MALZEME_DEPOSU,
                                    localeInfo.BK_ENVANTER_TEXT1,
                                    localeInfo.BK_ENVANTER_TEXT2,
                                    localeInfo.BK_ENVANTER_TEXT3,
                                    localeInfo.BK_ENVANTER_TEXT4,
                                    localeInfo.BK_ENVANTER_TEXT5,
                                    localeInfo.BK_ENVANTER_TEXT6
            ]
          
            for i in xrange(7):
                self.tooltipInfo[i].SetFollow(True)
                self.tooltipInfo[i].AlignHorizonalCenter()
                if i == 0:
                    TITLE_COLOR = grp.GenerateColor(0.9490, 0.9058, 0.7568, 1.0)
                    self.tooltipInfo[i].AutoAppendTextLine(self.InformationText[i], TITLE_COLOR)
                else:
                    self.tooltipInfo[i].AutoAppendTextLine(self.InformationText[i])
                self.tooltipInfo[i].Hide()
                self.tooltipInfo[i].toolTipWidth += 10

            ## Item
            wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
            wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
            wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
            wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
            wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
            wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))

            self.envanterileacilsin = ui.CheckBox()
            self.envanterileacilsin.SetParent(self)
            self.envanterileacilsin.SetPosition(17, 385)
            self.envanterileacilsin.SetEvent(ui.__mem_func__(self.__OnClickEnableEnvanterOn), "ON_CHECK", True)
            self.envanterileacilsin.SetEvent(ui.__mem_func__(self.__OnClickDisableEnvanterOf), "ON_UNCKECK", False)
            self.envanterileacilsin.SetTextInfo(localeInfo.ENVANTER_ILE_AC)
            self.envanterileacilsin.SetCheckStatus(constInfo.EnvanterAcilsinmi)
            self.envanterileacilsin.Show()

            self.SkillBookButton.SetEvent(lambda arg=0: self.SetInventoryType(arg))
            self.UpgradeItemsButton.SetEvent(lambda arg=1: self.SetInventoryType(arg))
            self.stoneButton.SetEvent(lambda arg=2: self.SetInventoryType(arg))
            self.boxButton.SetEvent(lambda arg=3: self.SetInventoryType(arg))
            self.efsunButton.SetEvent(lambda arg=4: self.SetInventoryType(arg))
            self.cicekButton.SetEvent(lambda arg=5: self.SetInventoryType(arg))
            self.SkillBookButton.Down()

            self.inventoryTab[0].SetEvent(lambda arg=0: self.SetInventoryPage(arg))
            self.inventoryTab[1].SetEvent(lambda arg=1: self.SetInventoryPage(arg))
            self.inventoryTab[2].SetEvent(lambda arg=2: self.SetInventoryPage(arg))
            self.inventoryTab[0].Down()
          
            ## PickMoneyDialog
            dlgPickMoney = uiPickMoney.PickMoneyDialog()
            dlgPickMoney.LoadDialog()
            dlgPickMoney.Hide()

            if app.ENABLE_ITEM_DELETE_SYSTEM:
                if self.ItemDelete:
                    self.ItemDelete.SetEvent(ui.__mem_func__(self.TopluSat))

            ## PickItemDialog
            dlgPickItem = uiPickEtc.PickEtcDialog()
            dlgPickItem.LoadDialog()
            dlgPickItem.Hide()
          
            self.dlgPickMoney = dlgPickMoney
          
            self.wndItem = wndItem
            self.SetInventoryType(0)
            self.SetInventoryPage(0)

            self.dlgPickItem = dlgPickItem

            self.wndCostume = None
          
        def Destroy(self):
            self.ClearDictionary()
            self.dlgPickMoney.Destroy()
            self.dlgPickItem.Destroy()
            self.dlgPickItem = 0
            self.dlgPickMoney = 0
            self.tooltipItem = None
            self.wndItem = 0
            self.interface = None
            self.inventoryTab = []
            self.envanterileacilsin = []

        def __OnClickEnableEnvanterOn(self):
            constInfo.EnvanterAcilsinmi = 1
            chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Envanter ile acılma aktif.")

        def __OnClickDisableEnvanterOf(self):
            constInfo.EnvanterAcilsinmi = 0
            chat.AppendChat(chat.CHAT_TYPE_INFO, "<Sistem> Envanter ile acılma pasif.")

        def Hide(self):
            if None != self.tooltipItem:
                self.tooltipItem.HideToolTip()
                self.tlInfo.Hide()
            if self.dlgPickItem:
                self.dlgPickItem.Close()
            wndMgr.Hide(self.hWnd)
          
        def Close(self):
            if self.tooltipItem:
                self.tooltipItem.HideToolTip()
            self.tlInfo.Hide()
            self.Hide()

        if app.ENABLE_ITEM_DELETE_SYSTEM:
            def TopluSat(self):
                self.interface.OpenDeleteItem()

        def OnUpdate(self):
            for i in xrange(7):
                if self.MalzemeDeposuInfo.IsIn():
                    self.tooltipInfo[i].Show()
                else:
                    self.tooltipInfo[i].Hide()

        def SetInventoryType(self, type):
            self.inventoryType = type
            if type == 0:
                self.SkillBookButton.Down()
                self.efsunButton.SetUp()
                self.cicekButton.SetUp()
                self.UpgradeItemsButton.SetUp()
                self.stoneButton.SetUp()
                self.boxButton.SetUp()
                self.titleName.SetText(localeInfo.INVENTORY_SKILL_BOOK_TOOLTIP)
            elif type == 2:
                self.stoneButton.Down()
                self.efsunButton.SetUp()
                self.cicekButton.SetUp()
                self.UpgradeItemsButton.SetUp()
                self.SkillBookButton.SetUp()
                self.boxButton.SetUp()
                self.titleName.SetText(localeInfo.INVENTORY_STONE_TOOLTIP)
            elif type == 3:
                self.boxButton.Down()
                self.efsunButton.SetUp()
                self.UpgradeItemsButton.SetUp()
                self.cicekButton.SetUp()
                self.stoneButton.SetUp()
                self.SkillBookButton.SetUp()
                self.titleName.SetText(localeInfo.INVENTORY_BOX_TOOLTIP)
            elif type == 4:
                self.efsunButton.Down()
                self.boxButton.SetUp()
                self.cicekButton.SetUp()
                self.UpgradeItemsButton.SetUp()
                self.stoneButton.SetUp()
                self.SkillBookButton.SetUp()
                self.titleName.SetText(localeInfo.INVENTORY_EFSUN_TOOLTIP)
            elif type == 5:
                self.cicekButton.Down()
                self.efsunButton.SetUp()
                self.boxButton.SetUp()
                self.UpgradeItemsButton.SetUp()
                self.stoneButton.SetUp()
                self.SkillBookButton.SetUp()
                self.titleName.SetText(localeInfo.INVENTORY_CICEK_TOOLTIP)
            else:
                self.UpgradeItemsButton.Down()
                self.SkillBookButton.SetUp()
                self.efsunButton.SetUp()
                self.cicekButton.SetUp()
                self.stoneButton.SetUp()
                self.boxButton.SetUp()
                self.titleName.SetText(localeInfo.INVENTORY_UPGRADE_ITEM_TOOLTIP)
            self.RefreshBagSlotWindow()
          
        def SetInventoryPage(self, page):
            self.inventoryPageIndex = page
            for i in range(0,len(self.inventoryTab)):
                self.inventoryTab[i].SetUp()
            self.inventoryTab[page].Down()
            self.RefreshBagSlotWindow()

        def OnPickItem(self, count):
            itemSlotIndex = self.dlgPickItem.itemGlobalSlotIndex
            selectedItemVNum = player.GetItemIndex(itemSlotIndex)
            mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_SKILL_BOOK_INVENTORY, itemSlotIndex, selectedItemVNum, count)
              
        def __InventoryLocalSlotPosToGlobalSlotPos(self, local):
            if self.inventoryType == 0:
                return self.inventoryPageIndex*player.SKILL_BOOK_INVENTORY_SLOT_COUNT + local + item.SKILL_BOOK_INVENTORY_SLOT_START
            elif self.inventoryType == 2:
                return self.inventoryPageIndex*player.STONE_INVENTORY_SLOT_COUNT + local + item.STONE_INVENTORY_SLOT_START
            elif self.inventoryType == 3:
                return self.inventoryPageIndex*player.BOX_INVENTORY_SLOT_COUNT + local + item.BOX_INVENTORY_SLOT_START
            elif self.inventoryType == 4:
                return self.inventoryPageIndex*player.EFSUN_INVENTORY_SLOT_COUNT + local + item.EFSUN_INVENTORY_SLOT_START
            elif self.inventoryType == 5:
                return self.inventoryPageIndex*player.CICEK_INVENTORY_SLOT_COUNT + local + item.CICEK_INVENTORY_SLOT_START
            else:
                return self.inventoryPageIndex*player.UPGRADE_ITEMS_INVENTORY_SLOT_COUNT + local + item.UPGRADE_ITEMS_INVENTORY_SLOT_START
              
        def GetInventoryPageIndex(self):
            return self.inventoryPageIndex
          
        def RefreshBagSlotWindow(self):
            getItemVNum=player.GetItemIndex
            getItemCount=player.GetItemCount
            setItemVNum=self.wndItem.SetItemSlot
          
            if self.inventoryType == 0:
                for i in xrange(player.SKILL_BOOK_INVENTORY_SLOT_COUNT):
                    slotNumber = item.SKILL_BOOK_INVENTORY_SLOT_START + i
                    if self.GetInventoryPageIndex() == 1:
                        slotNumber += 45
                    elif self.GetInventoryPageIndex() == 2:
                        slotNumber += 90
                    itemCount = getItemCount(slotNumber)
                    if 0 == itemCount:
                        self.wndItem.ClearSlot(i)
                        continue
                    elif 1 == itemCount:
                        itemCount = 0 
                    itemVnum = getItemVNum(slotNumber)
                    setItemVNum(i, itemVnum, itemCount)
            elif self.inventoryType == 2:
                for i in xrange(player.STONE_INVENTORY_SLOT_COUNT):
                    slotNumber = item.STONE_INVENTORY_SLOT_START + i
                    if self.GetInventoryPageIndex() == 1:
                        slotNumber += 45
                    elif self.GetInventoryPageIndex() == 2:
                        slotNumber += 90
                    itemCount = getItemCount(slotNumber)
                    if 0 == itemCount:
                        self.wndItem.ClearSlot(i)
                        continue
                    elif 1 == itemCount:
                        itemCount = 0 
                    itemVnum = getItemVNum(slotNumber)
                    setItemVNum(i, itemVnum, itemCount) 
            elif self.inventoryType == 3:
                for i in xrange(player.BOX_INVENTORY_SLOT_COUNT):
                    slotNumber = item.BOX_INVENTORY_SLOT_START + i
                    if self.GetInventoryPageIndex() == 1:
                        slotNumber += 45
                    elif self.GetInventoryPageIndex() == 2:
                        slotNumber += 90
                    itemCount = getItemCount(slotNumber)
                    if 0 == itemCount:
                        self.wndItem.ClearSlot(i)
                        continue
                    elif 1 == itemCount:
                        itemCount = 0
                    itemVnum = getItemVNum(slotNumber)
                    setItemVNum(i, itemVnum, itemCount) 
            elif self.inventoryType == 4:
                for i in xrange(player.EFSUN_INVENTORY_SLOT_COUNT):
                    slotNumber = item.EFSUN_INVENTORY_SLOT_START + i
                    if self.GetInventoryPageIndex() == 1:
                        slotNumber += 45
                    elif self.GetInventoryPageIndex() == 2:
                        slotNumber += 90
                    itemCount = getItemCount(slotNumber)
                    if 0 == itemCount:
                        self.wndItem.ClearSlot(i)
                        continue
                    elif 1 == itemCount:
                        itemCount = 0
                    itemVnum = getItemVNum(slotNumber)
                    setItemVNum(i, itemVnum, itemCount) 
            elif self.inventoryType == 5:
                for i in xrange(player.CICEK_INVENTORY_SLOT_COUNT):
                    slotNumber = item.CICEK_INVENTORY_SLOT_START + i
                    if self.GetInventoryPageIndex() == 1:
                        slotNumber += 45
                    elif self.GetInventoryPageIndex() == 2:
                        slotNumber += 90
                    itemCount = getItemCount(slotNumber)
                    if 0 == itemCount:
                        self.wndItem.ClearSlot(i)
                        continue
                    elif 1 == itemCount:
                        itemCount = 0
                    itemVnum = getItemVNum(slotNumber)
                    setItemVNum(i, itemVnum, itemCount) 
            else:
                for i in xrange(player.UPGRADE_ITEMS_INVENTORY_SLOT_COUNT):
                    slotNumber = item.UPGRADE_ITEMS_INVENTORY_SLOT_START + i
                    if self.GetInventoryPageIndex() == 1:
                        slotNumber += 45
                    elif self.GetInventoryPageIndex() == 2:
                        slotNumber += 90
                    itemCount = getItemCount(slotNumber)
                    if 0 == itemCount:
                        self.wndItem.ClearSlot(i)
                        continue
                    elif 1 == itemCount:
                        itemCount = 0
                    itemVnum = getItemVNum(slotNumber)
                    setItemVNum(i, itemVnum, itemCount)
            self.wndItem.RefreshSlot()

        def RefreshItemSlot(self):
            self.RefreshBagSlotWindow()

        def RefreshStatus(self):
            pass

        def SetItemToolTip(self, tooltipItem):
            self.tooltipItem = tooltipItem
          
        def SelectEmptySlot(self, selectedSlotPos):
            if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
                return
          
            if self.inventoryType == 0:
                selectedSlotPos += item.SKILL_BOOK_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    selectedSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    selectedSlotPos += 90
            elif self.inventoryType == 2:
                selectedSlotPos += item.STONE_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    selectedSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    selectedSlotPos += 90
            elif self.inventoryType == 3:
                selectedSlotPos += item.BOX_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    selectedSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    selectedSlotPos += 90
            elif self.inventoryType == 4:
                selectedSlotPos += item.EFSUN_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    selectedSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    selectedSlotPos += 90
            elif self.inventoryType == 5:
                selectedSlotPos += item.CICEK_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    selectedSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    selectedSlotPos += 90
            else:
                selectedSlotPos += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    selectedSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    selectedSlotPos += 90
          
            if mouseModule.mouseController.isAttached():

                attachedSlotType = mouseModule.mouseController.GetAttachedType()
                attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
                attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
                attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex()

                if player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType or\
                    player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType or\
                    player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType or\
                    player.SLOT_TYPE_BOX_INVENTORY == attachedSlotType or\
                    player.SLOT_TYPE_EFSUN_INVENTORY == attachedSlotType or\
                    player.SLOT_TYPE_CICEK_INVENTORY == attachedSlotType:
                    itemCount = player.GetItemCount(attachedSlotPos)
                    attachedCount = mouseModule.mouseController.GetAttachedItemCount()
                    self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount)

                    if item.IsRefineScroll(attachedItemIndex):
                        self.wndItem.SetUseMode(False)

                elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType:
                    mouseModule.mouseController.RunCallBack("INVENTORY")

                elif player.SLOT_TYPE_SHOP == attachedSlotType:
                    net.SendShopBuyPacket(attachedSlotPos)

                elif player.SLOT_TYPE_SAFEBOX == attachedSlotType:

                    if player.ITEM_MONEY == attachedItemIndex:
                        net.SendSafeboxWithdrawMoneyPacket(mouseModule.mouseController.GetAttachedItemCount())
                        snd.PlaySound("sound/ui/money.wav")

                    else:
                        net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos)

                elif player.SLOT_TYPE_MALL == attachedSlotType:
                    net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos)

                mouseModule.mouseController.DeattachObject()
              
        def SelectItemSlot(self, itemSlotIndex):
            if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
                return
              
            if self.inventoryType == 0:
                itemSlotIndex += item.SKILL_BOOK_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    itemSlotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    itemSlotIndex += 90
            elif self.inventoryType == 2:
                itemSlotIndex += item.STONE_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    itemSlotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    itemSlotIndex += 90
            elif self.inventoryType == 3:
                itemSlotIndex += item.BOX_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    itemSlotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    itemSlotIndex += 90
            elif self.inventoryType == 4:
                itemSlotIndex += item.EFSUN_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    itemSlotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    itemSlotIndex += 90
            elif self.inventoryType == 5:
                itemSlotIndex += item.CICEK_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    itemSlotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    itemSlotIndex += 90
            else:
                itemSlotIndex += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    itemSlotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    itemSlotIndex += 90

            if mouseModule.mouseController.isAttached():
                attachedSlotType = mouseModule.mouseController.GetAttachedType()
                attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
                attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex()
                attachedItemCount = mouseModule.mouseController.GetAttachedItemCount()
              
                if player.GetItemCount(itemSlotIndex) > attachedItemCount:
                    return
          
                if player.SLOT_TYPE_SKILL_BOOK_INVENTORY == attachedSlotType or\
                    player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY == attachedSlotType or\
                    player.SLOT_TYPE_STONE_INVENTORY == attachedSlotType or\
                    player.SLOT_TYPE_BOX_INVENTORY == attachedSlotType or\
                    player.SLOT_TYPE_EFSUN_INVENTORY == attachedSlotType or\
                    player.SLOT_TYPE_CICEK_INVENTORY == attachedSlotType:
                    self.__SendMoveItemPacket(attachedSlotPos, itemSlotIndex, attachedItemCount)
      
                mouseModule.mouseController.DeattachObject()
            else:

                curCursorNum = app.GetCursor()
                #if app.SELL == curCursorNum:
                    #self.__SellItem(itemSlotIndex)
                  
                if app.BUY == curCursorNum:
                    chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO)

                elif app.IsPressed(app.DIK_LALT):
                    link = player.GetItemLink(itemSlotIndex)
                    ime.PasteString(link)

                elif app.IsPressed(app.DIK_LALT):
                    link = player.GetItemLink(itemSlotIndex)
                    ime.PasteString(link)

                elif app.IsPressed(app.DIK_LSHIFT):
                    itemCount = player.GetItemCount(itemSlotIndex)
              
                    if itemCount > 1:
                        self.dlgPickItem.SetTitleName(localeInfo.PICK_ITEM_TITLE)
                        self.dlgPickItem.SetAcceptEvent(ui.__mem_func__(self.OnPickItem))
                        self.dlgPickItem.Open(itemCount)
                        self.dlgPickItem.itemGlobalSlotIndex = itemSlotIndex

                elif app.IsPressed(app.DIK_LCONTROL):
                    itemIndex = player.GetItemIndex(itemSlotIndex)

                    if TRUE == item.CanAddToQuickSlotItem(itemIndex):
                        player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex)
                    else:
                        chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.QUICKSLOT_REGISTER_DISABLE_ITEM)
                else:
                    selectedItemVNum = player.GetItemIndex(itemSlotIndex)
                    itemCount = player.GetItemCount(itemSlotIndex)
                    if self.inventoryType == 0:
                        mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_SKILL_BOOK_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
                    elif self.inventoryType == 2:
                        mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_STONE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
                    elif self.inventoryType == 3:
                        mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_BOX_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
                    elif self.inventoryType == 4:
                        mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_EFSUN_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
                    elif self.inventoryType == 5:
                        mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_CICEK_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
                    else:
                        mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_UPGRADE_ITEMS_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount)
                    self.wndItem.SetUseMode(True)

                    snd.PlaySound("sound/ui/pick.wav")

        def OnCloseQuestionDialog(self):
            if not self.questionDialog:
                return
          
            self.questionDialog.Close()
            self.questionDialog = None
            constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)

        def Sat(self):
            if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber):
                if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber):
                    net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.INVENTORY)
                    snd.PlaySound("sound/ui/money.wav")
            self.OnCloseQuestionDialog()
          
        def __OnClosePopupDialog(self):
            self.pop = None
          
        def OverOutItem(self):
            self.wndItem.SetUsableItem(False)
            if None != self.tooltipItem:
                self.tooltipItem.HideToolTip()

        def OverInItem(self, overSlotPos):
            if self.inventoryType == 0:
                overSlotPos += item.SKILL_BOOK_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    overSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    overSlotPos += 90
            elif self.inventoryType == 2:
                overSlotPos += item.STONE_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    overSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    overSlotPos += 90
            elif self.inventoryType == 3:
                overSlotPos += item.BOX_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    overSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    overSlotPos += 90
            elif self.inventoryType == 4:
                overSlotPos += item.EFSUN_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    overSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    overSlotPos += 90
            elif self.inventoryType == 5:
                overSlotPos += item.CICEK_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    overSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    overSlotPos += 90
            else:
                overSlotPos += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    overSlotPos += 45
                elif self.GetInventoryPageIndex() == 2:
                    overSlotPos += 90
            self.wndItem.SetUsableItem(False)
            self.ShowToolTip(overSlotPos)
          
        def ShowToolTip(self, slotIndex):
            if None != self.tooltipItem:
                self.tooltipItem.SetInventoryItem(slotIndex)
              
        def OnPressEscapeKey(self):
            self.Close()
            return True 
          
        def UseItemSlot(self, slotIndex):
            if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
                return
              
            if self.inventoryType == 0:
                slotIndex += item.SKILL_BOOK_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    slotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    slotIndex += 90
            elif self.inventoryType == 2:
                slotIndex += item.STONE_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    slotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    slotIndex += 90
            elif self.inventoryType == 3:
                slotIndex += item.BOX_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    slotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    slotIndex += 90
            elif self.inventoryType == 4:
                slotIndex += item.EFSUN_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    slotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    slotIndex += 90
            elif self.inventoryType == 5:
                slotIndex += item.CICEK_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    slotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    slotIndex += 90
            else:
                slotIndex += item.UPGRADE_ITEMS_INVENTORY_SLOT_START
                if self.GetInventoryPageIndex() == 1:
                    slotIndex += 45
                elif self.GetInventoryPageIndex() == 2:
                    slotIndex += 90
            if app.ENABLE_ITEM_DELETE_SYSTEM:
                if self.isShowDeleteItemDlg():
                    self.wndItemDelete.AddItemWithoutMouse(player.INVENTORY, slotIndex)
                    return
            self.__UseItem(slotIndex)
            mouseModule.mouseController.DeattachObject()
            self.OverOutItem()

        def __UseItem(self, slotIndex):
            ItemVNum = player.GetItemIndex(slotIndex)
            item.SelectItem(ItemVNum)

            if item.IsFlag(item.ITEM_FLAG_CONFIRM_WHEN_USE):
                self.questionDialog = uiCommon.QuestionDialog()
                self.questionDialog.SetText(localeInfo.INVENTORY_REALLY_USE_ITEM)
                self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnAccept))
                self.questionDialog.SetCancelEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnCancel))
                self.questionDialog.Open()
                self.questionDialog.slotIndex = slotIndex
          
                constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)

            elif app.IsPressed(app.DIK_LSHIFT):
                if player.GetItemTypeBySlot(slotIndex) == item.ITEM_TYPE_GIFTBOX and\
                    ItemVNum != 31374 and ItemVNum != 50255 and\
                    ItemVNum != 50187 and ItemVNum != 50197 and\
                    ItemVNum != 50188 and ItemVNum != 50189 and\
                    ItemVNum != 50190 and ItemVNum != 50191 and\
                    ItemVNum != 50192 and ItemVNum != 50193 and\
                    ItemVNum != 50194 and ItemVNum != 50195:
                    if app.ENABLE_SHOW_CHEST_DROP:
                        if self.interface:
                            if self.interface.dlgChestDrop:
                                if not self.interface.dlgChestDrop.IsShow():
                                    self.interface.dlgChestDrop.Open(slotIndex)
                                    net.SendChestDropInfo(slotIndex)
            else:
                self.__SendUseItemPacket(slotIndex)
              
        def __UseItemQuestionDialog_OnCancel(self):
            self.OnCloseQuestionDialog()

        def __UseItemQuestionDialog_OnAccept(self):
            self.__SendUseItemPacket(self.questionDialog.slotIndex)
            self.OnCloseQuestionDialog() 
          
        def __SendUseItemPacket(self, slotPos):
            if uiPrivateShopBuilder.IsBuildingPrivateShop():
                chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.USE_ITEM_FAILURE_PRIVATE_SHOP)
                return

            net.SendItemUsePacket(slotPos)

        def __SendMoveItemPacket(self, srcSlotPos, dstSlotPos, srcItemCount):
            if uiPrivateShopBuilder.IsBuildingPrivateShop():
                chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.MOVE_ITEM_FAILURE_PRIVATE_SHOP)
                return

            net.SendItemMovePacket(srcSlotPos, dstSlotPos, srcItemCount)

        if app.ENABLE_ITEM_DELETE_SYSTEM:
            def SetDeleteItemDlg(self, wndItemDelete):
                self.wndItemDelete = wndItemDelete

            def isShowDeleteItemDlg(self):
                if self.wndItemDelete:
                    if self.wndItemDelete.IsShow():
                        return 1
                return 0

21068 eklentisini görüntüle
 
En son bir moderatör tarafından düzenlenmiş:
Geri
Üst