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

Lua Monsters drop no loot? Only Crystal Deposits?

Eldora

Banned User
Joined
Oct 19, 2009
Messages
604
Reaction score
26
Why does monsters only drop "Crystal Deposit" on my server?
1680784428557.png

Example, Rat:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Rat" nameDescription="a rat" race="blood" experience="5" speed="134" manacost="200">
    <health now="20" max="20" />
    <look type="21" corpse="5964" />
    <targetchange interval="4000" chance="0" />
    <flags>
        <flag summonable="1" />
        <flag attackable="1" />
        <flag hostile="1" />
        <flag ignorespawnblock="1" />
        <flag illusionable="1" />
        <flag convinceable="1" />
        <flag pushable="1" />
        <flag canpushitems="0" />
        <flag canpushcreatures="0" />
        <flag targetdistance="1" />
        <flag staticattack="90" />
        <flag runonhealth="5" />
        <flag canwalkonenergy="0" />
        <flag canwalkonfire="0" />
        <flag canwalkonpoison="0" />
    </flags>
    <attacks>
        <attack name="melee" interval="2000" min="0" max="-8" />
    </attacks>
    <defenses armor="1" defense="1" />
    <elements>
        <element earthPercent="20" />
        <element holyPercent="20" />
        <element icePercent="-10" />
        <element deathPercent="-10" />
    </elements>
    <voices interval="5000" chance="10">
        <voice sentence="Meep!" />
    </voices>
    <loot>
        <item name="gold coin" countmax="4" chance="100000" />
        <item id="2696" chance="39410" /><!-- cheese -->
    </loot>
</monster>



WHYYYY? :eek:
 
Why does monsters only drop "Crystal Deposit" on my server?
View attachment 74603

Example, Rat:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Rat" nameDescription="a rat" race="blood" experience="5" speed="134" manacost="200">
    <health now="20" max="20" />
    <look type="21" corpse="5964" />
    <targetchange interval="4000" chance="0" />
    <flags>
        <flag summonable="1" />
        <flag attackable="1" />
        <flag hostile="1" />
        <flag ignorespawnblock="1" />
        <flag illusionable="1" />
        <flag convinceable="1" />
        <flag pushable="1" />
        <flag canpushitems="0" />
        <flag canpushcreatures="0" />
        <flag targetdistance="1" />
        <flag staticattack="90" />
        <flag runonhealth="5" />
        <flag canwalkonenergy="0" />
        <flag canwalkonfire="0" />
        <flag canwalkonpoison="0" />
    </flags>
    <attacks>
        <attack name="melee" interval="2000" min="0" max="-8" />
    </attacks>
    <defenses armor="1" defense="1" />
    <elements>
        <element earthPercent="20" />
        <element holyPercent="20" />
        <element icePercent="-10" />
        <element deathPercent="-10" />
    </elements>
    <voices interval="5000" chance="10">
        <voice sentence="Meep!" />
    </voices>
    <loot>
        <item name="gold coin" countmax="4" chance="100000" />
        <item id="2696" chance="39410" /><!-- cheese -->
    </loot>
</monster>



WHYYYY? :eek:
look in your source "const.h" look for ITEM_GOLD_COIN and check which value is set
 
look in your source "const.h" look for ITEM_GOLD_COIN and check which value is set

Can't find that, I am using TFS 1.4 btw.
This applies to every monster in the game and they dont drop anything other than this "crystal deposit"?
 
Install visual studio code. Check what is the id of this crystal deposit (can be done for example by checking the description of the item while being an admin in-game).
Now, in visual studio code open your server folder (containing data + src). Look for the id.
 
Install visual studio code. Check what is the id of this crystal deposit (can be done for example by checking the description of the item while being an admin in-game).
Now, in visual studio code open your server folder (containing data + src). Look for the id.
1680788392151.png

There was nothing when I searched for the ID of crystal deposit (26382).
Now what? :eek:
 
View attachment 74606

There was nothing when I searched for the ID of crystal deposit (26382).
Now what? :eek:
I dont think you've browsed the correct folder. If you did, it would atleast show the registered item in items.xml. But the results are nonexistent, this is not possible.
While being in the server folder where there is src, data and other things click the top at the file explorer to get the path. This path you open in the visual studio code. 1680789301033.png
 
