Hello guys
Shuld need some help with a script
Can you make this script but like a spirit potion
Repp++
Shuld need some help with a script
Can you make this script but like a spirit potion
PHP:
local runes = {
[2270] = {
voc = {4, 8, 12},
min = 'level * 4 + maglv * 2 - 3',
max = 'level * 6 + maglv * 4'
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local i = runes[item.itemid]
if isInArray(i.voc, getPlayerVocation(cid)) then
if isPlayer(itemEx.uid) then
level, maglv = getPlayerLevel(cid), getPlayerMagLevel(cid)
doCreatureAddHealth(cid, math.random(loadstring('return '..i.min)(), loadstring('return '..i.max)()))
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Undead Uh..", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 0)
else
doPlayerSendDefaultCancel(cid, RETURNVALUE_CANONLYUSETHISRUNEONCREATURES)
end
else
doPlayerSendCancel(cid, 'Your vocation cannot use this rune.')
end
return true
end
Repp++
Last edited: