Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local t = {
- [itemId] = {
- spell = "name"
- },
- [itemId] = {
- spell = "name"
- },
- }
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- local k, pos = t[item.itemid], getThingPos(cid)
- if k then
- if getPlayerLearnedInstantSpell(cid, k.spell) then
- doPlayerSendCancel(cid, "You already know this spell.")
- doSendMagicEffect(pos, CONST_ME_POFF)
- else
- doRemoveItem(cid, item.uid, 1)
- doPlayerLearnInstantSpell(cid, k.spell)
- doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations! You have successfully learned " .. k.spell .. "!")
- doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE)
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement