local config = {
rate = 2,
storage = 1000,
expstorage = 1100,
register = 1200,
time = 14400,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.storage) <= 0 then
local rates = getPlayerRates(cid)
setPlayerStorageValue(cid, config.expstorage, rates[SKILL__LEVEL])
setPlayerStorageValue(cid, config.register, 1)
itemEx=itemid == 9004
doCreatureSay(cid, "Your extra experience rate has been activated! It now is: " .. config.rate .. "x added to your former experience rate.", TALKTYPE_ORANGE_1, true, cid)
setPlayerStorageValue(cid, config.storage, os.time()+config.time)
doPlayerSetExperienceRate(cid, rates[SKILL__LEVEL]*config.rate)
doRemoveItem(item.uid,1)
registerCreatureEvent(cid, "ExpStage")
else
doCreatureSay(cid, "You must finish first exp condition to start other exp condition !", TALKTYPE_ORANGE_1, true, cid)
end
return true
end