local time = 2 -- Tempo de Exhaustion (1 por segundos)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {}
cfg.refuel = 42 * 60 * 1000
if exhaustion.check(cid, 141012) >= time then return true end
if(getPlayerStamina(cid) >= cfg.refuel) then
doPlayerSendCancel(cid, "Your stamina is already full.")
else
doPlayerSetStamina(cid, cfg.refuel)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled, please relog to activate.")
doRemoveItem(item.uid)
exhaustion.set(cid, 141012, time)
return 1
end
return 1
end
essas funções ajudam muito para exhastions:
exhaustion.set(cid, storage, time) exhaustion.check(cid, storage)






info
Grupo: Campones
Registrado: 07/06/08
Posts: 12
Reputação: 0
Char no Tibia: Drax Zaciust
Estou tentando adicionar exausted, em um item que recupera toda a stamina do personagem
porém ainda não está checando o exausted,
alguem poderia me ajudar ?
local time = 2000 -- Tempo de Exhaustion (1000 por segundos) function onUse(cid, item, fromPosition, itemEx, toPosition) local cfg = {} cfg.refuel = 42 * 60 * 1000 if getPlayerStorageValue(cid, 141012) >= os.time() then return true end if(getPlayerStamina(cid) >= cfg.refuel) then doPlayerSendCancel(cid, "Your stamina is already full.") else doPlayerSetStamina(cid, cfg.refuel) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled, please relog to activate.") doRemoveItem(item.uid) setPlayerStorageValue(cid, 141012, os.time() + time / 1000) return 1 end end return 1 end endObrg
Editado Agosto 17 por ZeRuS