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

TFS 1.X+ Problem with droploot

Joined
Feb 16, 2017
Messages
47
Solutions
2
Reaction score
6
Hey, I have problem with loot. Sometimes creatures drops 2x loot, like: Loot of a monk: 2 book of prayers
I got latest TFS 1.3 so I don't know whats wrong with droploot. (rateLoot = 1)

Monk loot from .xml:

Lua:
    <loot>
        <item name="gold coin" countmax="1" chance="15300" />
        <item name="book of prayers" chance="6130" />
        <item name="rope belt" chance="4350" />
        <item name="safety pin" chance="1401" />
        <item name="sandals" chance="860" />
        <item name="life ring" chance="220" />
        <item id="2401" chance="740" /><!-- staff -->
    </loot>

Guys please help
 
Last edited:

Sarah Wesker

ค∂vαηcε รүηтαx ❤
Support Team
Joined
Mar 16, 2017
Messages
989
Solutions
96
Reaction score
1,012
Location
London
GitHub
MillhioreBT
This I can't reproduce on my TFS 1.3 server
you probably have a system that modifies the loot and the problem may lie with that system and not a TFS problem
If you have more information about your problem, do not hesitate to continue informing us, to see if at any time we can help you
 
OP
P
Joined
Feb 16, 2017
Messages
47
Solutions
2
Reaction score
6
I using Printer's autoloot, maybe there's problem? But i don't see any...


Lua:
local function scanContainer(cid, position)
    local player = Player(cid)
    if not player then
        return
    end

    local corpse = Tile(position):getTopDownItem()
    if not corpse or not corpse:isContainer() then
        return
    end

    if corpse:getType():isCorpse() and corpse:getAttribute(ITEM_ATTRIBUTE_CORPSEOWNER) == cid then
        for a = corpse:getSize() - 1, 0, -1 do
            local containerItem = corpse:getItem(a)
            if containerItem then
                for b = AUTOLOOT_STORAGE_START, AUTOLOOT_STORAGE_END do
                    if player:getStorageValue(b) == containerItem:getId() then
                        containerItem:moveTo(player)
                    end
                end
            end
        end
    end
end

function onKill(player, target)
    if not target:isMonster() then
        return true
    end

    addEvent(scanContainer, 100, player:getId(), target:getPosition())
    return true
end
 
OP
P
Joined
Feb 16, 2017
Messages
47
Solutions
2
Reaction score
6
My reload.lua. I will also add that I dont use /reload command
Lua:
local reloadTypes = {
    ["all"] = RELOAD_TYPE_ALL,

    ["action"] = RELOAD_TYPE_ACTIONS,
    ["actions"] = RELOAD_TYPE_ACTIONS,

    ["chat"] = RELOAD_TYPE_CHAT,
    ["channel"] = RELOAD_TYPE_CHAT,
    ["chatchannels"] = RELOAD_TYPE_CHAT,

    ["config"] = RELOAD_TYPE_CONFIG,
    ["configuration"] = RELOAD_TYPE_CONFIG,

    ["creaturescript"] = RELOAD_TYPE_CREATURESCRIPTS,
    ["creaturescripts"] = RELOAD_TYPE_CREATURESCRIPTS,

    ["events"] = RELOAD_TYPE_EVENTS,

    ["global"] = RELOAD_TYPE_GLOBAL,

    ["globalevent"] = RELOAD_TYPE_GLOBALEVENTS,
    ["globalevents"] = RELOAD_TYPE_GLOBALEVENTS,

    ["items"] = RELOAD_TYPE_ITEMS,

    ["monster"] = RELOAD_TYPE_MONSTERS,
    ["monsters"] = RELOAD_TYPE_MONSTERS,

    ["mount"] = RELOAD_TYPE_MOUNTS,
    ["mounts"] = RELOAD_TYPE_MOUNTS,

    ["move"] = RELOAD_TYPE_MOVEMENTS,
    ["movement"] = RELOAD_TYPE_MOVEMENTS,
    ["movements"] = RELOAD_TYPE_MOVEMENTS,

    ["npc"] = RELOAD_TYPE_NPCS,
    ["npcs"] = RELOAD_TYPE_NPCS,

    ["quest"] = RELOAD_TYPE_QUESTS,
    ["quests"] = RELOAD_TYPE_QUESTS,

    ["raid"] = RELOAD_TYPE_RAIDS,
    ["raids"] = RELOAD_TYPE_RAIDS,

    ["spell"] = RELOAD_TYPE_SPELLS,
    ["spells"] =  RELOAD_TYPE_SPELLS,

    ["talk"] = RELOAD_TYPE_TALKACTIONS,
    ["talkaction"] = RELOAD_TYPE_TALKACTIONS,
    ["talkactions"] = RELOAD_TYPE_TALKACTIONS,

    ["weapon"] = RELOAD_TYPE_WEAPONS,
    ["weapons"] = RELOAD_TYPE_WEAPONS,

    ["scripts"] = RELOAD_TYPE_SCRIPTS,
    ["libs"] = RELOAD_TYPE_GLOBAL
}

function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    logCommand(player, words, param)

    local reloadType = reloadTypes[param:lower()]
    if not reloadType then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Reload type not found.")
        return false
    end

    -- need to clear EventCallback.data or we end up having duplicated events on /reload scripts
    if table.contains({RELOAD_TYPE_SCRIPTS, RELOAD_TYPE_ALL}, reloadType) then
        EventCallback:clear()
    end

    Game.reload(reloadType)
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, string.format("Reloaded %s.", param:lower()))
    return false
end
 

kamilcioo

Veteran OT User
Joined
Jul 25, 2008
Messages
952
Solutions
1
Reaction score
277
Are you using some custom scripts in creaturescripts? Are you sure you dont have prey on that creature? Does it happen on all items or just stackables?
 
OP
P
Joined
Feb 16, 2017
Messages
47
Solutions
2
Reaction score
6
Ye i did changes in sources, but in gameplay mechanics not in loot. I have latest TFS 1.3 so all monsters is in .xml.
I think its something wrong with event_callbacks from lib.
When I type /reload all, "EventCallback:clear()" seems to repair this double loot issue to next server start, becouse loot from monsters after /reload all is much weaker and no more 2x stackable items.
 
Last edited:
Top