Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local id_da_wand = 12345
- local tempo_de_exhaust = 30 -- em minutos (da spell)
- local tempo_de_wand = 30 -- em minutos (de duração da wand)
- local wandsto = 505090
- local storage = 505091
- function doRemoveWand(cid)
- if not isPlayer(cid) then return false end
- if exhaustion.check(cid,wandsto) == true then
- return false
- end
- for slot = 5,6 do
- if getPlayerSlotItem(cid, slot).itemid == id_da_wand then
- doPlayerRemoveItem(cid,id_da_wand,1)
- end
- end
- return true
- end
- function onCastSpell(cid, var)
- tempo_de_wand = tempo_de_wand * 60
- tempo_de_exhaust = tempo_de_exhaust * 60
- if exhaustion.check(cid, storage) == false then
- if exhaustion.check(cid,wandsto) == false then
- if not getPlayerSlotItem(cid, 5).itemid or not getPlayerSlotItem(cid,6).itemid then
- doPlayerAddItem(cid,id_da_wand,1)
- doSendMagicEffect(getCreaturePosition(cid),12)
- exhaustion.set(cid,wandsto,tempo_de_wand)
- exhaustion.set(cid,storage,tempo_de_exhaust)
- addEvent(doRemoveWand,(tempo_de_wand*1000)+1000,cid)
- else
- doPlayerSendCancel(cid,'You cannot use this spell with your hands full.')
- doSendMagicEffect(getCreaturePosition(cid),2)
- end
- else
- doPlayerSendCancel(cid,'You are exhausted.')
- doSendMagicEffect(getCreaturePosition(cid),2)
- end
- else
- doSendMagicEffect(getCreaturePosition(cid),2)
- doPlayerSendCancel(cid,'You are exhausted.')
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement