Ir para conteúdo
  • Cadastre-se

(Resolvido)Skill Rates 1.3


Ir para solução Resolvido por KotZletY,

Posts Recomendados

Otx 1.3  8.6

Código 

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

Erro ocorre somente quando usa magia .

Screenshot_1.thumb.png.0e4a180d1dc87a6b5b295a3565b21eea.png

Link para o post
Compartilhar em outros sites
  • Solução

@Celulose 

Spoiler

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 skillRange 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(skill == SKILL_MAGLEVEL and self:getMagicLevel() or self:getEffectiveSkillLevel(skill), skill)
    end
  end
end

 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites

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.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo