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

Mana rune problem.

Nofus

New Member
Joined
Jul 16, 2009
Messages
415
Reaction score
1
Hey guys i've got a pro mana rune but when i heals, the amount of healing doesnt change because of what your mana level is, It heals 1500 all the time, even if you're lvl 1 or lvl 900. I want it to heal because of what Magic level you have. Here is the lua

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN) ---- what the color of the effect. you can do like RED/BLUE
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function onCastSpell(cid, var)
doPlayerAddMana(cid, 1500) ---- how much it heal .
return doCombat(cid, combat, var)
end


and here it is in the spells.xml

<rune name="Pro Mana Rune" id="2284" allowfaruse="1" charges="5" lvl="100" exhaustion="800" maglv="15" aggressive="0" needtarget="1" blocktype="solid" script="promanarune.lua"/

So please help me people, How do I do :) Explain detailed and please with an example. Thank you.
 
Code:
doPlayerAddMana(cid, 1500) ---- how much it heal .

becouse you dont have option math.random

or local config MIN and MAX.

You still need help? If you dont know how to make it post here.

@edit

Try this :
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function getCombatFormulas(cid, level, magicLevel)
local min = (level * 1) + (mlevel * 4) * 2.5
local max = (level * 1) + (mlevel * 4) * 3.0	
local mana_add = math.random(min, max)
	if min < 350 then
		min = 350
	end
	return min, max
end

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

@edit
Now ?
 
Last edited:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

function getCombatFormulas(cid, level, magicLevel)
local min = (level * 1) + (mlevel * 4) * 2.5
local max = (level * 1) + (mlevel * 4) * 3.0
local mana_add = math.random(min, max)
if min < 350 then
min = 350
end
return min, max
end

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

If i copy this in the .lua it will work? it will heal by what magic lvl u have?
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)

function onCastSpell(cid, var)
	local lvl, mlvl = getPlayerLevel(cid), getPlayerMagLevel(cid)

	local min = (lvl * 1 + mlvl * 4) * 2.5
	local max = (lvl * 1 + mlvl * 4) * 3.0

	doPlayerAddMana(cid, math.random(math.max(350, min), max))
	return doCombat(cid, combat, var)
end
 
Back
Top