Yardım Grid

Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

sametgkdn

Aktif Üye
Mesaj
55
Beğeni
8
Puan
414
Grid:
0721 14:39:24169 :: Traceback (most recent call last):

0721 14:39:24169 ::   File "game.py", line 1245, in OnKeyDown

0721 14:39:24169 ::   File "game.py", line 341, in <lambda>

0721 14:39:24169 ::   File "interfaceModule.py", line 1700, in OpenDeleteItem

0721 14:39:24169 ::   File "uiDeleteItem.py", line 91, in Open

0721 14:39:24170 :: NameError
0721 14:39:24170 :: :
0721 14:39:24170 :: global name 'Grid' is not defined
0721 14:39:24170 ::

Grid dosyasını root'a attığım halde gridi bulamıyor importlara da eklediğim orda da görmedi. Yardım edebilecek var mı?
 

sametgkdn

Aktif Üye
Mesaj
55
Beğeni
8
Puan
414
Nasıl çözdüğünü yoruma dahil eder misin?
Syserr:
0721 15:15:45548 :: Traceback (most recent call last):

0721 15:15:45548 ::   File "ui.py", line 1358, in CallEvent

0721 15:15:45548 ::   File "uiDeleteItem.py", line 259, in <lambda>

0721 15:15:45548 ::   File "uiDeleteItem.py", line 301, in RequestSellItem

0721 15:15:45549 ::   File "uiDeleteItem.py", line 278, in Sat

0721 15:15:45549 :: AttributeError
0721 15:15:45549 :: :
0721 15:15:45549 :: 'module' object has no attribute 'SendItemSellPacket'
0721 15:15:45549 ::

Bu seferde bu hata var bunu çözmeye calısıyorum suanda :)
 

Trashy

MEKA Designed
Mesaj
1.429
Beğeni
1.071
Puan
1.339
Syserr:
0721 15:15:45548 :: Traceback (most recent call last):

0721 15:15:45548 ::   File "ui.py", line 1358, in CallEvent

0721 15:15:45548 ::   File "uiDeleteItem.py", line 259, in <lambda>

0721 15:15:45548 ::   File "uiDeleteItem.py", line 301, in RequestSellItem

0721 15:15:45549 ::   File "uiDeleteItem.py", line 278, in Sat

0721 15:15:45549 :: AttributeError
0721 15:15:45549 :: :
0721 15:15:45549 :: 'module' object has no attribute 'SendItemSellPacket'
0721 15:15:45549 ::

Bu seferde bu hata var bunu çözmeye calısıyorum suanda :)
İtem silme sistemiyle ilgili bir sistem ekliyorsun sanırım şu aşağıda bulunan kodlar arasından SendItemSellPacket kısımlarını alabilirsin.

C++:
Client Source -> Locale_inc.h Ekle

#define WJ_NEW_DROP_DIALOG

Client Source -> Packet.h Arat : HEADER_CG_ITEM_DROP2 altına ekle

#ifdef WJ_NEW_DROP_DIALOG
    HEADER_CG_ITEM_DESTROY                        = 21,
    HEADER_CG_ITEM_SELL                            = 22,
#endif

Tekrar Arat : typedef struct command_item_drop2

Satır sonuna ekle


#ifdef WJ_NEW_DROP_DIALOG
typedef struct command_item_destroy
{
    BYTE        header;
    TItemPos    pos;
} TPacketCGItemDestroy;

typedef struct command_item_sell
{
    BYTE        header;
    TItemPos    pos;
} TPacketCGItemSell;
#endif

Client Source -> PythonApplicationModule.cpp Arat ;

#ifdef ENABLE_COSTUME_SYSTEM
PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    1);
#else
PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    0);
#endif

Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
PyModule_AddIntConstant(poModule, "WJ_NEW_DROP_DIALOG", 1);
#else
PyModule_AddIntConstant(poModule, "WJ_NEW_DROP_DIALOG", 0);
#endif

Client Source -> PythonNetworkStream.h Arat;

bool SendItemDropPacket(TItemPos pos, DWORD elk); Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
        bool SendItemDestroyPacket(TItemPos pos);
        bool SendItemSellPacket(TItemPos pos);
#endif

Client Source -> PythonNetworkStreamModule.cpp Arat ;

PyObject* netSendItemDropPacket(PyObject* poSelf, PyObject* poArgs) Satır sonuna ekle

#ifdef WJ_NEW_DROP_DIALOG
PyObject* netSendItemDestroyPacket(PyObject* poSelf, PyObject* poArgs)
{
    TItemPos Cell;

    if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell))
        return Py_BuildException();
    
    CPythonNetworkStream& rkNetStream = CPythonNetworkStream::Instance();
    rkNetStream.SendItemDestroyPacket(Cell);
    
    return Py_BuildNone();
}

PyObject* netSendItemSellPacket(PyObject* poSelf, PyObject* poArgs)
{
    TItemPos Cell;

    if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell))
        return Py_BuildException();
    
    CPythonNetworkStream& rkNetStream = CPythonNetworkStream::Instance();
    rkNetStream.SendItemSellPacket(Cell);
    
    return Py_BuildNone();
}
#endif

Tekrar Arat ; { "SendItemDropPacketNew",                netSendItemDropPacketNew,                METH_VARARGS }, altına ekle

#ifdef WJ_NEW_DROP_DIALOG
        { "SendItemDestroyPacket",                netSendItemDestroyPacket,                METH_VARARGS },
        { "SendItemSellPacket",                    netSendItemSellPacket,                    METH_VARARGS },
#endif

Client Source -> PythonNetworkStreamPhaseGameItem.cpp Arat;
bool CPythonNetworkStream::SendItemDropPacketNew(TItemPos pos, DWORD elk, DWORD count) satır sonuna ekle

#ifdef WJ_NEW_DROP_DIALOG
bool CPythonNetworkStream::SendItemDestroyPacket(TItemPos pos)
{
    if (!__CanActMainInstance())
        return true;
    
    TPacketCGItemDestroy itemDestroyPacket;
    itemDestroyPacket.header = HEADER_CG_ITEM_DESTROY;
    itemDestroyPacket.pos = pos;
    
    if (!Send(sizeof(itemDestroyPacket), &itemDestroyPacket))
    {
        Tracen("SendItemDestroyPacket Error");
        return false;
    }
    
    return SendSequence();
}

bool CPythonNetworkStream::SendItemSellPacket(TItemPos pos)
{
    if (!__CanActMainInstance())
        return true;
    
    TPacketCGItemSell itemSellPacket;
    itemSellPacket.header = HEADER_CG_ITEM_SELL;
    itemSellPacket.pos = pos;
    
    if (!Send(sizeof(itemSellPacket), &itemSellPacket))
    {
        Tracen("SendItemSellPacket Error");
        return false;
    }
    
    return SendSequence();
}
#endif
-------------------------------------------------------

Server Source -> common/service.h Ekle;

#define WJ_NEW_DROP_DIALOG

Server Source -> game/char.h Arat : DropItem(TItemPos Cell,  BYTE bCount=0); Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
        bool            DestroyItem(TItemPos Cell);
        bool            SellItem(TItemPos Cell, BYTE bCount=0);
#endif

Server Source -> game/char_item.cpp Arat : bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount) Satır sonuna ekle

#ifdef WJ_NEW_DROP_DIALOG
bool CHARACTER::DestroyItem(TItemPos Cell)
{
    LPITEM item = NULL;
    
    if (!CanHandleItem())
    {
        if (NULL != DragonSoul_RefineWindow_GetOpener())
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("강화창을 연 상태에서는 아이템을 옮길 수 없습니다."));
        return false;
    }
    
    if (IsDead())
        return false;
    
    if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell)))
        return false;
    
    if (item->IsExchanging())
        return false;
    
    if (true == item->isLocked())
        return false;
    
#ifdef WJ_SOULBINDING_SYSTEM
    if (item->IsBind() || item->IsUntilBind())
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("BIND_ITEM_NOT_DELETE"));
        return false;
    }
#endif

    if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true)
        return false;
    
    if (item->GetCount() <= 0)
        return false;
    
#ifdef WJ_GROWTH_PET_SYSTEM
    if (item->GetVnum() == 55701 || item->GetVnum() == 55702 || item->GetVnum() == 55703 || item->GetVnum() == 55704)
        if (GetNewPetSystem()->IsActivePet())
            return false;
#endif

    SyncQuickslot(QUICKSLOT_TYPE_ITEM, Cell.cell, 1000);
    ITEM_MANAGER::instance().RemoveItem(item);
    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ITEM_DESTROY_SUCCES"), item->GetName());
    
    return true;
}

bool CHARACTER::SellItem(TItemPos Cell, BYTE bCount)
{
    LPITEM item = NULL;
    
    if (!CanHandleItem())
    {
        if (NULL != DragonSoul_RefineWindow_GetOpener())
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("강화창을 연 상태에서는 아이템을 옮길 수 없습니다."));
        return false;
    }
    
    if (IsDead())
        return false;
    
    if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell)))
        return false;
    
    if (item->IsExchanging())
        return false;
    
    if (true == item->isLocked())
        return false;
    
#ifdef WJ_SOULBINDING_SYSTEM
    if (item->IsBind() || item->IsUntilBind())
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("BIND_ITEM_NOT_SELL"));
        return false;
    }
#endif

    if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL))
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("THIS_ITEM_NOT_SELL"));
        return false;
    }
    
    if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true)
        return false;
    
    if (item->GetCount() <= 0)
        return false;
    
#ifdef WJ_GROWTH_PET_SYSTEM
    if (item->GetVnum() == 55701 || item->GetVnum() == 55702 || item->GetVnum() == 55703 || item->GetVnum() == 55704)
        if (GetNewPetSystem()->IsActivePet())
            return false;
#endif

    DWORD dwPrice;
    
    if (bCount == 0 || bCount > item->GetCount())
        bCount = item->GetCount();
    
    dwPrice = item->GetShopBuyPrice();
    
    if (IS_SET(item->GetFlag(), ITEM_FLAG_COUNT_PER_1GOLD))
    {
        if (dwPrice == 0)
            dwPrice = bCount;
        else
            dwPrice = bCount / dwPrice;
    }
    else
        dwPrice *= bCount;
    
    dwPrice /= 5;
    
    DWORD dwTax = 0;
#ifdef ENABLE_NEWSTUFF
    if (g_iTaxes != 0)
        dwTax = dwPrice * g_iTaxes/100;
#endif

    dwPrice -= dwTax;

    const int64_t nTotalMoney = static_cast<int64_t>(GetGold()) + static_cast<int64_t>(dwPrice);
    if (GOLD_MAX <= nTotalMoney)
    {
        sys_err("[OVERFLOW_GOLD] id %u name %s gold %u", GetPlayerID(), GetName(), GetGold());
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("20억냥이 초과하여 물품을 팔수 없습니다."));
        return false;
    }
    
    sys_log(0, "SHOP: SELL: %s item name: %s(x%d):%u price: %u", GetName(), item->GetName(), bCount, item->GetID(), dwPrice);
    
#ifdef ENABLE_NEWSTUFF
    if (g_iTaxes > 0)
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("판매금액의 %d %% 가 세금으로 나가게됩니다"), g_iTaxes);
#endif
    
    DBManager::instance().SendMoneyLog(MONEY_LOG_SHOP, item->GetVnum(), dwPrice);
    item->SetCount(item->GetCount() - bCount);
    PointChange(POINT_GOLD, dwPrice, false);
    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ITEM_SELL_SUCCES"), item->GetName());
    
    return true;
}
#endif

Server Source -> game/input.h Arat : ItemDrop2(LPCHARACTER ch, const char * data); Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
        void        ItemDestroy(LPCHARACTER ch, const char * data);
        void        ItemSell(LPCHARACTER ch, const char * data);
#endif

Server Source -> game/input_main.cpp Arat : void CInputMain::ItemDrop2(LPCHARACTER ch, const char * data) Satır sonuna ekle

#ifdef WJ_NEW_DROP_DIALOG
void CInputMain::ItemDestroy(LPCHARACTER ch, const char * data)
{
    struct command_item_destroy * pinfo = (struct command_item_destroy *) data;
    if (ch)
        ch->DestroyItem(pinfo->Cell);
}

void CInputMain::ItemSell(LPCHARACTER ch, const char * data)
{
    struct command_item_sell * pinfo = (struct command_item_sell *) data;
    if (ch)
        ch->SellItem(pinfo->Cell);
}
#endif

Yeniden arat

case HEADER_CG_ITEM_DROP2:
            if (!ch->IsObserverMode())
                ItemDrop2(ch, c_pData);
            break;
            
Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
        case HEADER_CG_ITEM_DESTROY:
            if (!ch->IsObserverMode())
                ItemDestroy(ch, c_pData);
            break;
            
        case HEADER_CG_ITEM_SELL:
            if (!ch->IsObserverMode())
                ItemSell(ch, c_pData);
            break;
#endif

Server Source -> game/packet.h Arat : HEADER_CG_ITEM_DROP2 altına ekle

#ifdef WJ_NEW_DROP_DIALOG
    HEADER_CG_ITEM_DESTROY                        = 21,
    HEADER_CG_ITEM_SELL                            = 22,
#endif

Tekrar arat: typedef struct command_item_drop2 satır sonuna ekle

#ifdef WJ_NEW_DROP_DIALOG
typedef struct command_item_destroy
{
    BYTE        header;
    TItemPos    Cell;
} TPacketCGItemDestroy;

typedef struct command_item_sell
{
    BYTE        header;
    TItemPos    Cell;
} TPacketCGItemSell;
#endif

Server Source -> game/packet_info.cpp Arat ;

Set(HEADER_CG_ITEM_DROP2,            sizeof(TPacketCGItemDrop2),            "ItemDrop2",             false);

Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
    Set(HEADER_CG_ITEM_DESTROY,            sizeof(TPacketCGItemDestroy),        "ItemDestroy",             false);
    Set(HEADER_CG_ITEM_SELL,            sizeof(TPacketCGItemSell),            "ItemSell",             false);
#endif
 

sametgkdn

Aktif Üye
Mesaj
55
Beğeni
8
Puan
414
İtem silme sistemiyle ilgili bir sistem ekliyorsun sanırım şu aşağıda bulunan kodlar arasından SendItemSellPacket kısımlarını alabilirsin.

C++:
Client Source -> Locale_inc.h Ekle

#define WJ_NEW_DROP_DIALOG

Client Source -> Packet.h Arat : HEADER_CG_ITEM_DROP2 altına ekle

#ifdef WJ_NEW_DROP_DIALOG
    HEADER_CG_ITEM_DESTROY                        = 21,
    HEADER_CG_ITEM_SELL                            = 22,
#endif

Tekrar Arat : typedef struct command_item_drop2

Satır sonuna ekle


#ifdef WJ_NEW_DROP_DIALOG
typedef struct command_item_destroy
{
    BYTE        header;
    TItemPos    pos;
} TPacketCGItemDestroy;

typedef struct command_item_sell
{
    BYTE        header;
    TItemPos    pos;
} TPacketCGItemSell;
#endif

Client Source -> PythonApplicationModule.cpp Arat ;

#ifdef ENABLE_COSTUME_SYSTEM
PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    1);
#else
PyModule_AddIntConstant(poModule, "ENABLE_COSTUME_SYSTEM",    0);
#endif

Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
PyModule_AddIntConstant(poModule, "WJ_NEW_DROP_DIALOG", 1);
#else
PyModule_AddIntConstant(poModule, "WJ_NEW_DROP_DIALOG", 0);
#endif

Client Source -> PythonNetworkStream.h Arat;

bool SendItemDropPacket(TItemPos pos, DWORD elk); Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
        bool SendItemDestroyPacket(TItemPos pos);
        bool SendItemSellPacket(TItemPos pos);
#endif

Client Source -> PythonNetworkStreamModule.cpp Arat ;

PyObject* netSendItemDropPacket(PyObject* poSelf, PyObject* poArgs) Satır sonuna ekle

#ifdef WJ_NEW_DROP_DIALOG
PyObject* netSendItemDestroyPacket(PyObject* poSelf, PyObject* poArgs)
{
    TItemPos Cell;

    if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell))
        return Py_BuildException();
   
    CPythonNetworkStream& rkNetStream = CPythonNetworkStream::Instance();
    rkNetStream.SendItemDestroyPacket(Cell);
   
    return Py_BuildNone();
}

PyObject* netSendItemSellPacket(PyObject* poSelf, PyObject* poArgs)
{
    TItemPos Cell;

    if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell))
        return Py_BuildException();
   
    CPythonNetworkStream& rkNetStream = CPythonNetworkStream::Instance();
    rkNetStream.SendItemSellPacket(Cell);
   
    return Py_BuildNone();
}
#endif

Tekrar Arat ; { "SendItemDropPacketNew",                netSendItemDropPacketNew,                METH_VARARGS }, altına ekle

#ifdef WJ_NEW_DROP_DIALOG
        { "SendItemDestroyPacket",                netSendItemDestroyPacket,                METH_VARARGS },
        { "SendItemSellPacket",                    netSendItemSellPacket,                    METH_VARARGS },
#endif

Client Source -> PythonNetworkStreamPhaseGameItem.cpp Arat;
bool CPythonNetworkStream::SendItemDropPacketNew(TItemPos pos, DWORD elk, DWORD count) satır sonuna ekle

