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

Can someone help me set the timing for the magic wall rune and the wild growth rune? It's for TFS 0.3.6 version 8.60

Xanadu123

Member
Joined
May 11, 2014
Messages
46
Reaction score
5
Can someone help me set the timing for the magic wall rune and the wild growth rune? It's for TFS 0.3.6 version 8.60
 

Attachments

  • IMG_20260402_112951.webp
    IMG_20260402_112951.webp
    88.8 KB · Views: 40 · VirusTotal
Solution
If you only want to change how long they stay:
items.xml
XML:
<item id="1497" article="a" name="magic wall">
    <attribute key="type" value="magicfield" />
    <attribute key="decayTo" value="0" />
    <attribute key="duration" value="20" />
</item>

<item id="1499" article="a" name="rush wood">
    <attribute key="type" value="magicfield" />
    <attribute key="decayTo" value="0" />
    <attribute key="duration" value="45" />
</item>

If you want the yellow countdown numbers on top too, thats not default.
Use animated text in the rune scripts.

Code:
data/spells/scripts/support/magic wall rune.lua
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat...
If you only want to change how long they stay:
items.xml
XML:
<item id="1497" article="a" name="magic wall">
    <attribute key="type" value="magicfield" />
    <attribute key="decayTo" value="0" />
    <attribute key="duration" value="20" />
</item>

<item id="1499" article="a" name="rush wood">
    <attribute key="type" value="magicfield" />
    <attribute key="decayTo" value="0" />
    <attribute key="duration" value="45" />
</item>

If you want the yellow countdown numbers on top too, thats not default.
Use animated text in the rune scripts.

Code:
data/spells/scripts/support/magic wall rune.lua
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497)

local function mwallTimer(pos, seconds)
    local field = getTileItemById(pos, 1497)
    if field.uid > 0 then
        doSendAnimatedText(pos, tostring(seconds), COLOR_YELLOW)
        if seconds > 1 then
            addEvent(mwallTimer, 1000, pos, seconds - 1)
        end
    end
end

function onCastSpell(cid, var)
    local ret = doCombat(cid, combat, var)
    if ret then
        local pos = variantToPosition(var)
        mwallTimer(pos, 20)
    end
    return ret
end

Code:
data/spells/scripts/support/wild growth rune.lua
LUA:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)
setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1499)

local function wgTimer(pos, seconds)
    local field = getTileItemById(pos, 1499)
    if field.uid > 0 then
        doSendAnimatedText(pos, tostring(seconds), COLOR_YELLOW)
        if seconds > 1 then
            addEvent(wgTimer, 1000, pos, seconds - 1)
        end
    end
end

function onCastSpell(cid, var)
    local ret = doCombat(cid, combat, var)
    if ret then
        local pos = variantToPosition(var)
        wgTimer(pos, 45)
    end
    return ret
end

If you change the duration in items.xml, change the timer numbers in the scripts too, otherwise the text and the real wall time wont match.
 
Solution
Back
Top