채팅0

    인벤에서 아이템 버리기, 특정 아이템 버리지 않기

    조회수 754

    rday.itemIdThatWillNotDrop = {

            4020005, -- 사파이어의 원석

            4010006, -- 금의 원석

            4010004, -- 은의 원석

            4000017, -- 돼지의 머리

            4001004 -- '돼지와 함께 춤을'의 땅문서

        }

     

    -- Check empty inventory slot

        rday.isFullInvenSlot = function(slot)

            local cd = _UserService.LocalPlayer.WsCharacterData

            local slotCount = 0

            for i = 1, cd.ItemMaxSlot[slot], 1 do

                local item = cd:GetItem(slot, i)

                if item ~= nil then

                    slotCount = slotCount + 1

                end

            end


     

            if slotCount >= cd.ItemMaxSlot[slot] then

                return true

            else

                return false

            end

        end

     

    -- Filtering inventory item when you drop it

        rday.filteringInven = function(table, value)

            for _, v in ipairs(table) do

                if v == value then

                    return false

                end

            end

            return true

        end

     

        -- Auto drop function

        rday.checkInvenFunc = function(self)

            if rday.isFullInvenSlot(4) then

                if rday.is_full then

                    return

                end

     

                rday.is_full = true

                rday.is_drop = true

                rday.pick_drop = true

                rday.teleported_to_drop = false

                local cd = _UserService.LocalPlayer.WsCharacterData

                for i = 1, cd.ItemMaxSlot[4], 1 do

                    local item = cd:GetItem(4, i)

                    local itemId = item.ItemId

                    if (rday.filteringInven(rday.itemIdThatWillNotDrop, itemId)) then

                        _ChatMessageLogic:Add(_ChatMessageType.Yellow, "버릴 아이템: " .. _StringMan:GetItemName(itemId).. ", 갯수: " ..item.Number)

                        _UserService.LocalPlayer.MovementComponent:SetWorldPosition(rday.safe_pos + Vector2(0.4, 0))

                        _InventoryLogic:TryDropItem(cd, itemId // 1000000, _InventoryLogic:FindItemPos(cd, itemId), item.Number)

                        wait(1)

                    end

                end

            else

                rday.is_full = false

                rday.is_drop = false

                rday.pick_drop = false

            end

        end

    댓글3

    회원프로필

    왜이리 더럽게짯노

    2024.04.03 13:03
    회원프로필

    이정도면 그래도 보기 불편한 정도는 아니지 않을까요.. ㅠㅠ

    2024.04.03 13:06
    회원프로필

    너무어지럽다 릐기..

    2024.04.03 13:10

      게시글 리스트
      제목작성자작성일조회
      5593304-031268
      5593204-03557
      5593104-03781
      5593004-03597
      5592904-03547
      5592804-031054
      5592704-03782
      5592604-031591
      5592504-033217
      5592404-03634
      5592304-03582
      5592204-03672
      5592104-03744
      5592004-03565
      5591904-03810
      5591804-03755
      5591704-03618
      5591604-03675
      5591504-03884
      5591404-03715