bpm91
Advanced OT User
- Joined
- May 23, 2019
- Messages
- 1,046
- Solutions
- 7
- Reaction score
- 180
- Location
- Brazil
- YouTube
- caruniawikibr
Good night, I have an old school version, and my monsters don't take rune damage when they're invisible. I tried to build a script but it didn't work, I need the function to release the rune in order to hit an invisible monster - TFS 0.4
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(creature, variant, isHotkey)
local tile = Tile(Variant.getPosition(variant))
if tile and tile:getTopCreature() then
return combat:execute(creature, var)
end
creature:sendCancelMessage("You can only use this rune on creatures.")
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end

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(creature, variant, isHotkey)
local tile = Tile(Variant.getPosition(variant))
if tile and tile:getTopCreature() then
return combat:execute(creature, var)
end
creature:sendCancelMessage("You can only use this rune on creatures.")
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
return false
end