//service.h ekle
#define ENABLE_DRAGONSOUL_INVENTORY_BOX_SIZE
//char.h yoksa ekle varsa değiştir
#ifdef ENABLE_DRAGONSOUL_INVENTORY_BOX_SIZE
#ifdef ENABLE_ADDITIONAL_EQUIPMENT_PAGE
int GetEmptyDragonSoulInventoryType(BYTE size, BYTE ds_type);
#else
int GetEmptyDragonSoulInventoryType(BYTE size, BYTE ds_type) const;
#endif
#endif
//char_item.cpp
//arat
int CHARACTER::GetEmptyDragonSoulInventory(LPITEM pItem)
//kod bloğunu değiştir
#ifdef ENABLE_ADDITIONAL_EQUIPMENT_PAGE
int CHARACTER::GetEmptyDragonSoulInventory(LPITEM pItem)
#else
int CHARACTER::GetEmptyDragonSoulInventory(LPITEM pItem) const
#endif
{
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;
#ifdef ENABLE_EXTENDED_DS_INVENTORY
for (int i = 0; i < (DRAGON_SOUL_BOX_SIZE * DRAGON_SOUL_INVENTORY_PAGE_COUNT); ++i)
#else
for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; ++i)
#endif
if (IsEmptyItemGrid(TItemPos(DRAGON_SOUL_INVENTORY, i + wBaseCell), bSize))
return i + wBaseCell;
return -1;
}
//altına ekle
#ifdef ENABLE_DRAGONSOUL_INVENTORY_BOX_SIZE
#ifdef ENABLE_ADDITIONAL_EQUIPMENT_PAGE
int CHARACTER::GetEmptyDragonSoulInventoryType(BYTE type, BYTE ds_type)
#else
int CHARACTER::GetEmptyDragonSoulInventoryType(BYTE type, BYTE ds_type) const
#endif
{
/*if (!DragonSoul_IsQualified())
{
return -1;
}*/
BYTE bSize = 1;
if (type == 0)
{
WORD wBaseCell = ((192 + 32) * 0) + (ds_type * 32);
if (WORD_MAX == wBaseCell)
return -1;
for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; ++i)
if (IsEmptyItemGrid(TItemPos(DRAGON_SOUL_INVENTORY, i + wBaseCell), bSize))
return i + wBaseCell;
}
else if (type == 1)
{
WORD wBaseCell = ((192 + 32) * 1) + (ds_type * 32);
if (WORD_MAX == wBaseCell)
return -1;
for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; ++i)
if (IsEmptyItemGrid(TItemPos(DRAGON_SOUL_INVENTORY, i + wBaseCell), bSize))
return i + wBaseCell;
}
else if (type == 2)
{
WORD wBaseCell = ((192 + 32) * 2) + (ds_type * 32);
if (WORD_MAX == wBaseCell)
return -1;
for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; ++i)
if (IsEmptyItemGrid(TItemPos(DRAGON_SOUL_INVENTORY, i + wBaseCell), bSize))
return i + wBaseCell;
}
else if (type == 3)
{
WORD wBaseCell = ((192 + 32) * 3) + (ds_type * 32);
if (WORD_MAX == wBaseCell)
return -1;
for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; ++i)
if (IsEmptyItemGrid(TItemPos(DRAGON_SOUL_INVENTORY, i + wBaseCell), bSize))
return i + wBaseCell;
}
else if (type == 4)
{
WORD wBaseCell = ((192 + 32) * 4) + (ds_type * 32);
if (WORD_MAX == wBaseCell)
return -1;
for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; ++i)
if (IsEmptyItemGrid(TItemPos(DRAGON_SOUL_INVENTORY, i + wBaseCell), bSize))
return i + wBaseCell;
}
else if (type == 5)
{
WORD wBaseCell = ((192 + 32) * 5) + (ds_type * 32);
if (WORD_MAX == wBaseCell)
return -1;
for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; ++i)
if (IsEmptyItemGrid(TItemPos(DRAGON_SOUL_INVENTORY, i + wBaseCell), bSize))
return i + wBaseCell;
}
else if (type == 6)
{
WORD wBaseCell = ((192 + 32) * 6) + (ds_type * 32);
if (WORD_MAX == wBaseCell)
return -1;
for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; ++i)
if (IsEmptyItemGrid(TItemPos(DRAGON_SOUL_INVENTORY, i + wBaseCell), bSize))
return i + wBaseCell;
}
return -1;
}
#endif
//arat
case ITEM_GIFTBOX:
{
#ifdef ENABLE_SHOW_CHEST_DROP
if (GetEmptyInventory(3) == -1)
{
ChatPacket (CHAT_TYPE_INFO, "[LS;2034]");
return false;
}
//altına ekle
#ifdef ENABLE_DRAGONSOUL_INVENTORY_BOX_SIZE
if (GetEmptyDragonSoulInventoryType(0, 0) == -1 || GetEmptyDragonSoulInventoryType(1, 0) == -1 || GetEmptyDragonSoulInventoryType(2, 0) == -1
|| GetEmptyDragonSoulInventoryType(3, 0) == -1 || GetEmptyDragonSoulInventoryType(4, 0) == -1 || GetEmptyDragonSoulInventoryType(5, 0) == -1
|| GetEmptyDragonSoulInventoryType(6, 5) == -1
)
{
//ChatPacket(CHAT_TYPE_INFO, "Simya envanterinde i?lenmemi? simyayalardan biri dolu.!");
ChatPacket (CHAT_TYPE_INFO, "[LS;2063]");
return false;
}
if (GetEmptyDragonSoulInventoryType(0, 1) == -1 || GetEmptyDragonSoulInventoryType(1, 1) == -1 || GetEmptyDragonSoulInventoryType(2, 1) == -1
|| GetEmptyDragonSoulInventoryType(3, 1) == -1 || GetEmptyDragonSoulInventoryType(4, 1) == -1 || GetEmptyDragonSoulInventoryType(5, 1) == -1
|| GetEmptyDragonSoulInventoryType(6, 5) == -1
)
{
//ChatPacket(CHAT_TYPE_INFO, "Simya envanterinde yontulmu? simyayalardan biri dolu.!");
ChatPacket (CHAT_TYPE_INFO, "[LS;2064]");
return false;
}
if (GetEmptyDragonSoulInventoryType(0, 2) == -1 || GetEmptyDragonSoulInventoryType(1, 2) == -1 || GetEmptyDragonSoulInventoryType(2, 2) == -1
|| GetEmptyDragonSoulInventoryType(3, 2) == -1 || GetEmptyDragonSoulInventoryType(4, 2) == -1 || GetEmptyDragonSoulInventoryType(5, 2) == -1
|| GetEmptyDragonSoulInventoryType(6, 5) == -1
)
{
//ChatPacket(CHAT_TYPE_INFO, "Simya envanterinde ender simyayalardan biri dolu.!");
ChatPacket (CHAT_TYPE_INFO, "[LS;2065]");
return false;
}
if (GetEmptyDragonSoulInventoryType(0, 3) == -1 || GetEmptyDragonSoulInventoryType(1, 3) == -1 || GetEmptyDragonSoulInventoryType(2, 3) == -1
|| GetEmptyDragonSoulInventoryType(3, 3) == -1 || GetEmptyDragonSoulInventoryType(4, 3) == -1 || GetEmptyDragonSoulInventoryType(5, 3) == -1
|| GetEmptyDragonSoulInventoryType(6, 5) == -1
)
{
//ChatPacket(CHAT_TYPE_INFO, "Simya envanterinde antika simyayalardan biri dolu.!");
ChatPacket (CHAT_TYPE_INFO, "[LS;2066]");
return false;
}
if (GetEmptyDragonSoulInventoryType(0, 4) == -1 || GetEmptyDragonSoulInventoryType(1, 4) == -1 || GetEmptyDragonSoulInventoryType(2, 4) == -1
|| GetEmptyDragonSoulInventoryType(3, 4) == -1 || GetEmptyDragonSoulInventoryType(4, 4) == -1 || GetEmptyDragonSoulInventoryType(5, 4) == -1
|| GetEmptyDragonSoulInventoryType(6, 5) == -1
)
{
//ChatPacket(CHAT_TYPE_INFO, "Simya envanterinde efsanevi simyayalardan biri dolu.!");
ChatPacket (CHAT_TYPE_INFO, "[LS;2067]");
return false;
}
if (GetEmptyDragonSoulInventoryType(0, 5) == -1 || GetEmptyDragonSoulInventoryType(1, 5) == -1 || GetEmptyDragonSoulInventoryType(2, 5) == -1
|| GetEmptyDragonSoulInventoryType(3, 5) == -1 || GetEmptyDragonSoulInventoryType(4, 5) == -1 || GetEmptyDragonSoulInventoryType(5, 5) == -1
|| GetEmptyDragonSoulInventoryType(6, 5) == -1
)
{
//ChatPacket(CHAT_TYPE_INFO, "Simya envanterinde mitsi simyayalardan biri dolu.!");
ChatPacket (CHAT_TYPE_INFO, "[LS;2068]");
return false;
}
#endif