• Congratulations to the OTLand February Mapping Competition Winner! The grand prize of Otland Premium goes to eiserne festung.
  • 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!

Show additional skills on client

Ramirow

Advanced OT User
Joined
Aug 22, 2009
Messages
538
Solutions
15
Reaction score
244
Location
Argentina
This goes hand to hand with my other thread Feature - [TFS 1.3] Adding New Skills (https://otland.net/threads/tfs-1-3-adding-new-skills.265784/)

In order to display an additional skill you code into the sources, you must edit the following files:
(I will use the same example as my other thread, "Runecraft")

src/client/const.h
Search for: enum Skill {. Under the Fishing, line just add: Runecraft,

src/client/protocolgameparse.cpp

Search for: int lastSkill = Otc::Fishing + 1; and replace it with int lastSkill = Otc::Runecraft + 1;
Next look for if(skill <= Otc::Fishing) and change to if(skill <= Otc::Runecraft)

That's enough for source edits, compile it and it's half way done.
Next, we need to modify some otc modules.

modules/gamelib/const.lua

Look for line Skill = {
Edit that table until it has the correct ids. Example.
Code:
Skill = {
  Fist = 0,
  Club = 1,
  Sword = 2,
  Axe = 3,
  Distance = 4,
  Shielding = 5,
  Fishing = 6,
  Runecraft = 7,
  CriticalChance = 8,
  CriticalDamage = 9,
  LifeLeechChance = 10,
  LifeLeechAmount = 11,
  ManaLeechChance = 12,
  ManaLeechAmount = 13
}

modules/game_skills/skills.otui

Search for
Code:
SkillButton
      id: skillId6
      SkillNameLabel
        !text: tr('Fishing')
      SkillValueLabel
      SkillPercentPanel
Under it paste
Code:
SkillButton
      id: skillId7
      SkillNameLabel
        !text: tr('Runecraft')
      SkillValueLabel
      SkillPercentPanel
Remember to give a +1 to the id of skills below (Critical hit chance, manaleech, etc)

modules/game_skills/skills.lua

Search for if i > Skill.Fishing then and change it to if i > Skill.Runecraft then

That should be enough. Hope it helps someone.
 

~X~

LoA Founder
Premium User
Joined
Oct 30, 2007
Messages
365
Reaction score
61
Location
USA
Followed this and I ended up with the following...
otc.png
 

~X~

LoA Founder
Premium User
Joined
Oct 30, 2007
Messages
365
Reaction score
61
Location
USA
Are you sure you can compile the client without any modifications? As in the picture you uploaded at least, it doesn't mention any error pointing to the two files you needed to modify.
That was a fresh OTC src, only edit's was your skill edits.
 
OP
Ramirow

Ramirow

Advanced OT User
Joined
Aug 22, 2009
Messages
538
Solutions
15
Reaction score
244
Location
Argentina
That was a fresh OTC src, only edit's was your skill edits.
I get that, but try downloading the source, don't edit anything and try to compile without any changes. If it succeeds I might download the new sources to see if anything changed drastically from August to November

I may also ask you, are you trying to compile in release 64bits?
 
Last edited:

~X~

LoA Founder
Premium User
Joined
Oct 30, 2007
Messages
365
Reaction score
61
Location
USA
I get that, but try downloading the source, don't edit anything and try to compile without any changes. If it succeeds I might download the new sources to see if anything changed drastically from August to November

I may also ask you, are you trying to compile in release 64bits?
I got it working hehe Delusion helped me out!
 
OP
Ramirow

Ramirow

Advanced OT User
Joined
Aug 22, 2009
Messages
538
Solutions
15
Reaction score
244
Location
Argentina
I am experiencing the exact same issue. How did you resolve this?

Thanks in advance!

Panza
Did you tried to compile the otclient source without modifications? Just to see if you have your compiler set up properly.
 

panza17

New Member
Joined
Apr 6, 2019
Messages
6
Reaction score
0
Did you tried to compile the otclient source without modifications? Just to see if you have your compiler set up properly.

I fixed it by adding luajit to the #includes in the source files that were giving problems. It was the first time i have compiled the client myself and i must say that it misses a lot of features that were included in the downloadable client from otv8. Maybe i have to add these myself. Anyway i followed your entire tutorial but it wasn't showing the new skill. It might have to do something with the database. I followed your guide on how to update the existing database.

1614113417387.png

Kind regards
 
OP
Ramirow

Ramirow

Advanced OT User
Joined
Aug 22, 2009
Messages
538
Solutions
15
Reaction score
244
Location
Argentina
I fixed it by adding luajit to the #includes in the source files that were giving problems. It was the first time i have compiled the client myself and i must say that it misses a lot of features that were included in the downloadable client from otv8. Maybe i have to add these myself. Anyway i followed your entire tutorial but it wasn't showing the new skill. It might have to do something with the database. I followed your guide on how to update the existing database.

View attachment 55423

Kind regards
You have the error there on the screen, the correct syntax seems to be using a different quotation mark for the skill, you have this one " ' " but it should be " ` " this one i believe, hope it makes sense
So, in short:
Code:
'skill_mining'
Should be:
Code:
`skill_mining`

Check the update query to change as needed.
 

Oneda

Map-Learner
Premium User
Joined
Dec 3, 2013
Messages
148
Solutions
2
Reaction score
36
1614429892822.png

Not really sure whats causing that, can anyone help?
If it matters: built on Release x64
 

Similar threads

Top