#ifdef WJ_NEW_DROP_DIALOG
bool CPythonNetworkStream::SendItemDestroyPacket(TItemPos pos)
{
    if (!__CanActMainInstance())
        return true;
   
    TPacketCGItemDestroy itemDestroyPacket;
    itemDestroyPacket.header = HEADER_CG_ITEM_DESTROY;
    itemDestroyPacket.pos = pos;
   
    if (!Send(sizeof(itemDestroyPacket), &itemDestroyPacket))
    {
        Tracen("SendItemDestroyPacket Error");
        return false;
    }
   
    return SendSequence();
}

bool CPythonNetworkStream::SendItemSellPacket(TItemPos pos)
{
    if (!__CanActMainInstance())
        return true;
   
    TPacketCGItemSell itemSellPacket;
    itemSellPacket.header = HEADER_CG_ITEM_SELL;
    itemSellPacket.pos = pos;
   
    if (!Send(sizeof(itemSellPacket), &itemSellPacket))
    {
        Tracen("SendItemSellPacket Error");
        return false;
    }
   
    return SendSequence();
}
#endif
-------------------------------------------------------

Server Source -> common/service.h Ekle;

#define WJ_NEW_DROP_DIALOG

Server Source -> game/char.h Arat : DropItem(TItemPos Cell,  BYTE bCount=0); Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
        bool            DestroyItem(TItemPos Cell);
        bool            SellItem(TItemPos Cell, BYTE bCount=0);
#endif

Server Source -> game/char_item.cpp Arat : bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount) Satır sonuna ekle

#ifdef WJ_NEW_DROP_DIALOG
bool CHARACTER::DestroyItem(TItemPos Cell)
{
    LPITEM item = NULL;
   
    if (!CanHandleItem())
    {
        if (NULL != DragonSoul_RefineWindow_GetOpener())
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("강화창을 연 상태에서는 아이템을 옮길 수 없습니다."));
        return false;
    }
   
    if (IsDead())
        return false;
   
    if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell)))
        return false;
   
    if (item->IsExchanging())
        return false;
   
    if (true == item->isLocked())
        return false;
   
#ifdef WJ_SOULBINDING_SYSTEM
    if (item->IsBind() || item->IsUntilBind())
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("BIND_ITEM_NOT_DELETE"));
        return false;
    }
#endif

    if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true)
        return false;
   
    if (item->GetCount() <= 0)
        return false;
   
#ifdef WJ_GROWTH_PET_SYSTEM
    if (item->GetVnum() == 55701 || item->GetVnum() == 55702 || item->GetVnum() == 55703 || item->GetVnum() == 55704)
        if (GetNewPetSystem()->IsActivePet())
            return false;
#endif

    SyncQuickslot(QUICKSLOT_TYPE_ITEM, Cell.cell, 1000);
    ITEM_MANAGER::instance().RemoveItem(item);
    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ITEM_DESTROY_SUCCES"), item->GetName());
   
    return true;
}

bool CHARACTER::SellItem(TItemPos Cell, BYTE bCount)
{
    LPITEM item = NULL;
   
    if (!CanHandleItem())
    {
        if (NULL != DragonSoul_RefineWindow_GetOpener())
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("강화창을 연 상태에서는 아이템을 옮길 수 없습니다."));
        return false;
    }
   
    if (IsDead())
        return false;
   
    if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell)))
        return false;
   
    if (item->IsExchanging())
        return false;
   
    if (true == item->isLocked())
        return false;
   
#ifdef WJ_SOULBINDING_SYSTEM
    if (item->IsBind() || item->IsUntilBind())
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("BIND_ITEM_NOT_SELL"));
        return false;
    }
#endif

    if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_SELL))
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("THIS_ITEM_NOT_SELL"));
        return false;
    }
   
    if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true)
        return false;
   
    if (item->GetCount() <= 0)
        return false;
   
#ifdef WJ_GROWTH_PET_SYSTEM
    if (item->GetVnum() == 55701 || item->GetVnum() == 55702 || item->GetVnum() == 55703 || item->GetVnum() == 55704)
        if (GetNewPetSystem()->IsActivePet())
            return false;
#endif

    DWORD dwPrice;
   
    if (bCount == 0 || bCount > item->GetCount())
        bCount = item->GetCount();
   
    dwPrice = item->GetShopBuyPrice();
   
    if (IS_SET(item->GetFlag(), ITEM_FLAG_COUNT_PER_1GOLD))
    {
        if (dwPrice == 0)
            dwPrice = bCount;
        else
            dwPrice = bCount / dwPrice;
    }
    else
        dwPrice *= bCount;
   
    dwPrice /= 5;
   
    DWORD dwTax = 0;
