Beo
Three Magic
- Joined
- Aug 25, 2009
- Messages
- 9,057
- Solutions
- 1
- Reaction score
- 846
Code:
local t = {
[12466] = {
[{1, 5}] = {100, 100}, -- {MAX_LEVEL, SPENT_MANA}
[{2, 6}] = {100, 100},
[{3, 7}] = {25, 100},
[{4, 8}] = {10, 100}
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local k = t[item.itemid]
if(k and isPlayer(cid)) then
for voc, b in pairs(k) do
if(isInArray(voc, getPlayerVocation(cid))) then
if(getPlayerMagLevel(cid) < b[1]) then
doPlayerAddSpentMana(cid, b[2] / getConfigInfo('rateMagic'))
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doRemoveItem(item.uid, 1)
else
return doPlayerSendCancel(cid, "You have reached the maximum level.")
end
end
end
end
return true
end
It doesn't work, I click the item I've put in Actions.xml, but nothing.
Using 3777 Rev.
If you could fix it, would be great. Thanks.