I dont think you've browsed the correct folder. If you did, it would atleast show the registered item in items.xml. But the results are nonexistent, this is not possible.
While being in the server folder where there is src, data and other things click the top at the file explorer to get the path. This path you open in the visual studio code. View attachment 74608

I found this:
1680808733016.png
1680808744397.png
1680808751860.png

Does it help?
Does it tell you why monsters only drop this item (26382)?
 
If it's all monsters on the server.. I would assume it's a custom script at fault.

Likely an onKill or onDeath script, which is deleting the regular loot and replacing it with the crystal deposit.

--
If it's a fresh install of tfs 1.4... then I have no idea.
 
If it's all monsters on the server.. I would assume it's a custom script at fault.

Likely an onKill or onDeath script, which is deleting the regular loot and replacing it with the crystal deposit.

--
If it's a fresh install of tfs 1.4... then I have no idea.
yes, post these scripts

it seems like the script intended to add this crystal deposit in the loot table but somehow it replaced the whole loot table with it

Here are the scripts:

data\actions\actions.xml

<action fromid="26382" toid="26383" script="upgrade_system_actions.lua" /> <!-- Crystals and Scroll -->
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
  return us_onUse(player, item, fromPosition, target, toPosition, isHotkey)
end


data\items\items.xml
<item id="26382" name="Crystal Deposit"/>
This is just the item


