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

Get skill within a Spell

Raikou

Well-Known Member
Joined
Jul 18, 2007
Messages
145
Solutions
2
Reaction score
54
Hello all,

I got a very basic problem/annoyance.
Within a spell I want to get the players skill lvl.
I tried several variations of something like below but i keep getting nill/nothing.
Lua:
function onCastSpell(creature, var, player) -- seems i cant get player here?
    local skill = player:getSkillLevel(SKILL_DISTANCE)
    print (skill)
 -- ... more stuff not important ...
end
of course this does nothing, i just want to get the skill level of the casting player within onCastSpell, not outside in the sneaky "onGetFormulaValues".
 
Creature is the player, when the player is the caster. :rolleyes:
Huh, i tried that before and got nill.

But you are right:
Lua:
function onCastSpell(creature, var)
    local skill = creature:getSkillLevel(SKILL_DISTANCE)
    print (skill)
end

-- result 31
Weird, but I guess it works out :D
Post automatically merged:

Mhmm, now i do have another thing.
Does the tfs not work with decimals?
I tried to do some duration based on skill.
So the result could be 2000 base + (skill*10) = 2310 (2.31 seconds)
but than tibia doesn't really deal well with that.
 
Last edited:
Mhmm, now i do have another thing.
Does the tfs not work with decimals?
I tried to do some duration based on skill.
So the result could be 2000 base + (skill*10) = 2310 (2.31 seconds)
but than tibia doesn't really deal well with that.
Attribute duration is based off milliseconds, so you should be able to increase it like you showed there.
 
Back
Top