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

Special manarune for paladins

zxzxzx

New Member
Joined
Mar 12, 2011
Messages
334
Reaction score
3
Hello!

I need manarune script that gives mana AND HP based on calculate method like this one:

" template = {min = (((playerinfo.level * 4) + (playerinfo.mlevel * 10)) + 0.0) , max =(((playerinfo.level * 5) + (playerinfo.mlevel * 10)) + 0.0)},"

and this manarune needs to be use only for paladins and royal paladins.

Please help! rep++
 
yes, if you need a value that you have to call a function to return more than once, its good practice to store it temporarily and use the stored value rather than recalling the functions multiple times
now, in the end it doesnt really impact performance because its so little, but good practice still

i think you forgot to change SKILL_MAGLEVEL to mlevel also
 
Hm, Idk anymore tbh, but it was probably because I had a space between 3, and 7. so I had it like this:
Code:
if isInArray({3, 7}, player:getVocation():getId()) then
 
that doesnt matter
Idk then.
i think you forgot to change SKILL_MAGLEVEL to mlevel also
Ah.. I saw another script on Otland using SKILL_MAGLEVEL so I thought it just worked.
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 2000))

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local getvocid = player:getVocation():getId()
    local level = player:getLevel()
    local mlevel = player:getMagicLevel()
    local hpandma_minimum = (level * 4) + (mlevel * 10)
    local hpandma_maximum = (level * 5) + (mlevel * 10)
 
    if getvocid == 3 or getvocid == 7 then
        player:addMana(math.random(hpandma_minimum, hpandma_maximum))
        player:addHealth(math.random(hpandma_minimum, hpandma_maximum))
        player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS)
    else
        player:sendCancelMessage("This rune is not usable for your vocation.")
    end
    return true
end
 
Last edited by a moderator:
Hay I make that what I need.. simple, I edit ultimate healing rune and added mana healing xD

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, 0)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(player, level, maglevel)
    local min = (level * 13) + (maglevel * 100) + 100
    local max = (level * 15) + (maglevel * 200) + 100
    local heal = math.floor(math.random(min, max))
    local mana = math.floor(math.random(min, max))
    player:say("+ "..heal.." hp & 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

now I don't need to edit my config.lua to make exhausted 1 sec for this rune. :)
 
Back
Top