• 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!

How to create new skills

Flockoloco

New Member
Joined
Apr 25, 2024
Messages
1
Reaction score
0
Hello there,
I'm currently trying to learn lua and so why not using OTC + FTS. Is there a guide/tutorial to create features (skills and UI)? I'm will be implementing that on local host
 
Last edited:


Worked perfect for me on TFS 1.5:
d34a3eb11d8e448875ef5fec68f2c54c.png
 
1724728595959.webp
and how do you level up the skill, where is it modified like this in the image?


Worked perfect for me on TFS 1.5:
d34a3eb11d8e448875ef5fec68f2c54c.png
 
View attachment 86831
and how do you level up the skill, where is it modified like this in the image?
This is only for adding new skills to the client (@edit to the client and of course server too) but you must create on your own how the skills are gained (or what they give).

On the server I currently work I've divided Distance skill into:
->bows
->crossbows
->throwing weapons
and had to edit TFS's source so that I can choose in items.xml between those weapons and so that they add the correct skill (and they work overall).

I also got woodcutting, smithing etc.


You can take for example this script and instead of
skill = SKILL_AXE
You could put
skill - SKILL_WOODCUT
(or whatever you call your woodcutting in your source)

So that players gain woodcutting skill instead of axe skill when cutting the trees! (makes sense i guess)

You could also develop the script further (like i did) and add all the tree types to the script and after that you could add skill requirement for cutting each tree (like i did).
 
Last edited:
View attachment 86831
and how do you level up the skill, where is it modified like this in the image?

Once you've added this feature and also correctly added it to your client, what you can now do is call upon the following to add Skill Tries:
A good example would be the fishing.lua script, here you will see how fishing skill is calculated in LUA with a calculation, either just copy that or modify it.

Simply just:
doPlayerAddSkillTry(cid, SKILL_WOODCUTTING, 1)

or with random number:
doPlayerAddSkillTry(cid, SKILL_COOKING, 1)
local formula = (getPlayerSkill(cid, SKILL_COOKING) / 200) + (0.85 * math.random())

or

player:addSkillTries(SKILL_FISHING, 1)
if math.random(1, 100) <= math.min(math.max(10 + (player:getEffectiveSkillLevel(SKILL_FISHING) - 10) * 0.597, 10), 50) then

----------------

- Make sure you have the correct MySQL strings added to your database! Or else the tries will not save.
 
Thank you very much for the information :D
Message or post anything, if you need any help, at first, try to add one skill, something that you can also easy implement server side, for example an action on your shovel!

Once you are confident with that, you can add as many skills as you can :)

At the moment, I have always used the calculation set at fising.lua but you can modify those values easily, I don't really recommend using the +1 skilltry all the time, always better to have it work on a formula, this way it scales better, and the player doesn't have the feeling they are grinding for nothing.
 
Back
Top