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

wild growth rune doesnt work.

Crystals

Member
Joined
Sep 28, 2024
Messages
58
Reaction score
10
Hi, I tried to fix the rune but no player can teach it. "You cannot use this object"


wild growth runes.lua:​

LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_WILDGROWTH)

local time = 40

local function countDown(cid, position, time)
    local player = Player(cid)
    if not player or time == 0 then
        return
    end
      
    player:say(time, TALKTYPE_MONSTER_SAY, false, 0, position)
    addEvent(countDown, 1000, cid, position, time - 1)
end

function onCastSpell(creature, variant, isHotkey)
    countDown(creature.uid, Variant.getPosition(variant), 40)
    return combat:execute(creature, variant)
end
 
Solution
I have the same TFS and same script and it works, maybe its your spells.xml

Mine is like this

LUA:
<rune group="support" name="Wild Growth" id="2269" allowfaruse="1" charges="2" lvl="27" maglv="8" exhaustion="2000" blocktype="all" script="support/wild growth rune.lua">
    </rune>
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_WILDGROWTH)

mwCountDownStart = function(position, seconds)
    local spectators = Game.getSpectators(position, false, true, 7, 7, 7, 7)
    if #spectators > 0 then
        for _, spectator in ipairs(spectators) do
            local animatedText = tostring(seconds)
            local colorIndex = math.random(1, 215)
            Game.sendAnimatedText(animatedText, position, colorIndex)
        end
    end
    if seconds > 0 then
        addEvent(mwCountDownStart, 1000, position, seconds - 1)
    end
end

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

This script is from TFS 1.3
 
I have the same TFS and same script and it works, maybe its your spells.xml

Mine is like this

LUA:
<rune group="support" name="Wild Growth" id="2269" allowfaruse="1" charges="2" lvl="27" maglv="8" exhaustion="2000" blocktype="all" script="support/wild growth rune.lua">
    </rune>
 
Solution
I have the same TFS and same script and it works, maybe its your spells.xml

Mine is like this

LUA:
<rune group="support" name="Wild Growth" id="2269" allowfaruse="1" charges="2" lvl="27" maglv="8" exhaustion="2000" blocktype="all" script="support/wild growth rune.lua">
    </rune>
Works! I had a spell added but no rune added there. I missed it :D Thank you!

Solved
Post automatically merged:

I have the same TFS and same script and it works, maybe its your spells.xml

Mine is like this

LUA:
<rune group="support" name="Wild Growth" id="2269" allowfaruse="1" charges="2" lvl="27" maglv="8" exhaustion="2000" blocktype="all" script="support/wild growth rune.lua">
    </rune>
One more question, does it also show you on the wall how much time is left until the end (timer)? I want to remove it
 
Last edited:
Here is the script without the timer

LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_WILDGROWTH)

local time = 40000 -- 40 segundos em milissegundos

local function removeItem(position)
    local tile = Tile(position)
    if tile then
        local item = tile:getItemById(ITEM_WILDGROWTH)
        if item then
            item:remove()
        end
    end
end

function onCastSpell(creature, variant, isHotkey)
    local position = Variant.getPosition(variant)
    addEvent(removeItem, time, position)
    return combat:execute(creature, variant)
end

It can work without the localtime but u would need to change item.xml to decay, since i dont know how u have it i made like this so it removes the wall after 40 seconds
 

Similar threads

Back
Top