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

Mobs only drop one of each item

OTHst

New Member
Joined
May 10, 2019
Messages
32
Solutions
1
Reaction score
4
Hi!

I'm very, very new to tfs and everything so forgive me if this is something easy but I've tried google and searching this forum without any luck.

The thing is that on my server (TFS 1.3) every monster only drops one of each stackable item. Every coin and meat and so on. Anyone knows what's wrong?
 
Solution
You don't need to recompile your server, just change the following:
Lua:
local itemCount = 0
    local randvalue = getLootRandom()
    if randvalue < item.chance then
        if ItemType(item.itemId):isStackable() then
            itemCount = randvalue % item.maxCount + 1
        else
            itemCount = 1
        end
    end
It may sound weird, but maybe your loot rate in config.lua is too high. If it's high, then try to lower it and check if it works.
 
It may sound weird, but maybe your loot rate in config.lua is too high. If it's high, then try to lower it and check if it works.
Thank you for your reply, I really appreciated it. The rate was set at 2 but I lowered it to 1 just in case but the problem still remains. I've also noticed that only gold coins drops from most monsters as well. Not the other stuff in the loot
 
And to clarify, some items do drop and some does not. Leather boots drops in Trolls but not in Troll champions for example. Spears however drops in both of them.
 
This PR should solve the problem
Cool thank you for your help. One question though since I'm not familiar with the code yet... Do I need to recompile after changing it? I tried changing the row in the PR but it didn't work.

Another thing I noticed is that the loot seem kind of funky. Loot is often either one item or every item that could drop. Not always but more often than not.
 
This PR should solve the problem
Tried recompile as well and it didn't help. Here's my container.lua:

Lua:
local itemCount = 0
    local randvalue = getLootRandom()
    if randvalue < item.chance then
        if ItemType(item.itemid):isStackable() then
            itemCount = randvalue % item.countmax + 1
        else
            itemCount = 1
        end
    end
 
You don't need to recompile your server, just change the following:
Lua:
local itemCount = 0
    local randvalue = getLootRandom()
    if randvalue < item.chance then
        if ItemType(item.itemId):isStackable() then
            itemCount = randvalue % item.maxCount + 1
        else
            itemCount = 1
        end
    end
 
Solution
You don't need to recompile your server, just change the following:
Lua:
local itemCount = 0
    local randvalue = getLootRandom()
    if randvalue < item.chance then
        if ItemType(item.itemId):isStackable() then
            itemCount = randvalue % item.maxCount + 1
        else
            itemCount = 1
        end
    end
That did it! Thank you!

I misread the PR as it said in a comment that it should be itemid and not itemId but this did it!
 
Back
Top