LeoTK 173 Postado Março 17, 2019 Share Postado Março 17, 2019 Salve galera bom demorou mas consegui trazer esse conteúdo para vocês com ajuda de diversos amigos créditos no final do tópico. Bom vamos lá é um conjunto de configurações + script que vai permitir todas as skills do servidor ficar limitada até 250 Primeiramente vamos até o config.lua do servidor e deixa a Rate Magic em 0.01 Ficando assim rateMagic = 0.01 Logo depois disso vamos ao vocation.xml e procure por manamultiplier="1.2" Use o notepad++ Aperte ctrl + H para substituir todos os manamultiplier="1.2" por manamultiplier="1.0" manamultiplier="1.0" Essa modificação vai permitir a sua magic level chegar a 250 Depois faça isso com as demais skills Club / Sword / Axe / Distance / Shield / Fishing - Mude todos para 1.0 Depois disso agora vamos instalar os scripts para criar limites para as skills não bugarem e também vamos configurar a rate do magic level para não bugar também Vá em data/creaturescripts/creaturescripts.xml e adicione essas tags <!-- Skills Block / Stages Skills --> <event type="advance" name="skillblock" event="script" value="skillblock.lua"/> <event type="login" name="skillblock2" event="script" value="skillblock2.lua"/> <event type="death" name="skillblock3" event="script" value="skillblock3.lua"/> <event type="advance" name="skillblock4" event="script" value="skillblock4.lua"/> <event type="login" name="skillblock6" event="script" value="skillblock6.lua"/> Agora abra o login.lua e adicione isso registerCreatureEvent(cid, "skillblock") registerCreatureEvent(cid, "skillblock2") registerCreatureEvent(cid, "skillblock3") registerCreatureEvent(cid, "skillblock4") Crie o arquivo skillblock.lua e adicione isso dentro Lembre-se coloque um numero anterior ao limite ou seja o limite de fist e 250 mas no maxLevel esta 254 Spoiler local skills = { [SKILL_FIST] = {maxLevel = 254}, [SKILL_SWORD] = {maxLevel = 249}, [SKILL_AXE] = {maxLevel = 249}, [SKILL_CLUB] = {maxLevel = 249}, [SKILL_DISTANCE] = {maxLevel = 249}, [SKILL_SHIELD] = {maxLevel = 249}, [SKILL_FISHING] = {maxLevel = 254}, [SKILL__MAGLEVEL] = {maxLevel = 150}, } function onAdvance(cid, skill, oldLevel, newLevel) local i = skills[skill] if i then if newLevel > i.maxLevel then doPlayerSetRate(cid, skill, 0.0) doPlayerSave(cid) doPlayerSetStorageValue(cid, skill+10000, 1) return false end end return true end Crie o Arquivo skillblock2.lua e adicione isso dentro Spoiler function onLogin(cid) if getPlayerStorageValue(cid, 0+10000) == 1 then doPlayerSetRate(cid, 0, 0.0) end if getPlayerStorageValue(cid, 1+10000) == 1 then doPlayerSetRate(cid, 1, 0.0) end if getPlayerStorageValue(cid, 2+10000) == 1 then doPlayerSetRate(cid, 2, 0.0) end if getPlayerStorageValue(cid, 3+10000) == 1 then doPlayerSetRate(cid, 3, 0.0) end if getPlayerStorageValue(cid, 4+10000) == 1 then doPlayerSetRate(cid, 4, 0.0) end if getPlayerStorageValue(cid, 5+10000) == 1 then doPlayerSetRate(cid, 5, 0.0) end if getPlayerStorageValue(cid, 6+10000) == 1 then doPlayerSetRate(cid, 6, 0.0) end if getPlayerStorageValue(cid, 7+10000) == 1 then doPlayerSetRate(cid, 7, 0.0) end return true end Crie o Arquivo skillblock3.lua e adicione isso dentro Spoiler local storages = {0+10000, 1+10000, 2+10000, 3+10000, 4+10000, 5+10000, 6+10000, 7+10000} function onDeath(cid, corpse) if (isPlayer(cid)) then for i = 1, #storages do if getPlayerStorageValue(cid, storages[i]) == 1 then setPlayerStorageValue(cid, storages[i], -1) end end end return true end Crie o Arquivo skillblock4.lua e adicione isso dentro Spoiler dofile(getDataDir() .. "creaturescripts/scripts/skillblock5.lua") function onAdvance(cid, skill, oldLevel, newLevel) if(skillStages[skill] ~= nil) then local skillRate = 1 local oldRates = getPlayerRates(cid) for i, skillRateInfo in pairs(skillStages[skill]) do if(newLevel >= skillRateInfo[1]) then skillRate = skillRateInfo[2] else break end end doPlayerSetRate(cid, skill, skillRate) if(showInfoOnAdvance and skillRate ~= oldRates[skill]) then local pos = getCreaturePosition(cid) local positions = {x = pos.x+1, y = pos.y+1, z = pos.z} if(skill >= 0 and skill <= 6) then configRate = skillConfig.skill doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, SKILL_NAMES[skill] .. " teve a rate alterada de " .. oldRates[skill] * configRate .. "x para " .. skillRate * configRate .. "x. \n" .. getPlayerSkillRatesText(cid)) doSendMagicEffect(positions, 30) -- EFEITO QUE VAI MOSTRAR QUANDO UPAR A SKILL else configRate = skillConfig.magiclevel doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, SKILL_NAMES[skill] .. " teve a rate alterada de " .. string.format("%.3f", oldRates[skill] * configRate) .. "x para " .. skillRate * configRate .. "x. \n" .. getPlayerSkillRatesText(cid)) doSendMagicEffect(positions, 30) -- EFEITO QUE VAI MOSTRAR QUANDO UPAR A SKILL end end end return true end Crie o Arquivo skillblock5.lua e adicione isso dentro Spoiler skillConfig = {skill = getConfigValue('rateSkill'), magiclevel = getConfigValue('rateMagic')} skillStages = {} skillStages[SKILL_FIST] = {{0,6},{40,4},{80,2},{150,1},{200,1},{255,0}} skillStages[SKILL_CLUB] = {{0,5},{40,4},{80,3},{150,2},{200,1},{250,0}} skillStages[SKILL_SWORD] = {{0,5},{40,4},{80,3},{150,2},{200,1},{250,0}} skillStages[SKILL_AXE] = {{0,5},{40,4},{80,3},{150,2},{200,1},{250,0}} skillStages[SKILL_DISTANCE] = {{0,5},{40,4},{80,3},{150,2},{200,1},{250,0}} skillStages[SKILL_SHIELD] = {{0,5},{40,4},{80,3},{150,2},{200,1},{250,0}} skillStages[SKILL_FISHING] = {{0,5},{40,4},{80,3},{150,2},{200,1},{250,0}} skillStages[SKILL__MAGLEVEL] = {{0,0.2},{150,0.1},{250,0}} -- LEMBRE-SE DE SEGUIR ESSA ORDEM 0.2 / 0.1 CASO MUDAR PARA 0.09 MUDE O string.format("%.3f" PARA string.format("%.4f" // showInfoOnAdvance = true -- envia uma nova mensagem com a sua nova rate showInfoOnLogin = true -- envia mensagem da rate ao jogador ao logar function getPlayerSkillRatesText(cid) local skillInfo = getPlayerRates(cid) return "Suas Skills Rates\n[ Ninjutsu: " .. string.format("%.3f", skillInfo[SKILL__MAGLEVEL] * skillConfig.magiclevel) .. "x ]\n[ Velocidade De Ataque: " .. skillInfo[SKILL_FIST] * skillConfig.skill .. "x ]\n[ Arma Leve: " .. skillInfo[SKILL_CLUB] * skillConfig.skill .. "x ]\n[ Arma Média: " .. skillInfo[SKILL_SWORD] * skillConfig.skill .. "x ]\n[ Arma Pesada: " .. skillInfo[SKILL_AXE] * skillConfig.skill .. "x ]\n[ Distancia: " .. skillInfo[SKILL_DISTANCE] * skillConfig.skill .. " ]\n[ Escudo: " .. skillInfo[SKILL_SHIELD] * skillConfig.skill .. "x ]\n[ Pesca: " .. skillInfo[SKILL_FISHING] * skillConfig.skill .. "x ]" end Crie um Arquivo skillblock6.lua e adicione isso dentro Spoiler dofile(getDataDir() .. "creaturescripts/scripts/skillblock5.lua") function onLogin(cid) for skill, skillStage in pairs(skillStages) do if(skill >= 0 and skill <= 6) then nowSkill = getPlayerSkillLevel(cid, skill) else nowSkill = getPlayerMagLevel(cid, true) end for i, skillRateInfo in pairs(skillStage) do if(nowSkill >= skillRateInfo[1]) then skillRate = skillRateInfo[2] else break end end doPlayerSetRate(cid, skill, skillRate) end if(showInfoOnLogin) then doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, getPlayerSkillRatesText(cid)) end registerCreatureEvent(cid, "skillblock4") return TRUE end Algumas imagens mostrando funcionando no meu caso eu configurei para enviar a mensagem em uma channel caso se interessar nesse sistema basta seguir o link Clicando Aqui Créditos: @movie @Coltera @lordzetros @Yan Liima @aspira Night Wolf Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados