• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help with post my server online

Iceraz

New Member
Joined
Dec 3, 2017
Messages
4
Solutions
1
Reaction score
1
Hi guys!!

I got the release 1.2 (forgotten) and I'm using this with orts (server and map).
And I already finished my first version to put it online my server.

My doubt is... I implemented everything in Windows... If I download it in my server on digitalOcean (linux (ubuntu)) it will work correctly?
If not... How should I do?

This was my question.. rsrs
Now... my request =)

Could you implement skills rates uping by stages like level? example:
lvl 07 - 50 [200x]
lvl 50 - 70 [150x]
lvl 70 - 99 [100x]

I would like to have something like that for skills:
sword,axe,club,fist
skill 10 - 30 [50x]
skill 31 - 50 [30x]
....
magLvl
skill 0 - 20 [10x]

Since now, thank you for attention.
Best regards all
 
Solution
I have not tested this, open up player.lua in data/events/scripts and find onGainSkillTries(skill, tries) it should be at the bottom of the file. Then select the whole function and replace it with this.
Lua:
SkillsTable = {
    [0] = { --[[ SKILL_FIST ]]
        stage = { -- [1, 9] is the skill level range for this skill, level 1 to level 9
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [1] = { --[[ SKILL_CLUB ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [2] = { --[[ SKILL_SWORD ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    }...
Hi guys!!

I got the release 1.2 (forgotten) and I'm using this with orts (server and map).
And I already finished my first version to put it online my server.

My doubt is... I implemented everything in Windows... If I download it in my server on digitalOcean (linux (ubuntu)) it will work correctly?
If not... How should I do?

This was my question.. rsrs
Now... my request =)

Could you implement skills rates uping by stages like level? example:
lvl 07 - 50 [200x]
lvl 50 - 70 [150x]
lvl 70 - 99 [100x]

I would like to have something like that for skills:
sword,axe,club,fist
skill 10 - 30 [50x]
skill 31 - 50 [30x]
....
magLvl
skill 0 - 20 [10x]

Since now, thank you for attention.
Best regards all
I have not tested this, open up player.lua in data/events/scripts and find onGainSkillTries(skill, tries) it should be at the bottom of the file. Then select the whole function and replace it with this.
Lua:
SkillsTable = {
    [0] = { --[[ SKILL_FIST ]]
        stage = { -- [1, 9] is the skill level range for this skill, level 1 to level 9
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [1] = { --[[ SKILL_CLUB ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [2] = { --[[ SKILL_SWORD ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [3] = { --[[ SKILL_AXE ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [4] = { --[[ SKILL_DISTANCE ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [5] = { --[[ SKILL_SHIELD ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [6] = { --[[ SKILL_FISHING ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [7] = { --[[ SKILL_MAGLEVEL ]]
        stage = {
            [{1, 9}] = 5,
            [{10, 19}] = 4
        },
        rate = 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 configKeys[skills.rate] then
        local rate = configManager.getNumber(configKeys[skills.rate])
        if rate > 0 then
            return tries * rate
        else
            return tries * getSkillsRate(self:getEffectiveSkillLevel(skill), skill)
        end
    end
end
 
I have not tested this, open up player.lua in data/events/scripts and find onGainSkillTries(skill, tries) it should be at the bottom of the file. Then select the whole function and replace it with this.
Lua:
SkillsTable = {
    [0] = { --[[ SKILL_FIST ]]
        stage = { -- [1, 9] is the skill level range for this skill, level 1 to level 9
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [1] = { --[[ SKILL_CLUB ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [2] = { --[[ SKILL_SWORD ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [3] = { --[[ SKILL_AXE ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [4] = { --[[ SKILL_DISTANCE ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [5] = { --[[ SKILL_SHIELD ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [6] = { --[[ SKILL_FISHING ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [7] = { --[[ SKILL_MAGLEVEL ]]
        stage = {
            [{1, 9}] = 5,
            [{10, 19}] = 4
        },
        rate = 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 configKeys[skills.rate] then
        local rate = configManager.getNumber(configKeys[skills.rate])
        if rate > 0 then
            return tries * rate
        else
            return tries * getSkillsRate(self:getEffectiveSkillLevel(skill), skill)
        end
    end
end


I tried it now... but the skills never up... I attack... attack... attack and nothing "/

I have not tested this, open up player.lua in data/events/scripts and find onGainSkillTries(skill, tries) it should be at the bottom of the file. Then select the whole function and replace it with this.
Lua:
SkillsTable = {
    [0] = { --[[ SKILL_FIST ]]
        stage = { -- [1, 9] is the skill level range for this skill, level 1 to level 9
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [1] = { --[[ SKILL_CLUB ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [2] = { --[[ SKILL_SWORD ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [3] = { --[[ SKILL_AXE ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [4] = { --[[ SKILL_DISTANCE ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [5] = { --[[ SKILL_SHIELD ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [6] = { --[[ SKILL_FISHING ]]
        stage = {
            [{1, 9}] = 50,
            [{10, 19}] = 40
        },
        rate = RATE_SKILL
    },
    [7] = { --[[ SKILL_MAGLEVEL ]]
        stage = {
            [{1, 9}] = 5,
            [{10, 19}] = 4
        },
        rate = 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 configKeys[skills.rate] then
        local rate = configManager.getNumber(configKeys[skills.rate])
        if rate > 0 then
            return tries * rate
        else
            return tries * getSkillsRate(self:getEffectiveSkillLevel(skill), skill)
        end
    end
end


I finished man... I had to implement some changes... but it is now done. Look...
First of all in config.lua change rateSkill and rateMagic to 0 (zero)
Lua:
rateSkill = 0
rateMagic = 0

and in data/events/scripts/player.lua I changed in the table SkillsTable the value of rate in each element, and now looks like this:
Lua:
SkillsTable = {
  [0] = { --[[ SKILL_FIST ]]
    stage = { -- [1, 9] is the skill level range for this skill, level 1 to level 9
      [{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
  }
}

and to finish... in the function onGainSkillTries I edited some lines... and now looks like this:
Lua:
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

Thanks for help! Without I could not implement it. <3
 
Last edited by a moderator:
Solution
Back
Top