Ir para conteúdo

iceraz

Membro
  • Registro em

  • Última visita

Solutions

  1. iceraz's post in (Resolvido)Skills subindo em stages was marked as the answer   
    Galera!! Segue a resposta.
     
    Depois de muito pesquisar e procurar por forums e não conseguir a resposta eu mesmo tive que correr atrás e implementar ehehehe.
    Gostaria de agradecer a Linxsis. ele desenvolveu parte desse código depois eu fiz uns ajustes para que funcionasse! 
     
    Segue:
     
    1 substituir a função onGainSkillTries (dentro do arquivo data/events/scripts/player.lua) para uma mais completa junto com alguns complementos (no caso + 1 função e uma tabela onde vai ficar os stages).
    função antiga
    function Player:onGainSkillTries(skill, tries) if APPLY_SKILL_MULTIPLIER == false then return tries end if skill == SKILL_MAGLEVEL then return tries * configManager.getNumber(configKeys.RATE_MAGIC) end return tries * configManager.getNumber(configKeys.RATE_SKILL) end como vai ficar o arquivo no lugar dessa função
    SkillsTable = { [0] = { --[[ SKILL_FIST ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [1] = { --[[ SKILL_CLUB ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [2] = { --[[ SKILL_SWORD ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [3] = { --[[ SKILL_AXE ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [4] = { --[[ SKILL_DISTANCE ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [5] = { --[[ SKILL_SHIELD ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [6] = { --[[ SKILL_FISHING ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [7] = { --[[ SKILL_MAGLEVEL ]] stage = { [{0, 50}] = 10, [{51, 70}] = 8, [{71, 80}] = 7, [{81, 90}] = 6, [{91, 110}] = 5, [{111, 300}] = 2 }, rate = configKeys.RATE_MAGIC } } function getSkillsRate(level, skill) local skillRange = SkillsTable[skill] if next(skillRange.stage) then for sLevel, multiplier in pairs(skillRange.stage) do if level >= sLevel[1] and level <= sLevel[2] then return multiplier end end end return 1 end function Player:onGainSkillTries(skill, tries) if APPLY_SKILL_MULTIPLIER == false then return tries end local skills = SkillsTable[skill] if next(skills) and skills.rate then local rate = configManager.getNumber(skills.rate) if rate > 0 then return tries * rate else return tries * getSkillsRate(self:getEffectiveSkillLevel(skill), skill) end end end 2 mudar no config.lua o rateSkill e rateMagic para 0 (zero)
    -- rateSkill = 8 rateSkill = 0 -- rateMagic = 5 rateMagic = 0  
    isso é tudo pe-pessoal!
  2. iceraz's post in (Resolvido)Skills subindo por estágios was marked as the answer   
    não sei fechar... então vou colocar a resposta no post mais antigo que eu já tinha feito com essa pergunta... desculpem aí heheheh... 
     
    eu mesmo resolvi galera... a resposta está em: 
    abraço
  3. iceraz's post in (Resolvido)Npc Trade Window was marked as the answer   
    Pessoal, já resolvi... O arquivo para essa alteração é o protocolgame.cpp linha 1480
    //msg.add<uint64_t>(player->getMoney()); msg.add<uint64_t>(player->getMoney() + player->getBankBalance()); isso vai apenas mostrar na tela o valor que o player tem contando (grana da BP + grana do banco).
    caso ele compre algo além do valor que tem na BP ainda vai dar problema... isso eu vou ver agora acredito que em npchandler...  passo aqui depois pra deixar tudo legal para quem precisar futuramente. abraço!
     
    --------- voltei (editando...) ----------
    então pessoal fiz algumas alterações dentro de modules.lua em data/npc/lib/npcsystem/modules.lua
     
    inseri trechos de cód parecidos com esse... da pra entender... então ta aí pra quem precisar futuramente...
    if player:removeMoney(totalCost) == false then -- atualizo totalCost = totalCost - grana do player na mão -- tiro da mão do player a grana -- pago o restante com dinheiro do banco totalCost = totalCost - player:getMoney() player:removeMoney(player:getMoney()) player:setBankBalance(player:getBankBalance() - totalCost) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Your account balance is ' .. player:getBankBalance() .. ' gold.') end abraço galera!!!

Informação Importante

Confirmação de Termo