- Mesaj
- 96
- Çözümler
- 12
- Beğeni
- 23
- Puan
- 459
- Ticaret Puanı
- 0
MartysamaV5.8 filesine k envanter eklicem ama char_item.cpp dosyası icerisinde aradığımı bulamıyorum.
İstenilen yer:
İSTENİLEN YER
// Arat bool CHARACTER::PickupItem(DWORD dwVID) içinde
for (int i = 0; i < INVENTORY_MAX_NUM; ++i)
// Değiştir - https://prnt.sc/qaqj2l
#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
for (int i = 0; i < INVENTORY_AND_EQUIP_SLOT_MAX; ++i)
#else
for (int i = 0; i < INVENTORY_MAX_NUM; ++i)
#endif
// Arat bool CHARACTER::PickupItem(DWORD dwVID) İçinde
int iEmptyCell;
if (item->IsDragonSoul())
{
if ((iEmptyCell = GetEmptyDragonSoulInventory(item)) == -1)
{
sys_log(0, "No empty ds inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
// Ekle
#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
else if (item->IsSkillBook())
{
if ((iEmptyCell = GetEmptySkillBookInventory(item->GetSize())) == -1)
{
sys_log(0, "No empty ds inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
else if (item->IsUpgradeItem())
{
if ((iEmptyCell = GetEmptyUpgradeItemsInventory(item->GetSize())) == -1)
{
sys_log(0, "No empty ds inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
else if (item->IsStone())
{
if ((iEmptyCell = GetEmptyStoneInventory(item->GetSize())) == -1)
{
sys_log(0, "No empty ds inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
else if (item->IsBox())
{
if ((iEmptyCell = GetEmptyBoxInventory(item->GetSize())) == -1)
{
sys_log(0, "No empty ds inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
else if (item->IsEfsun())
{
if ((iEmptyCell = GetEmptyEfsunInventory(item->GetSize())) == -1)
{
sys_log(0, "No empty ds inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
else if (item->IsCicek())
{
if ((iEmptyCell = GetEmptyCicekInventory(item->GetSize())) == -1)
{
sys_log(0, "No empty ds inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
#endif
// Arat bool CHARACTER::PickupItem(DWORD dwVID) İçinde
item->RemoveFromGround();
if (item->IsDragonSoul())
item->AddToCharacter(this, TItemPos(DRAGON_SOUL_INVENTORY, iEmptyCell));
// Ekle
#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
else if (item->IsSkillBook())
item->AddToCharacter(this, TItemPos(INVENTORY, iEmptyCell));
else if (item->IsUpgradeItem())
item->AddToCharacter(this, TItemPos(INVENTORY, iEmptyCell));
else if (item->IsStone())
item->AddToCharacter(this, TItemPos(INVENTORY, iEmptyCell));
else if (item->IsBox())
item->AddToCharacter(this, TItemPos(INVENTORY, iEmptyCell));
else if (item->IsEfsun())
item->AddToCharacter(this, TItemPos(INVENTORY, iEmptyCell));
else if (item->IsCicek())
item->AddToCharacter(this, TItemPos(INVENTORY, iEmptyCell));
#endif
// Arat bool CHARACTER::PickupItem(DWORD dwVID) İçinde
int iEmptyCell;
if (item->IsDragonSoul())
{
if (!(owner && (iEmptyCell = owner->GetEmptyDragonSoulInventory(item)) != -1))
{
owner = this;
if ((iEmptyCell = GetEmptyDragonSoulInventory(item)) == -1)
{
owner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
}
// Ekle
#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
else if (item->IsSkillBook())
{
if (!(owner && (iEmptyCell = owner->GetEmptySkillBookInventory(item->GetSize())) != -1))
{
owner = this;
if ((iEmptyCell = GetEmptySkillBookInventory(item->GetSize())) == -1)
{
owner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
}
else if (item->IsUpgradeItem())
{
if (!(owner && (iEmptyCell = owner->GetEmptyUpgradeItemsInventory(item->GetSize())) != -1))
{
owner = this;
if ((iEmptyCell = GetEmptyUpgradeItemsInventory(item->GetSize())) == -1)
{
owner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
}
else if (item->IsStone())
{
if (!(owner && (iEmptyCell = owner->GetEmptyStoneInventory(item->GetSize())) != -1))
{
owner = this;
if ((iEmptyCell = GetEmptyStoneInventory(item->GetSize())) == -1)
{
owner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
}
else if (item->IsBox())
{
if (!(owner && (iEmptyCell = owner->GetEmptyBoxInventory(item->GetSize())) != -1))
{
owner = this;
if ((iEmptyCell = GetEmptyBoxInventory(item->GetSize())) == -1)
{
owner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
}
else if (item->IsEfsun())
{
if (!(owner && (iEmptyCell = owner->GetEmptyEfsunInventory(item->GetSize())) != -1))
{
owner = this;
if ((iEmptyCell = GetEmptyEfsunInventory(item->GetSize())) == -1)
{
owner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
}
else if (item->IsCicek())
{
if (!(owner && (iEmptyCell = owner->GetEmptyCicekInventory(item->GetSize())) != -1))
{
owner = this;
if ((iEmptyCell = GetEmptyCicekInventory(item->GetSize())) == -1)
{
owner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¼ÒÁöÇÏ°í ÀÖ´Â ¾ÆÀÌÅÛÀÌ ³Ê¹« ¸¹½À´Ï´Ù."));
return false;
}
}
}
#endif
// Arat bool CHARACTER::PickupItem(DWORD dwVID) İçinde
item->RemoveFromGround();
if (item->IsDragonSoul())
item->AddToCharacter(owner, TItemPos(DRAGON_SOUL_INVENTORY, iEmptyCell));
// Ekle
#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
else if (item->IsSkillBook())
item->AddToCharacter(owner, TItemPos(INVENTORY, iEmptyCell));
else if (item->IsUpgradeItem())
item->AddToCharacter(owner, TItemPos(INVENTORY, iEmptyCell));
else if (item->IsStone())
item->AddToCharacter(owner, TItemPos(INVENTORY, iEmptyCell));
else if (item->IsBox())
item->AddToCharacter(owner, TItemPos(INVENTORY, iEmptyCell));
else if (item->IsEfsun())
item->AddToCharacter(owner, TItemPos(INVENTORY, iEmptyCell));
else if (item->IsCicek())
item->AddToCharacter(owner, TItemPos(INVENTORY, iEmptyCell));
#endif
eklenecek yer:
EKLENECEK YERR
bool CHARACTER::PickupItem(DWORD dwVID)
{
LPITEM item = ITEM_MANAGER::instance().FindByVID(dwVID);
if (IsObserverMode())
return false;
if (!item || !item->GetSectree())
return false;
if (item->DistanceValid(this))
{
// @fixme150 BEGIN
if (item->GetType() == ITEM_QUEST)
{
if (quest::CQuestManager::instance().GetPCForce(GetPlayerID())->IsRunning() == true)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot pickup this item if you're using quests"));
return false;
}
}
// @fixme150 END
if (item->IsOwnership(this))
{
if (item->GetType() == ITEM_ELK)
{
GiveGold(item->GetCount());
item->RemoveFromGround();
M2_DESTROY_ITEM(item);
Save();
}
#if defined(ENABLE_CHEQUE_SYSTEM) && !defined(DISABLE_CHEQUE_DROP)
else if (item->GetVnum() == CHEQUE_VNUM)
{
if (item->GetCount() + GetCheque() > CHEQUE_MAX - 1)
return false;
GiveCheque(item->GetCount());
item->RemoveFromGround();
M2_DESTROY_ITEM(item);
Save();
}
#endif
else
{
auto finalItem = AutoStackItem(item);
if (finalItem)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아이템 획득: %s"), finalItem->GetName());
if (finalItem->GetType() == ITEM_QUEST)
quest::CQuestManager::instance().PickupItem(GetPlayerID(), finalItem);
return true;
}
int iEmptyCell = GetEmptyInventoryEx(item);
if (iEmptyCell == -1)
{
sys_log(0, "No empty inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지하고 있는 아이템이 너무 많습니다."));
return false;
}
item->RemoveFromGround();
item->AddToCharacter(this, TItemPos(item->GetWindowInventoryEx(), iEmptyCell));
char szHint[32+1];
snprintf(szHint, sizeof(szHint), "%s %u %u", item->GetName(), item->GetCount(), item->GetOriginalVnum());
LogManager::instance().ItemLog(this, item, "GET", szHint);
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아이템 획득: %s"), item->GetName());
if (item->GetType() == ITEM_QUEST)
quest::CQuestManager::instance().PickupItem(GetPlayerID(), item);
}
//Motion(MOTION_PICKUP);
return true;
}
else if (!IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_GIVE | ITEM_ANTIFLAG_DROP) && GetParty())
{
NPartyPickupDistribute::FFindOwnership funcFindOwnership(item);
GetParty()->ForEachOnlineMember(funcFindOwnership);
LPCHARACTER owner = funcFindOwnership.owner;
// @fixme115
if (!owner)
return false;
int iEmptyCell = -1;
if (!(owner && (iEmptyCell = owner->GetEmptyInventoryEx(item)) != -1))
{
owner = this;
if ((iEmptyCell = GetEmptyInventoryEx(item)) == -1)
{
owner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지하고 있는 아이템이 너무 많습니다."));
return false;
}
}
item->RemoveFromGround();
item->AddToCharacter(owner, TItemPos(item->GetWindowInventoryEx(), iEmptyCell));
char szHint[32+1];
snprintf(szHint, sizeof(szHint), "%s %u %u", item->GetName(), item->GetCount(), item->GetOriginalVnum());
LogManager::instance().ItemLog(owner, item, "GET", szHint);
if (owner == this)
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아이템 획득: %s"), item->GetName());
else
{
owner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아이템 획득: %s 님으로부터 %s"), GetName(), item->GetName());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아이템 전달: %s 님에게 %s"), owner->GetName(), item->GetName());
}
if (item->GetType() == ITEM_QUEST)
quest::CQuestManager::instance().PickupItem (owner->GetPlayerID(), item);
return true;
}
}
return false;
}