husam
Member
So, I found a manarune in here that i liked, but i want it to be for all vocations like when a mage uses it, he gets XX mana depending on his ml/lvl . If it's a paladin he would get health and mana and if hes a knight he would get mana only. depending on mlvl/lvl.
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) then
local lvl, mag = getPlayerLevel(cid), getPlayerMagLevel(cid)
local min = lvl * 2.4 + mag * 3.3
local max = lvl * 2.7 + mag * 4.5
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