Hello, I want to create a special belt with only claw in it, so I decided to create a if statement in "belt_inventory_helper.h", so I created it in lot of way but without success...
Here's the first way (belt_inventory_helper.h) :
static bool CanMoveIntoBeltInventory(LPITEM item)
{
bool canMove = false;
if (item->GetVnum() == MY ITEM)
{
if (item->GetType() == ITEM_WEAPON)
{
switch (item->GetSubType())
{
case WEAPON_CLAW:
canMove = true;
break;
}
}
}
else if (item->GetVnum() != MY ITEM)
{
if (item->GetType() == ITEM_USE)
{
switch (item->GetSubType())
{
case USE_POTION:
case USE_POTION_NODELAY:
case USE_ABILITY_UP:
canMove = true;
break;
}
}
}
return canMove;
}
Second way (belt_inventory_helper.h) :
static bool CanMoveIntoBeltInventory(LPITEM item)
{
bool canMove = false;
if (item->GetType() == ITEM_USE || item->GetType() == ITEM_WEAPON)
{
if (item->GetVnum() == MY ITEM)
{
switch (item->GetSubType())
{
case WEAPON_CLAW:
canMove = true;
break;
}
}
else
{
switch (item->GetSubType())
{
case USE_POTION:
case USE_POTION_NODELAY:
case USE_ABILITY_UP:
canMove = true;
break;
}
}
}
return canMove;
}
Third way in order to see if I can place everything in it and then create a special function for this special belt (input_main.cpp & char_item.cpp) :
if (pkItem->GetVnum() != MY ITEM && p->ItemPos.IsBeltInventoryPosition() && false == CBeltInventoryHelper::CanMoveIntoBeltInventory(pkItem))
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Ceintures> Vous ne pouvez pas bouger cet objet ici."));
return;
}
if (item->GetVnum() != MY ITEM && DestCell.IsBeltInventoryPosition() && false == CBeltInventoryHelper::CanMoveIntoBeltInventory(item))
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ÀÌ ¾ÆÀÌÅÛÀº º§Æ® Àκ¥Å丮·Î ¿Å±æ ¼ö ¾ø½À´Ï´Ù."));
return false;
}
And I can't put everything, I can only put the things declared in CanMoveIntoBeltInventory.
Have a nice day, thanks