husam
Member
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
local lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid)
local min = lvl * 2 + mag * 3
local max = lvl * 2.5 + mag * 4
local rand = math.random(min, max)
doPlayerAddMana(itemEx.uid, rand)
doCreatureAddHealth(itemEx.uid, rand)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
else
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You can only use this rune on players.")
end
return true
end