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

Dkadsfe

Member
Joined
Apr 1, 2016
Messages
280
Reaction score
22
Hi I am trying to make this heal in mana but it keeps healing in health how do I fix this? and there is no errors in console
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
function onGetFormulaValues(cid, level, maglevel)
    local min = (getCreatureMana(cid) / 100) * 20
    local max = (getCreatureMana(cid) / 100) * 30
    return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)   
    return doCombat(cid, combat, var)
end
 
This script and a manarune is like wanting a chair to become a car xD
"how do I fix this?"
you don't fix it, it's nowhere close to a manarune. I'd suggest learning the basics of lua first and I'm sure there are tons of manarune scripts available, don't be lazy
 
This script and a manarune is like wanting a chair to become a car xD
"how do I fix this?"
you don't fix it, it's nowhere close to a manarune. I'd suggest learning the basics of lua first and I'm sure there are tons of manarune scripts available, don't be lazy
I looked around 10ish of them but none of them work in percentages :( and I don't have time to learn lua
 
" I don't have time to learn lua"
So how the hell do you want to create your server? Do you think that people will do stuff for you for free because you "don't have time to learn lua"? lol
" but none of them work in percentages " - it wouldn't even be about lua, but about simple math ...
 
" I don't have time to learn lua"
So how the hell do you want to create your server? Do you think that people will do stuff for you for free because you "don't have time to learn lua"? lol
" but none of them work in percentages " - it wouldn't even be about lua, but about simple math ...
I am not creating a server I am playing around with my server
 
try change
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
for
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
 
Hi I am trying to make this heal in mana but it keeps healing in health how do I fix this? and there is no errors in console
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
function onGetFormulaValues(cid, level, maglevel)
    local min = (getCreatureMana(cid) / 100) * 20
    local max = (getCreatureMana(cid) / 100) * 30
    return min, max
end
setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
Something tells me you copy pasted this script.

Either way, you need to change getCreatureMana to getCreatureMaxMana unless you wanna heal a certain percent of the remaining mana
 
Last edited:
I am not creating a server I am playing around with my server
"I need scripters for my ot and to balance monsters on my ot
I also need mappers to create better maps for me!"

ok
"playing around with my server"
seems like you're trying to get people to just help you create an ot for free without you having to do anything at all
same
 
you can use manadrain condition with negative mana value afaik, but i dont see why you would use a combat script

i personally would use a generic onUse script, which adds hp/mana, says how much and plays an effect
that way you can just have a large table of all available runes/potions and easily change them all
 
Back
Top