Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local items = { -- if you want to disable mana.health.level make it to 0
- [6119] = {spell = "thunderblast", mana = 0, health = 0, level = 0,storage = 934039} }
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- local t = items[item.itemid]
- if t then
- if getPlayerStorageValue(cid,t.storage) > 0 then
- return doPlayerSendCancel(cid,"You have already used this before.")
- end
- if getCreatureMaxMana(cid) < t.mana then
- return doPlayerSendCancel(cid,"You need ".. t.mana .. " mana points to learn this spell.")
- end
- if getCreatureMaxHealth(cid) < t.health then
- return doPlayerSendCancel(cid,"You need ".. t.health .. " mana points to learn this spell.")
- end
- if getPlayerLevel(cid) < t.mana then
- return doPlayerSendCancel(cid,"You need to be more then level [".. t.level .. "] to learn this spell.")
- end
- doPlayerLearnInstantSpell(cid, t.spell)
- setPlayerStorageValue(cid,t.storage,1)
- doPlayerSendTextMessage(cid,25,"You have learned a new spell [".. t.spell .."].")
- doRemoveItem(item.uid,1)
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement