• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 1.X+ [TFS 1.5] 8.60 LootRate Is kinda weird.

3alola1

I don't have time
Joined
Sep 2, 2010
Messages
917
Solutions
8
Reaction score
512
Location
Darashia
Hello guys I'm having somehow a problem with the droprate in my server.
In tfs 1.5 the randomloot drop is not show most of the items that the monster can drop somehow it shows only 3 or 4 maximum of the items that it can drop.
In the hellgrave datapack you can see for example the droprate is 2x and it is working fine as i want 1767730161885.webp same as the old tfs 0.4 drops items count.
While in my tfs 1.5 the same drop rate is kinda rare to find a loot inside the corpse 1767730350069.webp.Also keep in mind I'm using the same:
orshabaal.xml in both server
same global function function getLootRandom()
Same eventcallback for drops
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 or player:getStamina() > 840 then
        local monsterLoot = mType:getLoot()

        if player and player:isPremium() then
            for i = 1, #monsterLoot do
                local default = monsterLoot[i].chance
                if default < 100000 then
                    monsterLoot[i].chance = default * 1.1
                end
            end
        end

        for i = 1, #monsterLoot do
            local item = corpse:createLootItem(monsterLoot[i], self:getName())
            if not item then
                print("[Warning] DropLoot:", "Could not add loot item to corpse.")
            end
        end

        if player then
            local text = ("Loot of %s: %s"):format(mType:getNameDescription(), corpse:getContentDescription())
            local party = player:getParty()
            if party then
                party:broadcastPartyLoot(text)
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, text)
                player:sendChannelMessage("", text, TALKTYPE_CHANNEL_O, 9) --9 is the channel ID, yours might be different
            end
        end
    else
        local text = ("Loot of %s: nothing (due to low stamina)"):format(mType:getNameDescription())
        local party = player:getParty()
        if party then
            party:broadcastPartyLoot(text)
        else
            player:sendTextMessage(MESSAGE_INFO_DESCR, text)
        end
    end
end

ec:register()
 
Solution
maybe there is some onDeath script that push item to body that was already handled by onDropLoot event?
Naah I think it is from my source it self because I added my whole datapack in the default tfs 1.5 and it is somehow working as it should. im right now checking every possible references inside the source for the droplooting and will see how it goes.
Post automatically merged:

I founded the solution it is because I made a long time ago
C++:
const uint32_t MAX_LOOTCHANCE = 100000;
More than this value? I really don't have any specfic reason why would it make the count of items less? If any body have a specefic reason I would be glad to know why.
1767735967211.webpim expecting the same number of the items same as this picture also keep in mind this is the first try from the hellgrave server droploot
here is the orshabaal.xml and also the total loot of 100 killed orshabaals as you see non single demon shield even dropped
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Orshabaal" nameDescription="Orshabaal" race="fire" experience="20000" speed="370" manacost="0">
    <health now="20500" max="20500"/>
    <look type="201" corpse="5995"/>
    <targetchange interval="5000" chance="20"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="0"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" min="0" max="-1800"/>
        <attack name="physical" interval="2000" chance="7" radius="5" target="0" min="-320" max="-610">
            <attribute key="areaEffect" value="blackspark"/>
        </attack>
        <attack name="fire" interval="2000" chance="15" radius="7" target="1" min="0" max="-650">
            <attribute key="shootEffect" value="fire"/>
            <attribute key="areaEffect" value="firearea"/>
        </attack>
        <attack name="lifedrain" interval="2000" chance="13" length="8" spread="0" min="-0" max="-1300">
            <attribute key="areaEffect" value="purpleenergy"/>
        </attack>
        <attack name="firefield" interval="2000" chance="8" radius="4" target="1">
            <attribute key="shootEffect" value="fire"/>
        </attack>
    </attacks>
    <defenses armor="60" defense="60">
        <defense name="healing" interval="2000" chance="12" min="200" max="500">
            <attribute key="areaEffect" value="blueshimmer"/>
        </defense>
        <defense name="healing" interval="2000" chance="17" min="100" max="200">
            <attribute key="areaEffect" value="blueshimmer"/>
        </defense>
            <defense name="speed" interval="2000" chance="8" speedchange="420" duration="8000">
        <attribute key="areaEffect" value="redshimmer"/>
        </defense>
    </defenses>
    <elements>
        <element icePercent="-10"/>
        <element deathPercent="50"/>
        <element holyPercent="-10"/>
    </elements>
    <immunities>
        <immunity lifedrain="1"/>
        <immunity paralyze="1"/>
        <immunity invisible="1"/>
        <immunity fire="1"/>
        <immunity earth="1"/>
    </immunities>
    <summons maxSummons="4">
        <summon name="demon" interval="5000" chance="20" max="4"/>
    </summons>
    <voices interval="5000" chance="15">
        <voice sentence="PRAISED BE MY MASTERS, THE RUTHLESS SEVEN!" yell="1"/>
        <voice sentence="YOU ARE DOOMED!" yell="1"/>
        <voice sentence="ORSHABAAL IS BACK!" yell="1"/>
        <voice sentence="Be prepared for the day my masters will come for you!"/>
        <voice sentence="SOULS FOR ORSHABAAL!" yell="1"/>
    </voices>
    <loot>
    <item id="2152" countmax="71" chance="10000" /><!-- platinum coin -->
    <item id="6500" countmax="5" chance="50000" /><!-- demonic essence -->
    <item id="5954" countmax="2" chance="20875" /><!-- demon horn -->
    <item id="2164" chance="5300" /><!-- might ring -->
    <item id="2192" chance="5300" /><!-- crystal ball -->
    <item id="2149" countmax="10" chance="15500" /><!-- small emerald -->
    <item id="7365" countmax="89" chance="10000" /><!-- onyx arrow -->
    <item id="2520" chance="5125" /><!-- demon shield -->
    <item id="2143" countmax="15" chance="8400" /><!-- white pearl -->
    <item id="2112" chance="1450" /><!-- teddy bear -->
    <item id="9971" chance="1450" /><!-- gold ingot -->
    <item id="2151" countmax="7" chance="8700" /><!-- talon -->
    <item id="2145" countmax="5" chance="13825" /><!-- small diamond -->
    <item id="2402" chance="7900" /><!-- silver dagger -->
    <item id="2171" chance="17175" /><!-- platinum amulet -->
    <item id="2462" chance="15300" /><!-- devil helmet -->
    <item id="2142" chance="4200" /><!-- ancient amulet -->
    <item id="2396" chance="6050" /><!-- ice rapier -->
    <item id="2148" countmax="100" chance="4225" /><!-- gold coin -->
    <item id="2148" countmax="84" chance="4225" /><!-- gold coin -->
    <item id="1988" chance="100000"><!-- bag -->
            <item id="2472" chance="4200" /><!-- magic plate armor -->
            <item id="2176" chance="20875" /><!-- orb -->
            <item id="2470" chance="6050" /><!-- golden legs -->
            <item id="2434" chance="9750" /><!-- dragon hammer -->
            <item id="2178" chance="7900" /><!-- mind stone -->
            <item id="2195" chance="5125" /><!-- boots of haste -->
            <item id="2421" chance="2350" /><!-- thunder hammer -->
            <item id="2170" chance="3600" /><!-- silver amulet -->
            <item id="2124" chance="7900" /><!-- crystal ring -->
            <item id="2123" chance="6050" /><!-- ring of the sky -->
            <item id="2125" chance="3875" /><!-- crystal necklace -->
            <item id="2158" chance="13450" /><!-- blue gem -->
            <item id="2436" chance="11600" /><!-- skull staff -->
            <item id="2214" chance="19025" /><!-- ring of healing -->
            <item id="1982" chance="13450" /><!-- purple tome -->
            <item id="2197" chance="15300" subtype="5" /><!-- stone skin amulet -->
            <item id="2514" chance="3900" /><!-- mastermind shield -->
            <item id="2393" chance="3900" /><!-- giant sword -->
            <item id="2174" chance="6050" /><!-- strange symbol -->
            <item id="2146" countmax="10" chance="12350" /><!-- small sapphire -->
            <item id="2155" chance="19025" /><!-- green gem -->
            <item id="2387" chance="7900" /><!-- double axe -->
            <item id="2177" chance="11600" /><!-- life crystal -->
            <item id="2182" chance="6050" /><!-- snakebite rod -->
            <item id="2167" chance="6050" /><!-- energy ring -->
            <item id="2377" chance="4200" /><!-- two handed sword -->
            <item id="2432" chance="7900" /><!-- fire axe -->
            <item id="2033" chance="13450" /><!-- golden mug -->
            <item id="2418" chance="9750" /><!-- golden sickle -->
            <item id="2150" countmax="19" chance="16675" /><!-- small amethyst -->
            <item id="2179" chance="15300" /><!-- gold ring -->
            <item id="2144" countmax="15" chance="10375" /><!-- black pearl -->
            <item id="2162" chance="9750" /><!-- magic light wand -->
            <item id="2165" chance="15300" /><!-- stealth ring -->
            <item id="2200" chance="17175" /><!-- protection amulet -->
            <item id="2185" chance="7900" /><!-- necrotic rod -->
            <item id="5808" chance="24575" /><!-- orshabaal's brain -->
            <!--item id="2322" chance="2350" /--><!-- voodoo doll -->
    </item>
</loot>
</monster>
 

Attachments

Last edited:
View attachment 97337im expecting the same number of the items same as this picture also keep in mind this is the first try from the hellgrave server droploot
here is the orshabaal.xml and also the total loot of 100 killed orshabaals as you see non single demon shield even dropped
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Orshabaal" nameDescription="Orshabaal" race="fire" experience="20000" speed="370" manacost="0">
    <health now="20500" max="20500"/>
    <look type="201" corpse="5995"/>
    <targetchange interval="5000" chance="20"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="0"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" min="0" max="-1800"/>
        <attack name="physical" interval="2000" chance="7" radius="5" target="0" min="-320" max="-610">
            <attribute key="areaEffect" value="blackspark"/>
        </attack>
        <attack name="fire" interval="2000" chance="15" radius="7" target="1" min="0" max="-650">
            <attribute key="shootEffect" value="fire"/>
            <attribute key="areaEffect" value="firearea"/>
        </attack>
        <attack name="lifedrain" interval="2000" chance="13" length="8" spread="0" min="-0" max="-1300">
            <attribute key="areaEffect" value="purpleenergy"/>
        </attack>
        <attack name="firefield" interval="2000" chance="8" radius="4" target="1">
            <attribute key="shootEffect" value="fire"/>
        </attack>
    </attacks>
    <defenses armor="60" defense="60">
        <defense name="healing" interval="2000" chance="12" min="200" max="500">
            <attribute key="areaEffect" value="blueshimmer"/>
        </defense>
        <defense name="healing" interval="2000" chance="17" min="100" max="200">
            <attribute key="areaEffect" value="blueshimmer"/>
        </defense>
            <defense name="speed" interval="2000" chance="8" speedchange="420" duration="8000">
        <attribute key="areaEffect" value="redshimmer"/>
        </defense>
    </defenses>
    <elements>
        <element icePercent="-10"/>
        <element deathPercent="50"/>
        <element holyPercent="-10"/>
    </elements>
    <immunities>
        <immunity lifedrain="1"/>
        <immunity paralyze="1"/>
        <immunity invisible="1"/>
        <immunity fire="1"/>
        <immunity earth="1"/>
    </immunities>
    <summons maxSummons="4">
        <summon name="demon" interval="5000" chance="20" max="4"/>
    </summons>
    <voices interval="5000" chance="15">
        <voice sentence="PRAISED BE MY MASTERS, THE RUTHLESS SEVEN!" yell="1"/>
        <voice sentence="YOU ARE DOOMED!" yell="1"/>
        <voice sentence="ORSHABAAL IS BACK!" yell="1"/>
        <voice sentence="Be prepared for the day my masters will come for you!"/>
        <voice sentence="SOULS FOR ORSHABAAL!" yell="1"/>
    </voices>
    <loot>
    <item id="2152" countmax="71" chance="10000" /><!-- platinum coin -->
    <item id="6500" countmax="5" chance="50000" /><!-- demonic essence -->
    <item id="5954" countmax="2" chance="20875" /><!-- demon horn -->
    <item id="2164" chance="5300" /><!-- might ring -->
    <item id="2192" chance="5300" /><!-- crystal ball -->
    <item id="2149" countmax="10" chance="15500" /><!-- small emerald -->
    <item id="7365" countmax="89" chance="10000" /><!-- onyx arrow -->
    <item id="2520" chance="5125" /><!-- demon shield -->
    <item id="2143" countmax="15" chance="8400" /><!-- white pearl -->
    <item id="2112" chance="1450" /><!-- teddy bear -->
    <item id="9971" chance="1450" /><!-- gold ingot -->
    <item id="2151" countmax="7" chance="8700" /><!-- talon -->
    <item id="2145" countmax="5" chance="13825" /><!-- small diamond -->
    <item id="2402" chance="7900" /><!-- silver dagger -->
    <item id="2171" chance="17175" /><!-- platinum amulet -->
    <item id="2462" chance="15300" /><!-- devil helmet -->
    <item id="2142" chance="4200" /><!-- ancient amulet -->
    <item id="2396" chance="6050" /><!-- ice rapier -->
    <item id="2148" countmax="100" chance="4225" /><!-- gold coin -->
    <item id="2148" countmax="84" chance="4225" /><!-- gold coin -->
    <item id="1988" chance="100000"><!-- bag -->
            <item id="2472" chance="4200" /><!-- magic plate armor -->
            <item id="2176" chance="20875" /><!-- orb -->
            <item id="2470" chance="6050" /><!-- golden legs -->
            <item id="2434" chance="9750" /><!-- dragon hammer -->
            <item id="2178" chance="7900" /><!-- mind stone -->
            <item id="2195" chance="5125" /><!-- boots of haste -->
            <item id="2421" chance="2350" /><!-- thunder hammer -->
            <item id="2170" chance="3600" /><!-- silver amulet -->
            <item id="2124" chance="7900" /><!-- crystal ring -->
            <item id="2123" chance="6050" /><!-- ring of the sky -->
            <item id="2125" chance="3875" /><!-- crystal necklace -->
            <item id="2158" chance="13450" /><!-- blue gem -->
            <item id="2436" chance="11600" /><!-- skull staff -->
            <item id="2214" chance="19025" /><!-- ring of healing -->
            <item id="1982" chance="13450" /><!-- purple tome -->
            <item id="2197" chance="15300" subtype="5" /><!-- stone skin amulet -->
            <item id="2514" chance="3900" /><!-- mastermind shield -->
            <item id="2393" chance="3900" /><!-- giant sword -->
            <item id="2174" chance="6050" /><!-- strange symbol -->
            <item id="2146" countmax="10" chance="12350" /><!-- small sapphire -->
            <item id="2155" chance="19025" /><!-- green gem -->
            <item id="2387" chance="7900" /><!-- double axe -->
            <item id="2177" chance="11600" /><!-- life crystal -->
            <item id="2182" chance="6050" /><!-- snakebite rod -->
            <item id="2167" chance="6050" /><!-- energy ring -->
            <item id="2377" chance="4200" /><!-- two handed sword -->
            <item id="2432" chance="7900" /><!-- fire axe -->
            <item id="2033" chance="13450" /><!-- golden mug -->
            <item id="2418" chance="9750" /><!-- golden sickle -->
            <item id="2150" countmax="19" chance="16675" /><!-- small amethyst -->
            <item id="2179" chance="15300" /><!-- gold ring -->
            <item id="2144" countmax="15" chance="10375" /><!-- black pearl -->
            <item id="2162" chance="9750" /><!-- magic light wand -->
            <item id="2165" chance="15300" /><!-- stealth ring -->
            <item id="2200" chance="17175" /><!-- protection amulet -->
            <item id="2185" chance="7900" /><!-- necrotic rod -->
            <item id="5808" chance="24575" /><!-- orshabaal's brain -->
            <!--item id="2322" chance="2350" /--><!-- voodoo doll -->
    </item>
</loot>
</monster>
Can you also post the lib container file (usually data/lib/core/container.lua or whereever holds the createLootItem method).
Or link to the github for the data folder (Yeah ik im lazy af)
 
LUA:
function Container.isContainer(self)
    return true
end

function Container.createLootItem(self, item)
    if self:getEmptySlots() == 0 then
        return true
    end

    local itemCount = 0
    local randvalue = getLootRandom()
    local itemType = ItemType(item.itemId)
  
    local chance = item.chance
    if creatureName ~= nil and table.contains(boostedMonsters, creatureName:lower()) then
        chance = chance * boostedMonstersLootChanceMultiplier
        if chance > MAX_LOOTCHANCE then
            chance = MAX_LOOTCHANCE
        end
    end
    if randvalue < chance then
        if itemType:isStackable() then
            itemCount = randvalue % item.maxCount + 1
        else
            itemCount = 1
        end
    end

    while itemCount > 0 do
        local count = math.min(100, itemCount)
      
        local subType = count
        if itemType:isFluidContainer() then
            subType = math.max(0, item.subType)
        end
      
        local tmpItem = Game.createItem(item.itemId, subType)
        if not tmpItem then
            return false
        end

        if tmpItem:isContainer() then
            for i = 1, #item.childLoot do
                if not tmpItem:createLootItem(item.childLoot[i]) then
                    tmpItem:remove()
                    return false
                end
            end

            if #item.childLoot > 0 and tmpItem:getSize() == 0 then
                tmpItem:remove()
                return true
            end
        end

        if item.subType ~= -1 then
            tmpItem:setAttribute(ITEM_ATTRIBUTE_CHARGES, item.subType)
        end

        if item.actionId ~= -1 then
            tmpItem:setActionId(item.actionId)
        end

        if item.text and item.text ~= "" then
            tmpItem:setText(item.text)
        end

        local ret = self:addItemEx(tmpItem)
        if ret ~= RETURNVALUE_NOERROR then
            tmpItem:remove()
        end

        itemCount = itemCount - count
    end
    return true
end

nah its fine xD here it is but Im not expecting the error is from here because somehow i also tried the other server container.lua and it still has the same issue.
 
Interesting. I've seen a lot of weird stuff regarding these downgrades. If I get some more time tomorrow and you still need help, I will take a further look for you.
 
Last edited:
maybe there is some onDeath script that push item to body that was already handled by onDropLoot event?
Naah I think it is from my source it self because I added my whole datapack in the default tfs 1.5 and it is somehow working as it should. im right now checking every possible references inside the source for the droplooting and will see how it goes.
Post automatically merged:

I founded the solution it is because I made a long time ago
C++:
const uint32_t MAX_LOOTCHANCE = 100000;
More than this value? I really don't have any specfic reason why would it make the count of items less? If any body have a specefic reason I would be glad to know why.
 
Last edited:
Solution

Similar threads

Back
Top