common/service.h:
Kod:
//Ekle
#define ENABLE_AUTOGIVEITEM_CELL_CHECK // AutoGiveItim Bos Envanter Kontrol
char_item.cpp:
Kod:
//Arat
LPITEM CHARACTER::AutoGiveItem(DWORD dwItemVnum, BYTE bCount, int iRarePct, bool bMsg)
{
TItemTable* p = ITEM_MANAGER::instance().GetTable(dwItemVnum);
if (!p)
return NULL;
//Altına Ekle
#ifdef ENABLE_AUTOGIVEITEM_CELL_CHECK
LPITEM itemCheck = ITEM_MANAGER::instance().CreateItem(dwItemVnum, bCount, 0, true, -1, true);
if (itemCheck)
{
int iEmptyCell = -1;
if (p->bType == ITEM_DS)
iEmptyCell = GetEmptyDragonSoulInventory(itemCheck);
#ifdef ENABLE_SPECIAL_STORAGE
else if (IsUpgradeItem(dwItemVnum))
iEmptyCell = GetEmptyUpgradeInventory(itemCheck);
else if (IsStoneSpecial(dwItemVnum, p->bType))
iEmptyCell = GetEmptyStoneInventory(itemCheck);
else if (ITEM_SKILLBOOK == p->bType)
iEmptyCell = GetEmptyBookInventory(itemCheck);
else if (IsFlowerItem(dwItemVnum))
iEmptyCell = GetEmptyFlowerInventory(itemCheck);
else if (IsAttrSpecial(dwItemVnum))
iEmptyCell = GetEmptyAttrInventory(itemCheck);
else if (IsChestItem(dwItemVnum))
iEmptyCell = GetEmptyChestInventory(itemCheck);
#endif
else
iEmptyCell = GetEmptyInventory(p->bSize);
if (iEmptyCell == -1)
{
if (bMsg)
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Envanterinde yer yok autogiveitem!"));
return NULL;
}
}
#endif