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

Function Rune

bpm91

Advanced OT User
Joined
May 23, 2019
Messages
1,046
Solutions
7
Reaction score
180
Location
Brazil
YouTube
caruniawikibr
Hello, I would like to know if it is possible to make the rune have an area function to be hit only on monsters and players. (normal rune), without being wasted on the floor, because I would like my rune to hit invisible monsters = tibia old school. i used tfs 0.4
example (if it doesn't hit the correct sqm = send me poff)


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(cid, level, maglevel)
min = (level * 1.5 + maglevel * 2.0) * 2
max = (level * 1.8 + maglevel * 2.0) * 2

if min < 250 then
min = 250
end

return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")


function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
 
Just add this, to the rune line in spells.xml
XML:
needtarget="1" blocktype="solid"
 
@Mustafa1337 Already, but I can not hit invisible monsters
this is something I've been trying to fix since I started messing with tibia, but I could never fix it = /
I'm assuming the current script above works on invisible monsters already, but if there isn't any monster, it simply hits the floor and 'wastes' correct?

If yes, then use 'getSpectators' to confirm if a creature in on the tile.

pseudo code -- so you know what I mean
LUA:
function onCastSpell()
    local spectators = getSpectators
    if spectators == nil then
        return false
    end
    return doCombat
end
 
function onCastSpell()
local spectators = getSpectators
if spectators == nil then
return false
end
return doCombat
end
maybe need to add var, or combat?
 
@Xikini
u can transform this script to my version?


I tried many times but I was unsuccessful
 
Back
Top