local expfinal = 1 --Não mude, isso é para a experiencia voltar ao normal.
local textoPotionUsada = "[EGG DE EXP] --> Voce ja esta sobre o efeito de uma egg de exp. Espere o efeito acabar."
local potions = {
-- [ID_POTION] = { tempo = DURAÇÃO, experiencia = EXPERIENCIA, quantidade = QUANTIDADE_DE_POTIONS, texto = 'Voce Ganhou 30 Minutos de Exp [3x]', textofinal = 'Bonus de Exp [3x] Finalizada', storage = STORAGE_UNICO_PARA_CADA_POTION, textoClasse = 22, efeito = 1 },
[6541] = { tempo = 1800, experiencia = 3.0, quantidade = 1, texto = '[EGG DE EXP] --> Voce usou egg de exp [3x] Por 30 Minutos', textofinal = '[EGG DE EXP] --> Egg de exp [3x] Finalizada', storage = 33330, textoClasse = 19, efeito = 53},
[6542] = { tempo = 1800, experiencia = 5.0, quantidade = 1, texto = '[EGG DE EXP] --> Voce usou egg de exp [5x] Por 30 Minutos', textofinal = '[EGG DE EXP] --> Egg de exp [5x] Finalizada', storage = 33330, textoClasse = 19, efeito = 53},
[6543] = { tempo = 1800, experiencia = 7.0, quantidade = 1, texto = '[EGG DE EXP] --> Voce usou egg de exp [7x] Por 30 Minutos', textofinal = '[EGG DE EXP] --> Egg de exp [7x] Finalizada', storage = 33330, textoClasse = 19, efeito = 53},
[6544] = { tempo = 1800, experiencia = 9.0, quantidade = 1, texto = '[EGG DE EXP] --> Voce usou egg de exp [9x] Por 30 Minutos', textofinal = '[EGG DE EXP] --> Egg de exp [9x] Finalizada', storage = 33330, textoClasse = 19, efeito = 53},
[6545] = { tempo = 1800, experiencia = 11.0, quantidade = 1, texto = '[EGG DE EXP] --> Voce usou egg de exp [11x] Por 30 Minutos', textofinal = '[EGG DE EXP] --> Egg de exp [11x] Finalizada', storage = 33330, textoClasse = 19, efeito = 53},
[2328] = { tempo = 1800, experiencia = 13.0, quantidade = 1, texto = '[EGG DE EXP] --> Voce usou egg de exp [13x] Por 30 Minutos', textofinal = '[EGG DE EXP] --> Egg de exp [13x] Finalizada', storage = 33330, textoClasse = 19, efeito = 53},
}
function onUse(cid, item, frompos, item2, topos)
for potionId, potionConfig in pairs(potions) do
if item.itemid == potionId then
if (getPlayerStorageValue(cid, potionConfig.storage) > os.time()) then
doPlayerSendTextMessage(cid,20,"[EGG DE EXP] --> Voce ja esta sobre o efeito de uma egg de exp. Espere o efeito acabar.")
return;
end
local quantidadePotionPlayer = getPlayerItemCount(cid, potionId)
if quantidadePotionPlayer < potionConfig.quantidade or quantidadePotionPlayer <= 0 then
return;
end
doRemoveItem(item.uid, potionConfig.quantidade)
doPlayerSetExperienceRate(cid, potionConfig.experiencia)
doSendMagicEffect(frompos, potionConfig.efeito)
doPlayerSendTextMessage(cid, potionConfig.textoClasse, potionConfig.texto)
addEvent(potion, potionConfig.tempo * 1000, cid, potionConfig)
setPlayerStorageValue(cid, potionConfig.storage, (os.time() + potionConfig.tempo))
end
end
end
function potion(cid, potionConfig)
doPlayerSetExperienceRate(cid, expfinal)
doPlayerSendTextMessage(cid, potionConfig.textoClasse, potionConfig.textofinal)
end