Postado Outubro 24, 2018 6 anos Diga em poucas palavras a base utilizada Não sei olhar isto.. Se precisarem de tal informação, basta me dizerem onde vejo. Sou leigo no assunto. Base: Qual erro está surgindo/O que você procura? Bom galera, é o seguinte, estou utilizando o 10.98 do malucooo, já fiz algumas alterações que achei plausível, mas uma me incomoda bastante. Deixei a skill 5x, e ml 3x. Com 12 horas de treino offline, o ml foi do 10 ao 60! E o distance/axe foi do 10, ao 62/60 respectivamente. Minha dúvida é: Para uma skill/magic 5/3x, subiu demais, não subiu? Então penso eu que a exp do treino offline não segue a da base do servidor, e gostaria da confirmação de vocês, para me auxiliarem. Procurei no forum, encontrei artigos relacionados a treino off, mas nenhum com está minha dúvida! Você tem o código disponível? Se tiver publique-o aqui: Segue o arquivo .lua Spoiler function onLogin(player) local lastLogout = player:getLastLogout() local offlineTime = lastLogout ~= 0 and math.min(os.time() - lastLogout, 86400 * 21) or 0 local offlineTrainingSkill = player:getOfflineTrainingSkill() if offlineTrainingSkill == -1 then player:addOfflineTrainingTime(offlineTime * 1000) return true end player:setOfflineTrainingSkill(-1) if offlineTime < 600 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must be logged out for more than 10 minutes to start offline training.") return true end local trainingTime = math.max(0, math.min(offlineTime, math.min(43200, player:getOfflineTrainingTime() / 1000))) player:removeOfflineTrainingTime(trainingTime * 1000) local remainder = offlineTime - trainingTime if remainder > 0 then player:addOfflineTrainingTime(remainder * 1000) end if trainingTime < 60 then return true end local text = "During your absence you trained for" local hours = math.floor(trainingTime / 3600) if hours > 1 then text = string.format("%s %d hours", text, hours) elseif hours == 1 then text = string.format("%s 1 hour", text) end local minutes = math.floor((trainingTime % 3600) / 60) if minutes ~= 0 then if hours ~= 0 then text = string.format("%s and", text) end if minutes > 1 then text = string.format("%s %d minutes", text, minutes) else text = string.format("%s 1 minute", text) end end text = string.format("%s.", text) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, text) local vocation = player:getVocation() local promotion = vocation:getPromotion() local topVocation = not promotion and vocation or promotion local updateSkills = false if isInArray({SKILL_CLUB, SKILL_SWORD, SKILL_AXE, SKILL_DISTANCE}, offlineTrainingSkill) then local modifier = topVocation:getAttackSpeed() / 1000 updateSkills = player:addOfflineTrainingTries(offlineTrainingSkill, (trainingTime / modifier) / (offlineTrainingSkill == SKILL_DISTANCE and 4 or 2)) elseif offlineTrainingSkill == SKILL_MAGLEVEL then local gainTicks = topVocation:getManaGainTicks() * 2 if gainTicks == 0 then gainTicks = 1 end updateSkills = player:addOfflineTrainingTries(SKILL_MAGLEVEL, trainingTime * (vocation:getManaGainAmount() / gainTicks)) end if updateSkills then player:addOfflineTrainingTries(SKILL_SHIELD, trainingTime / 4) end return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. Dispensa imagens. Se faltou alguma informação necessária para tal avaliação, por favor, me peçam. Muito obrigado desde já. Editado Outubro 24, 2018 6 anos por CraftBones alteração formal (veja o histórico de edições)
Postado Outubro 25, 2018 6 anos function onLogin(player) local lastLogout = player:getLastLogout() local offlineTime = lastLogout ~= 0 and math.min(os.time() - lastLogout, 86400 * 21) or 0 local offlineTrainingSkill = player:getOfflineTrainingSkill() if offlineTrainingSkill == -1 then player:addOfflineTrainingTime(offlineTime * 1000) return true end player:setOfflineTrainingSkill(-1) if offlineTime < 600 then player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You must be logged out for more than 10 minutes to start offline training.") return true end local trainingTime = math.max(0, math.min(offlineTime, math.min(43200, player:getOfflineTrainingTime() / 1000))) player:removeOfflineTrainingTime(trainingTime * 1000) local remainder = offlineTime - trainingTime if remainder > 0 then player:addOfflineTrainingTime(remainder * 1000) end if trainingTime < 60 then return true end local text = "During your absence you trained for" local hours = math.floor(trainingTime / 3600) if hours > 1 then text = string.format("%s %d hours", text, hours) elseif hours == 1 then text = string.format("%s 1 hour", text) end local minutes = math.floor((trainingTime % 3600) / 60) if minutes ~= 0 then if hours ~= 0 then text = string.format("%s and", text) end if minutes > 1 then text = string.format("%s %d minutes", text, minutes) else text = string.format("%s 1 minute", text) end end text = string.format("%s.", text) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, text) local vocation = player:getVocation() local promotion = vocation:getPromotion() local topVocation = not promotion and vocation or promotion local updateSkills = false if table.contains({SKILL_CLUB, SKILL_SWORD, SKILL_AXE, SKILL_DISTANCE}, offlineTrainingSkill) then local modifier = topVocation:getAttackSpeed() / 1000 updateSkills = player:addOfflineTrainingTries(offlineTrainingSkill, (trainingTime / modifier) / (offlineTrainingSkill == SKILL_DISTANCE and 4 or 2)) elseif offlineTrainingSkill == SKILL_MAGLEVEL then local gainTicks = topVocation:getManaGainTicks() * 2 if gainTicks == 0 then gainTicks = 1 end updateSkills = player:addOfflineTrainingTries(SKILL_MAGLEVEL, trainingTime * (vocation:getManaGainAmount() / gainTicks)) end if updateSkills then player:addOfflineTrainingTries(SKILL_SHIELD, trainingTime / 4) end return true end Faz o teste com esse, colega. Editado Outubro 25, 2018 6 anos por lordzetros (veja o histórico de edições)
Postado Outubro 25, 2018 6 anos Autor [Warning - Event::checkScript] Can not load script: scripts/others/offlinetraining.lua data/creaturescripts/scripts/others/offlinetraining.lua:75: unexpected symbol near char(239) Obtive este retorno, se for algo obvio, desculpa, sou leigo! EDIT: Corrigi o erro, baixei o arquivo da VPS, editei pelo bloco de notas e salvei como ANSI, não retornou erro. Porém, agora vou testar o treino offline pelas proximas 12h! Se obtiver resultado, volto para reputar! Se alguém passar por aqui e notar algo diferente do nosso amigo anterior, sinta-se a vontade para postar, caso não dê certo, gostaria de ter novas possibilidades. @lordzetros Ao fim do teste, se obter resultado positivo, venho reputar! @lordzetros Mano, loguei o personagem, e nem sequer mexer na skill, era como se estivesse apenas dado logout! Alguém? Por favor uma luz!! Editado Outubro 25, 2018 6 anos por CraftBones (veja o histórico de edições)
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.