• 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 Mana rune not giving right mana

ziggy46802

Active Member
Joined
Aug 19, 2012
Messages
418
Reaction score
27
Here is the /data/spells/healing/mana rune.lua script

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)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(cid)
	local min = doPlayerAddMana(cid, 25) 
	local max = doPlayerAddMana(cid, 100)
	return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

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

It always heals me for 1 and gives me 125 mana. Do mana runes HAVE to be action scripts so they cant be conjured???
 
LUA:
function onGetFormulaValues(cid)
	return 25, 125
end
not conjurable unless you add it as conjure in spells.xml:p:p
 
Now it is always giving me 200 mana (I changed min to 50 max 150 so it must be adding them) and it is giving me 50-150 HEALTH instead of mana, how do you make it so it gives you mana instead of health?
 
LUA:
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)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(cid)
	return doPlayerAddHealth(cid, math.random(50,150))
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
Thanks Acubens, but I replaced this line

Code:
return doPlayerAddHealth(cid, math.random(50,150))

with this

Code:
return doPlayerAddMana(cid, math.random(50,150))

And it is fully working now, awesome!
 
Back
Top