#ifdef ENABLE_NEWSTUFF
    if (g_iTaxes != 0)
        dwTax = dwPrice * g_iTaxes/100;
#endif

    dwPrice -= dwTax;

    const int64_t nTotalMoney = static_cast<int64_t>(GetGold()) + static_cast<int64_t>(dwPrice);
    if (GOLD_MAX <= nTotalMoney)
    {
        sys_err("[OVERFLOW_GOLD] id %u name %s gold %u", GetPlayerID(), GetName(), GetGold());
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("20억냥이 초과하여 물품을 팔수 없습니다."));
        return false;
    }
   
    sys_log(0, "SHOP: SELL: %s item name: %s(x%d):%u price: %u", GetName(), item->GetName(), bCount, item->GetID(), dwPrice);
   
#ifdef ENABLE_NEWSTUFF
    if (g_iTaxes > 0)
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("판매금액의 %d %% 가 세금으로 나가게됩니다"), g_iTaxes);
#endif
   
    DBManager::instance().SendMoneyLog(MONEY_LOG_SHOP, item->GetVnum(), dwPrice);
    item->SetCount(item->GetCount() - bCount);
    PointChange(POINT_GOLD, dwPrice, false);
    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ITEM_SELL_SUCCES"), item->GetName());
   
    return true;
}
#endif

Server Source -> game/input.h Arat : ItemDrop2(LPCHARACTER ch, const char * data); Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
        void        ItemDestroy(LPCHARACTER ch, const char * data);
        void        ItemSell(LPCHARACTER ch, const char * data);
#endif

Server Source -> game/input_main.cpp Arat : void CInputMain::ItemDrop2(LPCHARACTER ch, const char * data) Satır sonuna ekle

#ifdef WJ_NEW_DROP_DIALOG
void CInputMain::ItemDestroy(LPCHARACTER ch, const char * data)
{
    struct command_item_destroy * pinfo = (struct command_item_destroy *) data;
    if (ch)
        ch->DestroyItem(pinfo->Cell);
}

void CInputMain::ItemSell(LPCHARACTER ch, const char * data)
{
    struct command_item_sell * pinfo = (struct command_item_sell *) data;
    if (ch)
        ch->SellItem(pinfo->Cell);
}
#endif

Yeniden arat

case HEADER_CG_ITEM_DROP2:
            if (!ch->IsObserverMode())
                ItemDrop2(ch, c_pData);
            break;
           
Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
        case HEADER_CG_ITEM_DESTROY:
            if (!ch->IsObserverMode())
                ItemDestroy(ch, c_pData);
            break;
           
        case HEADER_CG_ITEM_SELL:
            if (!ch->IsObserverMode())
                ItemSell(ch, c_pData);
            break;
#endif

Server Source -> game/packet.h Arat : HEADER_CG_ITEM_DROP2 altına ekle

#ifdef WJ_NEW_DROP_DIALOG
    HEADER_CG_ITEM_DESTROY                        = 21,
    HEADER_CG_ITEM_SELL                            = 22,
#endif

Tekrar arat: typedef struct command_item_drop2 satır sonuna ekle

#ifdef WJ_NEW_DROP_DIALOG
typedef struct command_item_destroy
{
    BYTE        header;
    TItemPos    Cell;
} TPacketCGItemDestroy;

typedef struct command_item_sell
{
    BYTE        header;
    TItemPos    Cell;
} TPacketCGItemSell;
#endif

Server Source -> game/packet_info.cpp Arat ;

Set(HEADER_CG_ITEM_DROP2,            sizeof(TPacketCGItemDrop2),            "ItemDrop2",             false);

Altına ekle

#ifdef WJ_NEW_DROP_DIALOG
    Set(HEADER_CG_ITEM_DESTROY,            sizeof(TPacketCGItemDestroy),        "ItemDestroy",             false);
    Set(HEADER_CG_ITEM_SELL,            sizeof(TPacketCGItemSell),            "ItemSell",             false);
#endif
Kendi files'ma göre uyarladım ama pek faydalı olmadı bu arada sil sat sistemini de ekleyim daha rahat ilerileriz
 

Dosya Eklentileri

  • Toplu-Sil-Sat.7z
    4,1 KB · Gösterim: 0

Üst