data\upgrade_system_const.lua
CRYSTAL_FOSSIL = 26382, -- Crystal Fossil item id
IT IS PROBABLY SOMEWHERE IN THIS SCRIPT????:
local UPGRADE_SYSTEM_VERSION = "2.0.0"print(">> Loaded Upgrade System v" .. UP - Pastebin.com (https://pastebin.com/k4MhFg9q)
 
oh so you are using @oen432 's upgrade system... it seems like you are using an old version thought, go to his topic and download the new version and see if it's working properly

you have version 2.0.0
latest version is 3.0.3 or 2
 
oh so you are using @oen432 's upgrade system... it seems like you are using an old version thought, go to his topic and download the new version and see if it's working properly

you have version 2.0.0
latest version is 3.0.3 or 2
It came with this it seems and it is version 2.0.0, same as you linked?
Where can I find a later version and do I upgrade by just replacing the files?
 
github link on his posts
Cant I just disable the system somehow, to get loot to work?
Post automatically merged:

If I try to disable the system, then I get this error:

1680820449598.png
Post automatically merged:

I managed to get rid of the error message above, by disabling "<event class="Monster" method="onDropLoot" enabled="0" />"
but now I get nothing from monsters instead:

1680820578258.png

Why?
 
Last edited:
An honest question... why not just install a clean tfs 1.4, instead of.. whatever you downloaded?

--
To uninstall the system, you'll want to undo all of the changes that were made to install it.

So basically go through the 'install guide' and remove everything instead of adding it. (or reverting back to original text, if it was changed)

 
An honest question... why not just install a clean tfs 1.4, instead of.. whatever you downloaded?

--
To uninstall the system, you'll want to undo all of the changes that were made to install it.

So basically go through the 'install guide' and remove everything instead of adding it. (or reverting back to original text, if it was changed)

Is it only in the server files or also in the source?
I think it is only in the server files right?

This edition is good, just that loot does not show in monsters.
But, where can I find a clean TFS 1.4 för 10.98 that is 100% bug free?
 
bug free? Probably impossible to find.. since there are always more bugs to find.

But the default clean tfs 1.4 is readily available on the otland github.
(I'd even suggest downloading 1.4.2 xP)


--
On topic,

And yes, it looks to be a source-edit-free release.
It should all be in the server files.
 
bug free? Probably impossible to find.. since there are always more bugs to find.

But the default clean tfs 1.4 is readily available on the otland github.
(I'd even suggest downloading 1.4.2 xP)


--
On topic,

And yes, it looks to be a source-edit-free release.
It should all be in the server files.

I am now using that clean 1.4 version, just added my datapack.
Looting now works, but for ALL NPCs that offers trading I will now get this error:

1680858384976.png

Here is my Gorn.lua:
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()        npcHandler:onThink()        end

local voices = { {text = 'General goods and paperware for sale!'} }
npcHandler:addModule(VoiceModule:new(voices))

local function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end
    if msgcontains(msg, "football") then
        npcHandler:say("Do you want to buy a football for 111 gold?", cid)
        npcHandler.topic[cid] = 1
    elseif msgcontains(msg, "yes") then
        if npcHandler.topic[cid] == 1 then
            local player = Player(cid)
            if player:getMoney() >= 111 then
                npcHandler:say("Here it is.", cid)
                player:addItem(2109, 1)
                player:removeMoneyNpc(111)
            else
                npcHandler:say("You don't have enough money.", cid)
            end
            npcHandler.topic[cid] = 0
        end
    end
    return true
end

-- Basic
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, text = "I am selling equipment of all kinds. Do you need anything?"})
keywordHandler:addKeyword({'king'}, StdModule.say, {npcHandler = npcHandler, text = "The king supports Tibia's economy a lot."})
keywordHandler:addAliasKeyword({'tibianus'})
keywordHandler:addKeyword({'magic'}, StdModule.say, {npcHandler = npcHandler, text = "Magic? Ask a sorcerer or druid about that."})
keywordHandler:addKeyword({'name'}, StdModule.say, {npcHandler = npcHandler, text = "I am Gorn. My goods are known all over Tibia."})
keywordHandler:addKeyword({'time'}, StdModule.say, {npcHandler = npcHandler, text = "It is exactly |TIME|. Maybe you want to buy a watch?"})
keywordHandler:addKeyword({'druids'}, StdModule.say, {npcHandler = npcHandler, text = "This druids are nice people, you will find them in the east of the town."})
keywordHandler:addKeyword({'knights'}, StdModule.say, {npcHandler = npcHandler, text = "Even the strong knights need my equipment on their travels though Tibia."})
keywordHandler:addKeyword({'sorcerers'}, StdModule.say, {npcHandler = npcHandler, text = "You can find him in the sorcerer guild."})
keywordHandler:addKeyword({'elane'}, StdModule.say, {npcHandler = npcHandler, text = "She's the leader of the paladin guild."})
keywordHandler:addKeyword({'baxter'}, StdModule.say, {npcHandler = npcHandler, text = "Old Baxter was a rowdy, once. In our youth we shared some adventures and women."})
keywordHandler:addKeyword({'bozo'}, StdModule.say, {npcHandler = npcHandler, text = "Bah! Go away with this bozoguy."})
keywordHandler:addKeyword({'frodo'}, StdModule.say, {npcHandler = npcHandler, text = "Frodo is a jolly fellow."})
keywordHandler:addKeyword({'ferumbras'}, StdModule.say, {npcHandler = npcHandler, text = "We had a clash or two in the old days."})
keywordHandler:addKeyword({'gregor'}, StdModule.say, {npcHandler = npcHandler, text = "Even the strong knights need my equipment on their travels though Tibia."})
keywordHandler:addKeyword({'lynda'}, StdModule.say, {npcHandler = npcHandler, text = "That's a pretty one."})
keywordHandler:addKeyword({'mcronald'}, StdModule.say, {npcHandler = npcHandler, text = "I hardly know the McRonalds."})
keywordHandler:addKeyword({'muriel'}, StdModule.say, {npcHandler = npcHandler, text = "You can find him in the sorcerer guild."})
keywordHandler:addKeyword({'oswald'}, StdModule.say, {npcHandler = npcHandler, text = "This Oswald has not enough to work and too much time to spread rumours."})
keywordHandler:addKeyword({'quentin'}, StdModule.say, {npcHandler = npcHandler, text = "He advices newcomers to buy at my store. I love that guy!"})
keywordHandler:addKeyword({'sam'}, StdModule.say, {npcHandler = npcHandler, text = "Strong as an ox, could armwrestle a minotaur, I bet."})
keywordHandler:addKeyword({'xodet'}, StdModule.say, {npcHandler = npcHandler, text = "He owns the magic shop here. But be aware: The prices are enormous."})


npcHandler:setMessage(MESSAGE_GREET, "Oh, please come in, |PLAYERNAME|. What do you need?")
npcHandler:setMessage(MESSAGE_FAREWELL, "Good bye.")
npcHandler:setMessage(MESSAGE_WALKAWAY, "Good bye.")
npcHandler:setMessage(MESSAGE_SENDTRADE, "Of course, just browse through my wares. {Footballs} have to be purchased separately.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

How can I get rid of that error message??
 
Back
Top