Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
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!
MonsterSpell is an class that was only designed to add spells to MonsterTypes.
It is recommended that these classes and methods be used only once at server startup or reload system.
Keep in mind that if your code looks like this:
Lua:
local ec = EventCallback
function ec.onSpawn(monster, position, startup, artificial)
if monster:getName() == "Rotworm" then
local spell = MonsterSpell()
-- ...
monster:getType():addAttack(spell)
end
return true
end
ec:register(--[[-1]])
then this will not work, since you would be adding 1 spell for each rotworm spawned and the end result would be rotworms with n spells of the same type
MonsterType affects all monsters of the same type!
Based on the above explanation, a possible work-around would be creating 1 spell that holds multiple spells inside of it, which are separated out based on a storage value.
You give the storage value to the monster via onSpawn, and it would then trigger only that 'spell' inside of the multi-spell, since each spell would be based on the storage of that particular monster.
Hello there! It's possible to bring back add/setStorage and getStorage into monsters? Anyone knows how to add storage to monster in TFS 1.X, since tfs-devs removed it?