function onUse(cid, item, frompos, item2, topos)
local config = {
timeForUse = 120, -- minutos
storage = 88323,
toKnow = 98323,
effect = CONST_ME_MAGIC_BLUE,
vocationIds = {
-- Sorc
[1] = {5},
[5] = {9},
[9] = {13},
[13] = {17},
-- Druid
[2] = {6},
[6] = {10},
[10] = {14},
[14] = {18},
-- Pala
[3] = {7},
[7] = {11},
[11] = {15},
[15] = {19},
-- Kina
[4] = {8},
[8] = {12},
[12] = {16},
[16] = {20}
}
}
local playerVocation = getPlayerVocation(cid)
if config.vocationIds[playerVocation] == nil then
return false
end
local lastVocationId = config.vocationIds[playerVocation][#config.vocationIds[playerVocation]]
local time = getPlayerStorageValue(cid, config.storage)
if time - os.time() <= 0 then
time = os.time() + config.timeForUse * 60
else
time = time + config.timeForUse * 60
end
setPlayerStorageValue(cid, config.storage, time)
doPlayerSetVocation(cid, lastVocationId)
doRemoveItem(item.uid, 1)
setPlayerStorageValue(cid, config.toKnow, 1)
doSendMagicEffect(getCreaturePosition(cid), config.effect)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionadas 2 horas de VIP ao seu personagem.")
return true
end
Se funcionar, não se esqueça de dar REP+ e considere como uma solução, okay?