• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 1.X+ Spell range does not work

johnsamir

Advanced OT User
Joined
Oct 13, 2009
Messages
1,134
Solutions
5
Reaction score
219
Location
Nowhere
Hello Community

As title says, spell range declared in spells.xml does not work in tfs 1.3. what can be wrong? this occurs with every spell, like for example:
LUA:
<instant group="attack" spellid="88" name="Energy Strike" words="exori vis" level="12" mana="20" premium="1" range="3" casterTargetOrDirection="1" blockwalls="1" cooldown="2000" groupcooldown="2000" needlearn="0" script="attack/energy_strike.lua">
        <vocation name="Sorcerer" />
        <vocation name="Druid" />
        <vocation name="Master Sorcerer" />
        <vocation name="Elder Druid" />
    </instant>
it says range 3 and in fact players can shoot from anywhere
 
can u show me the lua script of the spell
Hello. yes here it's
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

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

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

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

Working perfect for me
are u using latest tfs?
forgot to mention, i'm using tfs 1.3 8.6 downgraded by nekiro
is there a way to declare the range in lua @Levi999x ?

Deciphered that the source lines related to range and other codes lines were removed, i don't know the reason, however replaced the files and this was solved.
 
Last edited:
Solution
Back
Top