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

Lua HELP ERROR TFS 1.4 ACTION MANA RUNE

VagosClubTM

Active Member
Joined
Aug 16, 2019
Messages
219
Reaction score
32
Location
Chile
Hi friends, I have this mana rune script, I need it to be used in the protection zone and that it cannot be used in another user since when using it in another user it takes out a white skull as if you were attacking, it would be of great help thanks . I'll leave the code here

Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local level = player:getLevel()
    local magLevel = player:getMagicLevel()
    local min = (level * 5) + (magLevel * 3) - 50
    local max = (level * 6) + (magLevel * 4)
    player:addMana(math.random(min, max))
    item:remove(1)
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:say("Haaaa...", TALKTYPE_MONSTER_SAY)
    return true
end

or if it is possible to transform it to revscript it would be much better in advance, thank you very much to those who take the time to help, thank you very much.
 
Lua:
local manarune = Action()

function manarune.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local playerPosition = player:getPosition()
    if playerPosition ~= toPosition then
        playerPosition:sendMagicEffect(CONST_ME_POFF)
        return false
    end
    if not Tile(playerPosition):hasFlag(TILESTATE_PROTECTIONZONE) then
        playerPosition:sendMagicEffect(CONST_ME_POFF)
        return false
    end
    local level = player:getLevel()
    local magLevel = player:getMagicLevel()
    local min = (level * 5) + (magLevel * 3) - 50
    local max = (level * 6) + (magLevel * 4)
    player:addMana(math.ceil(math.random(min, max)))
    playerPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:say("Haaaa...", TALKTYPE_MONSTER_SAY)
    item:remove(1)
    return true
end

manarune:id(2298)
manarune:register()
 
Lua:
local manarune = Action()

function manarune.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local playerPosition = player:getPosition()
    if playerPosition ~= toPosition then
        playerPosition:sendMagicEffect(CONST_ME_POFF)
        return false
    end
    if not Tile(playerPosition):hasFlag(TILESTATE_PROTECTIONZONE) then
        playerPosition:sendMagicEffect(CONST_ME_POFF)
        return false
    end
    local level = player:getLevel()
    local magLevel = player:getMagicLevel()
    local min = (level * 5) + (magLevel * 3) - 50
    local max = (level * 6) + (magLevel * 4)
    player:addMana(math.ceil(math.random(min, max)))
    playerPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:say("Haaaa...", TALKTYPE_MONSTER_SAY)
    item:remove(1)
    return true
end

manarune:id(2298)
manarune:register()
Hi bro, it works but it doesn't regenerate life and the stones that were 100 shots now only last 1, what can be done in that case?
 
Mana runes don't normally heal health?
Runes disappear as intended.
Mana is healed..

I don't know what to say

View attachment 64452
yes bro sorry is that I made the wrong script, it was this that I will publish here, and if I know that the mana rune do not carry life but this if it does, I will leave you the code that I wanted to modify so that it could be used in the PROTECTION ZONE and on top of other users without drawing red skull sorry for my confusion

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
 
function onGetFormulaValues(player, level, maglevel)
    local min = (level * 2) + (maglevel * 7) + 100
    local max = (level * 3) + (maglevel * 7) + 100
    local minn = (level * 5) + (maglevel * 2) + 100
    local maxx = (level * 5) + (maglevel * 3) + 100
    local heal = math.floor(math.random(min, max))
    local mana = math.floor(math.random(minn, maxx))
    player:say("+ "..heal.." heal", TALKTYPE_ORANGE_1)
    player:say("+ "..mana.." mana", TALKTYPE_ORANGE_1)
    player:addHealth(heal)
    player:addMana(mana)
    return
end
 
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
 
function onCastSpell(creature, var, isHotkey)
    return combat:execute(creature, var)
end
 
si hermano perdon es que hice el script equivocado, es esto que publicare aqui, y si se que la runa mana no lleva vida pero esta si la tiene te dejo el codigo que quise modificar asi que podría usarse en la ZONA DE PROTECCIÓN y encima de otros usuarios sin dibujar una calavera roja perdón por mi confusión

[CÓDIGO = lua] combate local = Combate ()
combate: setParameter (COMBAT_PARAM_TYPE, COMBAT_HEALING)
combate: setParameter (COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combate: setParameter (COMBAT_PARAM_AGGRESSIVE, 0)
combate: setParameter (COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
combate: setParameter (COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

función onGetFormulaValues (jugador, nivel, maglevel)
local mínimo = (nivel * 2) + (maglevel * 7) + 100
local max = (nivel * 3) + (maglevel * 7) + 100
minn local = (nivel * 5) + (maglevel * 2) + 100
local maxx = (nivel * 5) + (maglevel * 3) + 100
curación local = math.floor (math.random (min, max))
maná local = math.floor (math.random (minn, maxx))
jugador: decir ("+" ... curar ... "curar", TALKTYPE_ORANGE_1)
jugador: decir ("+" ..mana .. "mana", TALKTYPE_ORANGE_1)
jugador: addHealth (curar)
jugador: addMana (mana)
regreso
fin

combate: setCallback (CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

función enCastSpell (criatura, var, isHotkey)
volver al combate: ejecutar (criatura, var)
fin [/ CODE]

Mana runes don't normally recover health?
Runes disappear as intended.
Manarune is recovering mana..

I don't know what to say

View attachment 64452

Hi bro, I already managed to not get a white skull when used on top of another user, do you think you can help me to make it work in the protection zone?


Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
 
function onGetFormulaValues(player, level, maglevel)
    local min = (level * 2) + (maglevel * 7) + 100
    local max = (level * 3) + (maglevel * 7) + 100
    local minn = (level * 5) + (maglevel * 2) + 100
    local maxx = (level * 5) + (maglevel * 3) + 100
    local heal = math.floor(math.random(min, max))
    local mana = math.floor(math.random(minn, maxx))
    player:say("+ "..heal.." heal", TALKTYPE_ORANGE_1)
    player:say("+ "..mana.." mana", TALKTYPE_ORANGE_1)
    player:addHealth(heal)
    player:addMana(mana)
    return
end
 
combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
 
function onCastSpell(creature, var, isHotkey)
    return combat:execute(creature, var)
end
 
Back
Top