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

Lua UH Trap tfs 1.5 lua

Diarreamental

Banned User
Joined
Jul 6, 2015
Messages
463
Solutions
1
Reaction score
85
Hello can somebody make me a uh trap rune in lua please? for tfs 1.5

i've tried this
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(player, level, magicLevel)
    local base = 250
    local variation = 0

    local min = math.max((base - variation), ((3 * magicLevel + 2 * level) * (base - variation) / 100))
    local max = math.max((base + variation), ((3 * magicLevel + 2 * level) * (base + variation) / 100))

    return min, max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

     function onCastSpell(cid, var)
local position = Variant.getPosition(var)
    local tile = Tile(position)
    if tile then
        local bottomCreature = tile:getBottomCreature()
        if bottomCreature then
            --return combat:execute(bottomCreature, var)
            return doCombat(bottomCreature, combat, var)
    end
        end
   -- end

  if target:isMonster() then
     --creature:sendCancelMessage("You can only use this rune on creatures.")
     player:sendCancelMessage(RETURNVALUE_NOTPOSSIBLE)
    player:getPosition():sendMagicEffect(CONST_ME_POFF)
end
    return
end
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(player, level, magicLevel)
    local base = 250
    local variation = 0

    local min = math.max((base - variation), ((3 * magicLevel + 2 * level) * (base - variation) / 100))
    local max = math.max((base + variation), ((3 * magicLevel + 2 * level) * (base + variation) / 100))

    return min, max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
if Tile(var:getPosition()):getTopCreature() then
        return combat:execute(creature, var)
    end

    creature:sendCancelMessage("You can only use this rune on creatures.")
    creature:getPosition():sendMagicEffect(CONST_ME_POFF)
endz


CLEAN
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(player, level, magicLevel)
    local base = 250
    local variation = 0

    local min = math.max((base - variation), ((3 * magicLevel + 2 * level) * (base - variation) / 100))
    local max = math.max((base + variation), ((3 * magicLevel + 2 * level) * (base + variation) / 100))

    return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
 
Back
Top