• 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!

C++ Loot

lordlazarus

New Member
Joined
Mar 28, 2016
Messages
15
Reaction score
0
I'm using the tfs 1.4 version, and I noticed here that it's not dropping anything from the monsters, even if I increase the rate and stamina full, what could it be?
 
Both.

Tried with normal player now and nothing.

For exemple: xml of rat.
<item id="2696" chance="100000" /><!-- cheese -->

lua.xml

rateLoot = 1

I think it has something to do with the script eventcallbacks
 
Last edited:
Any errors on the console? Post your data/scripts/eventcallbacks/monster/default_onDropLoot.lua
 
No errors on the console.

default_onDropLoot.lua
Lua:
local ec = EventCallback

ec.onDropLoot = function(self, corpse)
    if configManager.getNumber(configKeys.RATE_LOOT) == 0 then
        return
    end

    local player = Player(corpse:getCorpseOwner())
    local mType = self:getType()
    if not player then
        local monsterLoot = mType:getLoot()
        for i = 1, #monsterLoot do
            local item = corpse:createLootItem(monsterLoot[i])
            if not item then
                print('[Warning] DropLoot:', 'Nao foi possivel despojar-se do corpo.')
            end
        end

        if player then
            local text = ("Despojo de %s: %s"):format(mType:getNameDescription(), corpse:getContentDescription())
            local party = player:getParty()
            if party then
                party:broadcastPartyLoot(text)
            else
                player:sendTextMessage(MESSAGE_LOOT, text)
            end
        end
    else
        local text = ("Despojo de %s: nada"):format(mType:getNameDescription())
        local party = player:getParty()
        if party then
            party:broadcastPartyLoot(text)
        else
            player:sendTextMessage(MESSAGE_LOOT, text)
        end
    end
end

ec:register()
 
Back
Top