function onUse(cid, item, frompos, item2, topos)
local go = "Rat"
local tempo = 10 - em segundos
if getPlayerLevel(cid) >= 11 and getPlayerLevel(cid) <= 20 then
go = "Monk"
elseif getPlayerLevel(cid) >= 21 and getPlayerLevel(cid) <= 30 then
go = "Dragon"
elseif getPlayerLevel(cid) >= 31 and getPlayerLevel(cid) <= 40 then
go = "Dragon Lord"
end
end
local summon = getCreatureSummons(cid)
---------------------------------------------------
if #summon >= 1 then
for _, pid in ipairs(summon) do
doRemoveCreature(pid)
doCreatureSay(cid, "Can go rest ["..go.."]", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
doPlayerAddItem(cid, 1978, 1)
addEvent(function()
doPlayerAddItem(cid, 1979, 1)
end, tempo*1000)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You used the sacred book of the Necromancers , now wait 30 minutes to use again!.")
end
return true
end
doConvinceCreature(cid, doSummonCreature(go, getCreaturePosition(cid)))
doCreatureSay(cid, "Let battle ["..go.."]", TALKTYPE_ORANGE_1)
return true
end