Solved Create New Skill - Mining

Allesn

Member
Joined
May 4, 2011
Messages
209
Reaction score
24
How do I create a new skill, for example, a mining. The lua script I do based on fishing.

Thank You
 

Xikini

I whore myself out for likes
Premium User
Joined
Nov 17, 2010
Messages
4,043
Reaction score
2,114
If you want a 'real bar', it will require a source edit and a client edit.
If you want it to just be an invisible skill, you can use a single storage value, and just incorporate it into the script when they successfully mine materials.
 

Il Knight

Intermediate OT User
Joined
Dec 1, 2014
Messages
551
Reaction score
265
Location
Spain
1=
If you are using OTclient, Like Xikini says, you need edit the Client and of course the sources to add the New skill, or if you mean "change" the Fishing for the "Minning" you need to REPLACE all the names in the sources "fishing" for the new name.

2=
you can continue using Tibia normal Client.
with an Hex editor You can edit the Tibia.exe and change the Name Fishing for Minning

to be fast i recommend to you, Only change the external name "fishing" of the client, and modify the Sources to get new message "You advance on Minning Knowledge/Fighting/skill"
 

Il Knight

Intermediate OT User
Joined
Dec 1, 2014
Messages
551
Reaction score
265
Location
Spain
If you need help with the "Source edit" or the "Client edit" reply here.
 
OP
Allesn

Allesn

Member
Joined
May 4, 2011
Messages
209
Reaction score
24
1. I want a real bar, I've edited the otclient (sources and game_skills)
2. I want add one more (mining), not replace fishing
3. I need help with source edit :x
 

Vaka

Collapser Zulu Mapper
Joined
Sep 21, 2010
Messages
425
Reaction score
425
just connect your positive terminal to your negative terminal and all of your dreams will come true.
 
OP
Allesn

Allesn

Member
Joined
May 4, 2011
Messages
209
Reaction score
24
1 - I searched for "fish" in the source and added below that the mining skill.
2 - I made the changes in the database.
3 - I changed the otclient where I added the bar (see the image). The initial value in bar appears correctly (Mining 10), but when I use the pick, the bar does not increase
3.1 - II created the action when using pick, and when I use, it performs player:addSkillTries(SKILL_MINING, 1)

PS: When I run player:addSkillTries(SKILL MINING, 1), it is not changing the value in the database

Image:

My Edited Source:
https://www.sendspace.com/file/m90nxg
 

Elbow

Member
Joined
Jan 6, 2014
Messages
97
Reaction score
31
what is the ID of mining skill in your client? have you made it 7 just like in sources? since you shifted SKILL_MAGLEVEL and SKILL_LEVEL by +1 in server, I hope you also did it in client

how about vocations.xml? did you add something like this for each vocation
Code:
<skill id="7" multiplier="1.1" />
since I noticed you didn't add this to vocation.cpp
Code:
   skillMultipliers[7] = 1.1f;
 
OP
Allesn

Allesn

Member
Joined
May 4, 2011
Messages
209
Reaction score
24
what is the ID of mining skill in your client? have you made it 7 just like in sources? since you shifted SKILL_MAGLEVEL and SKILL_LEVEL by +1 in server, I hope you also did it in client

how about vocations.xml? did you add something like this for each vocation
Code:
<skill id="7" multiplier="1.1" />
since I noticed you didn't add this to vocation.cpp
Code:
   skillMultipliers[7] = 1.1f;
Actually, I forgot to make changes to these two files. I'll do here and after a while I say if it worked.
Thank you
 
OP
Allesn

Allesn

Member
Joined
May 4, 2011
Messages
209
Reaction score
24
I've made the changes, still won't work.
In otclient, the ID of mining skill is 7, like in sources.
But, in otclient I only change const.h and skills.otui

Part of code in const.h:
Code:
    enum Skill {
        Fist = 0,
        Club,
        Sword,
        Axe,
        Distance,
        Shielding,
        Fishing,
        Mining,
        LastSkill
    };
EDIT
I made one more change in vocations.cpp, had also forgot skillBase, now it's working :D
Code:
uint32_t Vocation::skillBase[SKILL_LAST + 1] = {50, 50, 50, 50, 30, 100, 20, 20};
Proof:


Thank you, problem solved :D
 
Last edited:

sowpert

New Member
Joined
Jun 9, 2010
Messages
3
Reaction score
0
I've made the changes, still won't work.
In otclient, the ID of mining skill is 7, like in sources.
But, in otclient I only change const.h and skills.otui

Part of code in const.h:
Code:
    enum Skill {
        Fist = 0,
        Club,
        Sword,
        Axe,
        Distance,
        Shielding,
        Fishing,
        Mining,
        LastSkill
    };
EDIT
I made one more change in vocations.cpp, had also forgot skillBase, now it's working :D
Code:
uint32_t Vocation::skillBase[SKILL_LAST + 1] = {50, 50, 50, 50, 30, 100, 20, 20};
Proof:


Thank you, problem solved :D
Could you explain me briefly what did you do to add this mining system?
 

gicu0770

Well-Known Member
Joined
Feb 26, 2011
Messages
81
Reaction score
11
I've made the changes, still won't work.
In otclient, the ID of mining skill is 7, like in sources.
But, in otclient I only change const.h and skills.otui

Part of code in const.h:
Code:
    enum Skill {
        Fist = 0,
        Club,
        Sword,
        Axe,
        Distance,
        Shielding,
        Fishing,
        Mining,
        LastSkill
    };
EDIT
I made one more change in vocations.cpp, had also forgot skillBase, now it's working :D
Code:
uint32_t Vocation::skillBase[SKILL_LAST + 1] = {50, 50, 50, 50, 30, 100, 20, 20};
Proof:


Thank you, problem solved :D
Do you can show us how to?
 
Top