Criei um script do 0 para as poções:
local potions = {
[266] = { -- Health Potion
minHeal = 50,
maxHeal = 100,
emptyVial = 2874
},
[268] = { -- Mana Potion
minMana = 25,
maxMana = 75,
emptyVial = 2874
}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local target = itemEx.uid
local potion = potions[item.itemid]
if not isPlayer(target) or isMonster(target) or isNpc(target) then
return false
end
if potion then
if potion.minHeal then
local healAmount = math.random(potion.minHeal, potion.maxHeal)
doCreatureAddHealth(target, healAmount)
elseif potion.minMana then
local manaAmount = math.random(potion.minMana, potion.maxMana)
doCreatureAddMana(target, manaAmount)
end
doCreatureSay(target, "Ahhhh!", TALKTYPE_MONSTER_SAY)
local exhaustStorage = 6499135761
local exhaustTime = os.time() + 1
if getPlayerStorageValue(cid, exhaustStorage) <= exhaustTime then
setPlayerStorageValue(cid, exhaustStorage, exhaustTime)
doSendMagicEffect(getPlayerPosition(target), CONST_ME_MAGIC_BLUE)
doPlayerRemoveItem(cid, item.uid, 1)
doPlayerAddItem(cid, potion.emptyVial, 1)
else
doPlayerSendCancel(cid, "You are exhausted and cannot use this potion yet.")
end
end
return true
end
Está bem fácil de configurar, é só adicionar mais poções na tabela "potions"