Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: forge in old protocol #784

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading