Bom, tente desta maneira meu jovem:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
function onCastSpell(cid, var)
min, max = nil
local lvl = {
[{10, 50}] = {min = 100, max = 300},
[{51, 100}] = {min = 300, max = 500},
[{101, 150}] = {min = 500, max = 700},
[{151, 200}] = {min = 700, max = 1000},
[{200, 250}] = {min = 1000, max = 1200},
[{251, 300}] = {min = 1200, max = 1500},
[{351, 400}] = {min = 1500, max = 1700},
}
for level, mana in pairs(lvl) do
if (getPlayerLevel(cid) >= level[1]) and (getPlayerLevel(cid) < level[2]) then
min, max, hp = mana.min, mana.max, {min, max}
doCreatureAddMana(cid, hp[math.random(#hp)])
else
doPlayerSendCancel(cid, "You cannot use this object.")
return true
end
end
return doCombat(cid, combat, var)
end





info
Grupo: Campones
Registrado: 30/09/13
Posts: 16
Reputação: 0
Nessa magia eu queria que recuperasse por stages exemplo, do level 10 até level 50 recopera 100-300 de mana e do level 51 até 100 300-500 de mana
e assim por diante.
Editado Outubro 4 por DuvidasOt