local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, 1)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
function onCastSpell(cid, var)
local min_value = 200
local max_value = 500
mana = math.random(min_value, max_value)
doPlayerAddMana(cid, mana)
doPlayerSay(cid, "Aaaah...", 1)
return doCombat(cid, combat, var)
end
<rune name="WHATEVER HERE" id="2298" maglv="4" needtarget="1" aggressive="0" allowfaruse="1" charges="5" script="manarune.lua">
</rune>
function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)
if mag >= 1 then
doSendMagicEffect(topos,1)
doPlayerSay(cid,"Ahhhh....",16)
doPlayerAddMana(cid, 250)
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end
else
doSendMagicEffect(frompos,2)
doPlayerSendCancel(cid,"VocÊ não tem ML requerido para usar esta mana.")
end
return 1
end
if item.type > 1 then
doChangeTypeItem(item.uid,item.type-1)
else
doRemoveItem(item.uid,1)
end