• 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+ No loot from monsters / Spells not working

dnmk

New Member
Joined
Jan 9, 2017
Messages
14
Reaction score
1
Hi there. I am seeking for help with my loot and spells situation, and as I dont want to make another topic, im gonna split this into 2 problems I have.
I am working on TFS 1.5 Nekiro downgrade 8.6, and with Emporia Vapus datapack which was originally for 0.4, but i wanted to switch for a newer version.
Most of problems solved but about this i realised after finally getting it all up on Ubuntu.
Problem 1
Monsters doesnt drop loot at all. Every monster is just "nothing". I tried on a clean account without any access, also tried with different vocations.xml file as i've searched that it might be the problem. Where to look for?
Here is my monster.lua:
Lua:
function Monster:onDropLoot(corpse)
    if hasEventCallback(EVENT_CALLBACK_ONDROPLOOT) then
        EventCallback(EVENT_CALLBACK_ONDROPLOOT, self, corpse)
    end
end

function Monster:onSpawn(position, startup, artificial)
    if hasEventCallback(EVENT_CALLBACK_ONSPAWN) then
        return EventCallback(EVENT_CALLBACK_ONSPAWN, self, position, startup, artificial)
    else
        return true
    end
end

And here is a rotworm for example:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Rotworm" nameDescription="a rotworm" race="blood" experience="40" speed="116" manacost="305">
    <health now="65" max="65"/>
    <look type="26" corpse="5967"/>
    <targetchange interval="2000" chance="0"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="0"/>
        <flag convinceable="1"/>
        <flag pushable="0"/>
        <flag canpushitems="0"/>
        <flag canpushcreatures="0"/>
        <flag targetdistance="1"/>
        <flag staticattack="90"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" skill="30" attack="20"/>
    </attacks>
    <defenses armor="8" defense="11"/>
    <loot>
    <item id="10608" chance="10750" /> <!-- lump of dirt -->
    <item id="2666" chance="20825" /> <!-- meat -->
    <item id="2148" countmax="17" chance="24350" /> <!-- gold coin -->
    <item id="2671" chance="20575" /> <!-- ham -->
    <item id="1987" chance="100000"> <!-- bag -->
        <inside>
            <item id="3976" countmax="3" chance="2250" /> <!-- worm -->
            <item id="2376" chance="3675" /> <!-- sword -->
            <item id="2398" chance="4650" /> <!-- mace -->
        </inside>
    </item>
    </loot>
</monster>

Problem 2
Spells not working. They are taking mana, giving magic level, but no healing nor any damage.
Here is exura from spells.xml:
Code:
    <instant group="healing" name="Light Healing" words="exura" level="8" mana="20" aggressive="0" selftarget="1" cooldown="1000" needlearn="0" script="healing/light_healing.lua">
        <vocation name="Sorcerer" />
        <vocation name="Druid" />
        <vocation name="Paladin" />
        <vocation name="Master Sorcerer" />
        <vocation name="Elder Druid" />
        <vocation name="Royal Paladin" />
    </instant>

And here is the light_healing.lua:

Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 1.4) + 8
    local max = (level / 5) + (magicLevel * 1.8) + 11
    return min, max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end

Any help is appreciated!
 
function Monster:eek:nDropLoot(corpse) if hasEventCallback(EVENT_CALLBACK_ONDROPLOOT) then EventCallback(EVENT_CALLBACK_ONDROPLOOT, self, corpse) end end function Monster:eek:nSpawn(position, startup, artificial) if hasEventCallback(EVENT_CALLBACK_ONSPAWN) then return EventCallback(EVENT_CALLBACK_ONSPAWN, self, position, startup, artificial) else return true end en
try this

Monster.lua
Lua:
function Monster:onDropLoot(corpse)
    local onDropLoot = EventCallback.onDropLoot
    if onDropLoot then
        onDropLoot(self, corpse)
    end
end

function Monster:onSpawn(position, startup, artificial)
    local onSpawn = EventCallback.onSpawn
    if onSpawn then
        return onSpawn(self, position, startup, artificial)
    end
    return true
end

<loot> <item id="10608" chance="10750" /> <!-- lump of dirt --> <item id="2666" chance="20825" /> <!-- meat --> <item id="2148" countmax="17" chance="24350" /> <!-- gold coin --> <item id="2671" chance="20575" /> <!-- ham --> <item id="1987" chance="100000"> <!-- bag --> <inside> <item id="3976" countmax="3" chance="2250" /> <!-- worm --> <item id="2376" chance="3675" /> <!-- sword --> <item id="2398" chance="4650" /> <!-- mace --> </inside> </item> </loot>
to replace
XML:
<loot>
        <item id="2148" name="gold coin" chance="71834" countmax="17" />
        <item id="2671" name="ham" chance="20104" />
        <item id="2666" name="meat" chance="20006" />
        <item id="10609" name="lump of dirt" chance="10004" />
        <item id="2398" name="mace" chance="4441" />
        <item id="3976" name="worm" chance="3057" countmax="3" />
        <item id="2376" name="sword" chance="3047" />
    </loot>

If there are any errors, try using the full code provided here.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Rotworm" nameDescription="a rotworm" race="blood" experience="40" speed="116" manacost="305">
    <health now="65" max="65" />
    <look type="26" corpse="5967" />
    <targetchange interval="4000" chance="0" />
    <flags>
        <flag summonable="0" />
        <flag attackable="1" />
        <flag hostile="1" />
        <flag illusionable="0" />
        <flag convinceable="1" />
        <flag pushable="0" />
        <flag canpushitems="0" />
        <flag canpushcreatures="0" />
        <flag targetdistance="1" />
        <flag staticattack="70" />
        <flag runonhealth="0" />
        <flag canwalkonenergy="0" />
        <flag canwalkonfire="0" />
        <flag canwalkonpoison="0" />
    </flags>
    <attacks>
        <attack name="melee" interval="2000" min="0" max="-40" />
    </attacks>
    <defenses armor="8" defense="8" />
    <loot>
        <item id="2148" name="gold coin" chance="71834" countmax="17" />
        <item id="2671" name="ham" chance="20104" />
        <item id="2666" name="meat" chance="20006" />
        <item id="10609" name="lump of dirt" chance="10004" />
        <item id="2398" name="mace" chance="4441" />
        <item id="3976" name="worm" chance="3057" countmax="3" />
        <item id="2376" name="sword" chance="3047" />
    </loot>
</monster>
 
try this

Monster.lua
Lua:
function Monster:onDropLoot(corpse)
    local onDropLoot = EventCallback.onDropLoot
    if onDropLoot then
        onDropLoot(self, corpse)
    end
end

function Monster:onSpawn(position, startup, artificial)
    local onSpawn = EventCallback.onSpawn
    if onSpawn then
        return onSpawn(self, position, startup, artificial)
    end
    return true
end


to replace
XML:
<loot>
        <item id="2148" name="gold coin" chance="71834" countmax="17" />
        <item id="2671" name="ham" chance="20104" />
        <item id="2666" name="meat" chance="20006" />
        <item id="10609" name="lump of dirt" chance="10004" />
        <item id="2398" name="mace" chance="4441" />
        <item id="3976" name="worm" chance="3057" countmax="3" />
        <item id="2376" name="sword" chance="3047" />
    </loot>

If there are any errors, try using the full code provided here.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Rotworm" nameDescription="a rotworm" race="blood" experience="40" speed="116" manacost="305">
    <health now="65" max="65" />
    <look type="26" corpse="5967" />
    <targetchange interval="4000" chance="0" />
    <flags>
        <flag summonable="0" />
        <flag attackable="1" />
        <flag hostile="1" />
        <flag illusionable="0" />
        <flag convinceable="1" />
        <flag pushable="0" />
        <flag canpushitems="0" />
        <flag canpushcreatures="0" />
        <flag targetdistance="1" />
        <flag staticattack="70" />
        <flag runonhealth="0" />
        <flag canwalkonenergy="0" />
        <flag canwalkonfire="0" />
        <flag canwalkonpoison="0" />
    </flags>
    <attacks>
        <attack name="melee" interval="2000" min="0" max="-40" />
    </attacks>
    <defenses armor="8" defense="8" />
    <loot>
        <item id="2148" name="gold coin" chance="71834" countmax="17" />
        <item id="2671" name="ham" chance="20104" />
        <item id="2666" name="meat" chance="20006" />
        <item id="10609" name="lump of dirt" chance="10004" />
        <item id="2398" name="mace" chance="4441" />
        <item id="3976" name="worm" chance="3057" countmax="3" />
        <item id="2376" name="sword" chance="3047" />
    </loot>
</monster>
Tried this, still not working.

I did some troubleshooting and switched the data pack to a different one, and the spells and monsters was working fine so its not related to the engine itself. Then I switched to my datapack, and only put the spells and monsters folder from the other data, but that did not worked too.

So if it isnt spells and monsters folder problem, where to look next?
 
Try downloading TFS 1.5 from MovieBr or Rake here. It is active and up to date! Just download and compile, then test without modifying to see if the monster and spell functions are working. Then you can add one by one etc.

or

 
Back
Top