Skip to content

Commit

Permalink
Update skills.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
luanluciano93 authored Jun 6, 2024
1 parent f72e364 commit a955a29
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions modules/game_skills/skills.lua
Original file line number Diff line number Diff line change
Expand Up @@ -253,27 +253,29 @@ function refresh()
onSpeedChange(player, player:getSpeed())

local hasAdditionalSkills = g_game.getFeature(GameAdditionalSkills)
for i = Skill.Fist, Skill.ManaLeechAmount do
for i = Skill.Fist, Skill.Transcendence do
onSkillChange(player, i, player:getSkillLevel(i), player:getSkillLevelPercent(i))

if i > Skill.Fishing then
local ativedAdditionalSkills = hasAdditionalSkills
if ativedAdditionalSkills and g_game.getClientVersion() >= 1281 and (i == Skill.LifeLeechAmount or i == Skill.ManaLeechAmount) then
ativedAdditionalSkills = false
if ativedAdditionalSkills then
if g_game.getClientVersion() >= 1281 then
if i == Skill.LifeLeechAmount or i == Skill.ManaLeechAmount then
ativedAdditionalSkills = false
elseif g_game.getClientVersion() < 1332 and Skill.Transcendence then
ativedAdditionalSkills = false
elseif i >= Skill.Fatal and player:getSkillLevel(i) <= 0 then
ativedAdditionalSkills = false
end
elseif g_game.getClientVersion() < 1281 and i >= Skill.Fatal then
ativedAdditionalSkills = false
end
end

toggleSkill('skillId' .. i, ativedAdditionalSkills)
end
end

if g_game.getClientVersion() >= 1281 then
local lastSkill = g_game.getClientVersion() >= 1332 and Skill.Transcendence or Skill.Momentum
for i = Skill.Fatal, lastSkill do
onSkillChange(player, i, player:getSkillLevel(i), player:getSkillLevelPercent(i))
toggleSkill('skillId' .. i, player:getSkillLevel(i) > 0)
end
end

update()
updateHeight()
end
Expand Down

0 comments on commit a955a29

Please sign in to comment.