Postado Março 29, 2017 8 anos Em 29/03/2017 em 03:44, faisca123 disse: estava olhando no creature scripts e encontrei uma script para regenerar a stamina. sabe aonde altero nesta script para regenerar a stamina offline mais rapido ? segue script function onLogin(player) if not configManager.getBoolean(configKeys.STAMINA_SYSTEM) then return true end local lastLogout = player:getLastLogout() local offlineTime = lastLogout ~= 0 and math.min(os.time() - lastLogout, 86400 * 21) or 0 offlineTime = offlineTime - 600 if offlineTime < 180 then return true end local staminaMinutes = player:getStamina() local maxNormalStaminaRegen = 2400 - math.min(2400, staminaMinutes) local regainStaminaMinutes = offlineTime / 180 if regainStaminaMinutes > maxNormalStaminaRegen then local happyHourStaminaRegen = (offlineTime - (maxNormalStaminaRegen * 180)) / 600 staminaMinutes = math.min(2520, math.max(2400, staminaMinutes) + happyHourStaminaRegen) else staminaMinutes = staminaMinutes + regainStaminaMinutes end player:setStamina(staminaMinutes) return true end Pega um item, pode ser um fire bug, vai no actions e cria um renovador de stamina, e poe pra vender em um npc, mas facil assim function onUse(cid, item, fromPosition, itemEx, toPosition) local cfg = {} cfg.refuel = 42 * 60 * 1000 if(getPlayerStamina(cid) >= cfg.refuel) then doPlayerSendCancel(cid, "Sua stamina ja está completa.") elseif(not isPremium(cid)) then doPlayerSendCancel(cid, "Você precisa ser premium account.") else doPlayerSetStamina(cid, cfg.refuel) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Sua stamina foi recarregada, por favor relogue.") doRemoveItem(item.uid,1) end return true end (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.