Hikayeler

Reklam vermek için turkmmo@gmail.com

martysama v5.8 filesine k envanter eklemek istiyorum

07.Forever

Level 2
Üye
Katılım
29 Nis 2023
Konular
16
Mesajlar
53
Online süresi
1ay 18g
Reaksiyon Skoru
19
Altın Konu
0
Başarım Puanı
48
Yaş
28
TM Yaşı
2 Yıl 11 Ay 26 Gün
MmoLira
6,289
DevLira
9

Metin2 EP, Valorant VP dahil tüm oyun ürünlerini en uygun fiyatlarla bulabilir, Item ve Karakterlerinizi hızlıca satabilirsiniz. HEMEN TIKLA!

martysama v5.8 filesini kullanıyorum k envanter eklemek istiyorum ama char_item üzerinde aradığım kod başlıklarını bulamıyorum.


İstenen 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_#ifdefINVENTORY_SYSTEM
                    for (int i = 0; i < INVENTORY_AND_EQUIP_SLOT_MAX; ++i)
#else
        #else       for (int i = 0; i < INVENTORY_MAX_NUM; ++i)
#endif

// Ara#endif 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
           #ifdeflse 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));#endifkle
#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
                else if (item->IsSkillBook())
                    item->AddToCharacter(this, TItemPos(INVENTORY, iEmptyCell));
                else if (item->IsUpgradeItem())
                    item->AddT#ifdefcter(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))
  #endif        {
                    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 ((#ifdefCell = 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->AddTo#endifter(owner, TItemPos(INVENTORY, iEmptyCell));
            else if (item->IsStone())
                item->AddToCharacter(owner, TItemPos(INVENTORY, iEmptyCell));
            else if (item->IsBox())
                item->AddToCharacter(ow#ifdefItemPos(INVENTORY, iEmptyCell));
            else if (item->IsEfsun())
                item->AddToCharacter(owner, TItemPos(INVENTORY, iEmptyCell));
            else if (item->IsCicek())
                item->AddToCharacter(owner, TItemPos(INVENTORY, iEmptyCell));
#endif

// Arat
bool CHARACTER::UnequipItem(LPITEM item)
{
    if (false == CanUnequipNow(item))
        return false;

    int pos;
    if (item->IsDragonSoul())
        pos = GetEmptyDragonSoulInventory(item);

// Ekle - https://prnt.sc/qaqk44
#ifdef ENABLE_SPLIT_INVENTORY_SYSTEM
    else if (item->IsSkillBook())
        pos = GetEmptySkillBookInventory(item->GetSize());
    else if (item->IsUpgradeItem())
        pos = GetEmptyUpgradeItemsInventory(item->GetSize(#endif  else if (item->IsStone())
        pos = GetEmptyStoneInventory(item->GetSize());
    else if (item->IsBox())
        pos = GetEmptyBoxInventory(item->GetSize());
    else if (item->IsEfsun())
        pos = GetEmptyEfsunInventory(item->Get#ifdef);
    else if (item->IsCicek())
        pos = GetEmptyCicekInventory(item->GetSize());
#endif

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

eklenecek yer:
bool CHARACTER::PickupItem(DWORD dwVID)
{
    LPITEM item = ITEM_MANAGER::instance().FindByVID(dwVID);

    if (IsObserverMode())
        return false;

    if (!item || !item->GetSectree())
        #endif 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 finalIte#if 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 iEmptyCe#endifetEmptyInventoryEx(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;
}
 

Ekli dosyalar

  • istenen.rar
    3.8 KB · Görüntüleme: 0
  • eklenecek.rar
    33.8 KB · Görüntüleme: 0

Şu an konuyu görüntüleyenler (Toplam : 1, Üye: 0, Misafir: 1)

Geri
Üst