Ir para conteúdo

Featured Replies

  • 3 weeks later...
  • Respostas 14
  • Visualizações 1.5k
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

Postado

@JofreCorreia em events/scripts/player.lua adicione:

Spoiler

local config = {
	-- base vocationId
	[1] = {
		-- skillId
		[SKILL_FIST] = {
			-- [{skillLevel}] = skillRate
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_CLUB] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_SWORD] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_AXE] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_DISTANCE] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_SHIELD] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_FISHING] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_MAGLEVEL] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		}
	}
}

--[[
function Vocation.getBase(self)
	local demotion = self:getDemotion()
	while demotion do
		local tmp = demotion:getDemotion()
		if not tmp then
			return demotion
		end
		demotion = tmp
	end
	return self
end
]]

local function getSkillRate(player, skillId)
	local targetVocation = config[player:getVocation():getBase():getId()]
	if targetVocation then
		local targetSkillStage = targetVocation[skillId]
		if targetSkillStage then
			local skillLevel = player:getSkillLevel(skillId)
			for level, rate in pairs(targetSkillStage) do
				if skillLevel >= level[1] and skillLevel <= level[2] then
					return rate
				end
			end
		end
	end

	return skillId == SKILL_MAGLEVEL and configManager.getNumber(configKeys.RATE_MAGIC) or configManager.getNumber(configKeys.RATE_SKILL)
end

 

 

ainda em events/scripts/player.lua procure por:

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

troque por:

function Player:onGainSkillTries(skill, tries)
	if not APPLY_SKILL_MULTIPLIER then
		return tries
	end

	return tries * getSkillRate(self, skill)
end

 

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

Postado
  • Solução
Em 01/04/2018 em 22:44, Jobs disse:

local config = {
	-- base vocationId
	[1] = {
		-- skillId
		[SKILL_FIST] = {
			-- [{skillLevel}] = skillRate
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_CLUB] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_SWORD] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_AXE] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_DISTANCE] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_SHIELD] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_FISHING] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		},
		[SKILL_MAGLEVEL] = {
			[{10, 19}] = 10,
			[{20, 29}] = 5
		}
	}
}

--[[
function Vocation.getBase(self)
	local demotion = self:getDemotion()
	while demotion do
		local tmp = demotion:getDemotion()
		if not tmp then
			return demotion
		end
		demotion = tmp
	end
	return self
end
]]

local function getSkillRate(player, skillId)
	local targetVocation = config[player:getVocation():getBase():getId()]
	if targetVocation then
		local targetSkillStage = targetVocation[skillId]
		if targetSkillStage then
			local skillLevel = player:getSkillLevel(skillId)
			for level, rate in pairs(targetSkillStage) do
				if skillLevel >= level[1] and skillLevel <= level[2] then
					return rate
				end
			end
		end
	end

	return skillId == SKILL_MAGLEVEL and configManager.getNumber(configKeys.RATE_MAGIC) or configManager.getNumber(configKeys.RATE_SKILL)
end

function Player:onGainSkillTries(skill, tries)
	if not APPLY_SKILL_MULTIPLIER then
		return tries
	end

	return tries * getSkillRate(self, skill)
end

 

Créditos ao Ninja do otland, né?

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo