I want to player can not loss items when he use it (I do not want to Item delete when player use it)
Script
Script
LUA:
local vocations = {4, 8, 3, 7}
function onUse(cid, item, frompos, item2, topos)
local vocation = getPlayerVocation(cid)
if not isInArray(vocations, vocation) then
doSendMagicEffect(frompos, CONST_ME_MAGIC_POFF)
doPlayerSendCancel(cid, "Your vocation cannot use this rune. It can be used by Paladins and Knights.")
return true
end
local mLvl = getPlayerMagLevel(cid)
if mLvl >= 0 then
doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN)
doCreatureSay(cid, "Mixed Rune", TALKTYPE_MONSTER)
doPlayerAddMana(cid, 15000)
doCreatureAddHealth(cid, 35000)
if item.type > 1 then
doChangeTypeItem(item.uid, item.type-1)
end
else
doSendMagicEffect(frompos, CONST_ME_MAGIC_POFF)
doPlayerSendCancel(cid, "You don't have the required magic level to use that rune.")
end
return true
end
Last edited: