//Arat;
void CHARACTER::CopyDragonSoulItemGrid(std::vector<WORD>& vDragonSoulItemGrid) const
//Üstüne ekle;
int CHARACTER::GetEmptyDragonSoulInventoryType() const
{
auto bSize = 1;
bool foundEmptySlot = false; // Boş yer bulunup bulunmadığını kontrol etmek için flag
for (auto i = 0; i < DS_SLOT_MAX; ++i)
{
for (auto j = 0; j < DRAGON_SOUL_GRADE_MAX; ++j)
{
WORD wBaseCell = i * DRAGON_SOUL_STEP_MAX * DRAGON_SOUL_BOX_SIZE + j * DRAGON_SOUL_BOX_SIZE;
if (WORD_MAX == wBaseCell)
return -1;
foundEmptySlot = false;
for (auto k = 0; k < DRAGON_SOUL_BOX_SIZE; ++k)
{
if (IsEmptyItemGrid(TItemPos(DRAGON_SOUL_INVENTORY, k + wBaseCell), bSize))
{
foundEmptySlot = true;
break;
}
}
if (!foundEmptySlot)
{
return i * 10 + j;
}
}
}
return 0;
}
//Arat;(case ITEM_GIFTBOX: içerisinde)
DWORD dwBoxVnum = item->GetVnum();
//Altına ekle;
if((dwBoxVnum > 51500 && dwBoxVnum < 52000) || (dwBoxVnum >= 50255 && dwBoxVnum <= 50260))
{
auto DragonSoulInventoryCheck = GetEmptyDragonSoulInventoryType();
if (DragonSoulInventoryCheck != 0)
{
auto DragonSoulGradeTypes = DragonSoulInventoryCheck / 10;
auto DragonSoulStepTypes = DragonSoulInventoryCheck % 10;
if (DragonSoulStepTypes == -1)
{
return false;
}
std::string col_type = "";
std::string row_type = "";
if (DragonSoulGradeTypes == 0)
col_type = "Elmas";
else if (DragonSoulGradeTypes == 1)
col_type = "Yakut";
else if (DragonSoulGradeTypes == 2)
col_type = "Yeşim";
else if (DragonSoulGradeTypes == 3)
col_type = "Safir";
else if (DragonSoulGradeTypes == 4)
col_type = "Grena";
else if (DragonSoulGradeTypes == 5)
col_type = "Oniks";
if (DragonSoulStepTypes == 0)
row_type = "İşlenmemiş";
else if (DragonSoulStepTypes == 1)
row_type = "Yontulmuş";
else if (DragonSoulStepTypes == 2)
row_type = "Ender";
else if (DragonSoulStepTypes == 3)
row_type = "Antika";
else if (DragonSoulStepTypes == 4)
row_type = "Efsanevi";
ChatPacket(CHAT_TYPE_INFO, "%s simyasının %s envanteri dolu.!", col_type.c_str(), row_type.c_str());
return false;
}
}