• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Need auto loot for TFS 1.4.2.

OTcreator

Active Member
Joined
Feb 14, 2022
Messages
425
Solutions
1
Reaction score
44
Hello!
Can anyone help with getting a working auto-loot for TFS version 1.4.2?
 
 
This is not working with 1.4.2 (need change sources to 1.5).
 
The same (this is screen from other user):

View attachment 81781
Here are the commits that need necessary alterations.

look for this line:
Lua:
function ec.onDropLoot(monster, corpse)
change to:
Lua:
function ec.onDropLoot(monster, corpse)
    if not corpse:getType():isContainer() then
        return
    end

    local corpseOwner = Player(corpse:getCorpseOwner())
    local items = corpse:getItems()
    local warningCapacity = false
    for _, item in pairs(items) do
        if item then
            local itemId = item:getId()
            if hasPlayerAutolootItem(corpseOwner, itemId) then
                if currencyItems[itemId] then
                    local worth = item:getCount() 
                    local playerBankBalance = corpseOwner:getBankBalance()
                    corpseOwner:setBankBalance(playerBankBalance + worth)
                    corpseOwner:sendTextMessage(MESSAGE_STATUS_SMALL, string.format("Your balance increases by %d gold coins.", worth))
                    item:remove()
                elseif not item:moveTo(corpseOwner, 0) then
                    warningCapacity = true
                end
            end
        end
    end

    if warningCapacity then
        corpseOwner:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have no capacity.")
    end
end
 
Last edited:
Back
Top